#1012 Add information about "%__cmake_builddir" macro
Merged 3 years ago by decathorpe. Opened 3 years ago by mschorm.
mschorm/packaging-committee adition_of_cmake-builddir_macro  into  master

@@ -29,6 +29,7 @@ 

  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 @@ 

  `+%__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

  

no initial comment

Unfortunatelly, I haven't found an easy way to render the page from the code online - as e.g. on Fedora Wiki pages. So it might be a good idea to check it in some way before merging.

rebased onto 848745c

3 years ago

Since this is not a guideline change but only adds documentation for one of the internally used macros, I think we don't need to vote for this. Thanks for the PR.

Pull-Request has been merged by decathorpe

3 years ago
Metadata