2012-08-09 11:44:15 +04:00
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
|
|
|
|
project(CompileDefinitions)
|
|
|
|
|
2012-08-21 13:04:09 +04:00
|
|
|
if ("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 6")
|
|
|
|
add_definitions(-DNO_SPACES_IN_DEFINE_VALUES)
|
2013-05-22 12:25:27 +04:00
|
|
|
set(NO_SPACES_IN_DEFINE_VALUES 1)
|
2012-08-21 13:04:09 +04:00
|
|
|
endif()
|
|
|
|
|
2013-03-25 17:43:22 +04:00
|
|
|
# Use compile flags to tell executables which config is built
|
|
|
|
# without depending on the compile definitions functionality.
|
|
|
|
foreach(c DEBUG RELEASE RELWITHDEBINFO MINSIZEREL)
|
|
|
|
set(CMAKE_C_FLAGS_${c} "${CMAKE_C_FLAGS_${c}} -DTEST_CONFIG_${c}")
|
|
|
|
set(CMAKE_CXX_FLAGS_${c} "${CMAKE_CXX_FLAGS_${c}} -DTEST_CONFIG_${c}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
|
|
|
|
"BUILD_CONFIG_NAME=\"$<CONFIGURATION>\""
|
|
|
|
)
|
|
|
|
|
2012-08-09 11:44:15 +04:00
|
|
|
add_subdirectory(add_definitions_command)
|
|
|
|
add_subdirectory(target_prop)
|
|
|
|
add_subdirectory(add_definitions_command_with_target_prop)
|
|
|
|
|
2013-03-25 17:43:22 +04:00
|
|
|
add_executable(CompileDefinitions runtest.c)
|