cmake
Configure
Section titled “Configure”./bootstrapacceptscmakevariables after---DBUILD_CursesDialog=OFFpreventsccmakefrom being built- There is no configure option to prevent
cpackandctestfrom being built ctestis not only used for runningcmake’s test suite, but also for running tests in other projects that usecmake- Use bundled versions of
librhashandlibuv; no other package depends on them to justify providing them system-wide ./bootstrappasses the following by default:
--no-system-libs--no-system-cppdap--no-system-curl--no-system-expat--no-system-jsoncpp--no-system-zlib--no-system-bzip2--no-system-liblzma--no-system-nghttp2--no-system-zstd--no-system-libarchive--no-system-librhash--no-system-libuv--no-qt-gui--debugger- glaucus passes
--system-libsthen turns offcppdap,jsoncpp,nghttp2,librhashandlibuv --no-qt-guiis equal to-DBUILD_QtDialog=OFF- These options allow the early bootstrapped version
Bootstrap.cmk/cmaketo link against system installed libaries (glaucus already passes--no-system-for all of them in the final version ofcmake):
--bootstrap-system-libuv--bootstrap-system-jsoncpp--bootstrap-system-librhashBUILD_SHARED_LIBSis forcedOFFinternally; do not change it- It does not make sense to use
CMake_TEST_NO_NETWORKandCMAKE_RUN_LONG_TESTSwhen-DBUILD_TESTING=OFFis already set - It also does not make sense to use
CMAKE_USE_SYSTEM_FORMwhen-DBUILD_CursesDialog=OFFis already set - There’s no need to use
CMAKE_SKIP_BUILD_RPATHandCMAKE_SKIP_INSTALL_RPATHwhen-DCMAKE_SKIP_RPATH=ONis already set as it omitsrpathin both build and install targets - If a project breaks with
-DCMAKE_SKIP_RPATH=ONdowngrade to-DCMAKE_SKIP_INSTALL_RPATH=ON CMake_BUILD_LTOis only effective when bootstrapping thecmakeexecutable; use-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ONto enableltoforglaucus-cmake- There is no need to set
CMAKE_C_COMPILER,CMAKE_CXX_COMPILER,CMAKE_C_FLAGS,CMAKE_CXX_FLAGSandCMAKE_EXE_LINKER_FLAGSascmakeautomatically readsCC,CXX,CFLAGS,CXXFLAGSandLDFLAGSfrom the environment GNUInstallDirsmentions thatSYSCONFDIR,LOCALSTATEDIRandRUNSTATEDIRare special cases that accept absolute paths whereas other directories are relative paths toPREFIXwhich when set to/usrtriggers this special case; do note thatcmakedoes not treatSHAREDSTATEDIRas a special case and expects it to becom(relative to/usr, meaning/usr/com) which is not the case here as glaucus expects it to be/var/libwhich is why we set it as an absolute value
cmakecan be built withmakewithout requiringninja,samuormuon
Package
Section titled “Package”- Absolute paths are allowed for
CMAKE_INSTALL_<dir>, but are not recommended
cmakeinterprets1/ON/YES/TRUE/Yastrue; glaucus recommends usingONcmakeinterprets0/OFF/NO/FALSE/N/IGNORE/NOTFOUNDasfalse; glaucus recommends usingOFF
- Bootstrapping used to fail when
$MAKEwas set as it expectscmake_make_processor=$MAKEwhich ismakeon glaucus
References
Section titled “References”- https://cmake.org/cmake/help/latest/command/install.html
- https://cmake.org/cmake/help/latest/envvar/DESTDIR.html
- https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html
- https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
- https://cmake.org/cmake/help/latest/policy/CMP0069.html
- https://cmake.org/cmake/help/latest/policy/CMP0192.html
- https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html
- https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html
- https://linuxfromscratch.org/blfs/view/svn/kde/extra-cmake-modules.html