Repository in which I test various stuff in CMake.
- Clone the repository and pull its submodules.
- Run
cmake
(orcmake-gui
if you prefer the graphical interface) and select the build system (ninja
, etc.).- Set
CMAKE_BUILD_TYPE
to eitherDebug
orRelease
. - Set the build directory to somewhere you have write access (like
/home/you/builds/cmake_testbench/debug-or-release/build
). - Set
CMAKE_INSTALL_PREFIX
to somewhere you have write access (like/home/you/builds/cmake_testbench/debug-or-release/install
). - To toggle verbose build information, change
CMAKE_TESTBENCH_VERBOSE_BUILD
(default isON
) - To toggle the installation, change
CMAKE_TESTBENCH_INSTALL
(default isON
).
- Set
Configure
and thenGenerate
.- Go to your build directory and build (
ninja
or whatever you selected).
- Build
main_project
and install it. - Set
cmake_testbench_DIR
toyour_install/lib/cmake/cmake_testbench
- Change
CMAKE_INSTALL_PREFIX
to avoid polluting your system. - Configure, generate, compile same as
main_project
.