Cmake

From miki
Revision as of 09:46, 13 June 2023 by Mip (talk | contribs)
Jump to navigation Jump to search

Select toolchain

On Windows

On Windows, cmake default to the latest Visual Studio version installed on the system. To select MinGW toolchain [1]:

cmake -G "MinGW Makefiles" .

Tips

Print variables

# Using message
message(PROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}")

# Using helper:
include(CMakePrintHelpers)
cmake_print_variables(PROJECT_SOURCE_DIR ANOTHER_VARIABLE