CMake: Difference between revisions
jfc |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 17: | Line 17: | ||
message(STATUS "Requested build mode: ${CMAKE_BUILD_TYPE}") | message(STATUS "Requested build mode: ${CMAKE_BUILD_TYPE}") | ||
</pre> | </pre> | ||
Build types can be added. I thought this might be useful for a <tt>Coverage</tt> target, but I ended up stuffing the coverage flags into <tt>CMAKE_C_FLAGS_DEBUG</tt>/<tt>CMAKE_CXX_FLAGS_DEBUG</tt>. | |||
==Debugging== | |||
Dump all current variables with: | |||
<pre> | |||
get_cmake_property(_variableNames VARIABLES) | |||
list (SORT _variableNames) | |||
foreach (_variableName ${_variableNames}) | |||
message(STATUS "${_variableName}=${${_variableName}}") | |||
endforeach() | |||
</pre> | |||
Better yet, <tt>include(CMakePrintHelpers)</tt> to get the useful commands <tt>cmake_print_properties()</tt> and <tt>cmake_print_variables()</tt>. | |||