From 848745c8b01e2730110a8a73269f45f3ca0dc184 Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Aug 06 2020 13:23:12 +0000 Subject: Add information about "%__cmake_builddir" macro --- diff --git a/guidelines/modules/ROOT/pages/CMake.adoc b/guidelines/modules/ROOT/pages/CMake.adoc index d212d2d..4f94823 100644 --- a/guidelines/modules/ROOT/pages/CMake.adoc +++ b/guidelines/modules/ROOT/pages/CMake.adoc @@ -29,6 +29,7 @@ You will generally make use of these in your specs: When packaging KDE software, you most likely would replace `+%cmake+` with `+%cmake_kf5+` that defines multiple KDE-related variables (shipped in `+kf5+` package). It is rarely necessary (but permissible) to use or alter these: +NOTE: All macros starting with double underscore is meant to be private, NOT stable and likely to be removed in the future. `+%__cmake+`:: The path to the cmake executable. @@ -37,6 +38,13 @@ It is rarely necessary (but permissible) to use or alter these: `+%__cmake_in_source_build+`:: Controls whether builds are done in-source (when defined) or out-of-source (when undefined). See the xref:vpath.adoc[Defining source and build directories] for more information. +`+%__cmake_builddir+`:: + Holds the location of the actual directory where the build was made. + When making https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds[out-of-source builds], this macro is the same as %_vpath_builddir, which should be used preferably in such cases. + See the xref:vpath.adoc[Defining source and build directories] for more information. + When doing in-source builds (that means before Fedora 33 https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds[out-of-source builds] change), this macro would differ from %_vpath_builddir and it will hold the actual location that was used for the build. + This is useful in cases, when you want to use the same SPECfile for different Fedora releases where on some the build is in-source and on some out-of-source AND you need to know the builddir location - e.g. when using "cmake -B %__cmake_builddir -LH" inbetween of %cmake and "%cmake_build". Whenever possible, using out-of-source builds is advised, as this is the direction both Fedora and CMake upstream bears. + Warning: This macro is suitable only for rare compatibility reasons. Once all active Fedora releases will use https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds[out-of-source builds], this macro will be redundant (same as %_vpath_builddir) and removed. == Example usage in the spec file