CMake: different operations with different build type -
i want add specific flags when compile in debug mode (gcc/linux). when call cmake want print these flags. if compile in release mode don't set these don't want print flags.
basically want print message if build in debug mode.
in cmakefile.txt i've following code:
# setting compiler if (cmake_compiler_is_gnucxx) set (user_debug_flags "-w -wall -wextra -winit-self -werror") message(status "setting flags linux compiler") if (cmake_build_type matches debug) list(append cmake_cxx_flags_debug ${user_debug_flags}) message(status "debug compiler flags: ${cmake_cxx_flags_debug") endif(cmake_build_type matches debug) endif(cmake_compiler_is_gnucxx)
if call cmake with
cmake /path/to/cmakefile.txt/ -dcmake_build_type=debug
i see first message (so linux compiler recognized) cannot see second message.
how can check if cmake_build_type
set debug or release?
Comments
Post a Comment