diff options
author | Brad King <brad.king@kitware.com> | 2014-01-10 14:19:49 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-01-10 14:19:49 (GMT) |
commit | f2641ac3e0debaa841f55910447ca61a38c9b02a (patch) | |
tree | 2bed0d39a62a03d0f7851e345d36bc518956983d | |
parent | aacad3238faf71ed44ac0400b1fd71100b493960 (diff) | |
parent | e7a111f0945315b983cdb4d5d9f94b28e52598d4 (diff) | |
download | CMake-f2641ac3e0debaa841f55910447ca61a38c9b02a.zip CMake-f2641ac3e0debaa841f55910447ca61a38c9b02a.tar.gz CMake-f2641ac3e0debaa841f55910447ca61a38c9b02a.tar.bz2 |
Merge topic 'minor-cleanups'
e7a111f InterfaceLibrary: Add test requiring MAP_IMPORTED_CONFIG whitelisting
-rw-r--r-- | Tests/InterfaceLibrary/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/InterfaceLibrary/map_config.cpp | 15 |
2 files changed, 28 insertions, 0 deletions
diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt index b396eb6..81b34e6 100644 --- a/Tests/InterfaceLibrary/CMakeLists.txt +++ b/Tests/InterfaceLibrary/CMakeLists.txt @@ -29,3 +29,16 @@ target_link_libraries(iface_whitelist INTERFACE $<$<BOOL:$<TARGET_PROPERTY:CUSTO add_executable(exec_whitelist dummy.cpp) target_link_libraries(exec_whitelist iface_whitelist) + +add_library(iface_imported INTERFACE IMPORTED) +set_property(TARGET iface_imported PROPERTY + INTERFACE_COMPILE_DEFINITIONS + $<$<CONFIG:SPECIAL>:SPECIAL_MODE> + $<$<CONFIG:Debug>:DEBUG_MODE> +) +set_property(TARGET iface_imported PROPERTY + MAP_IMPORTED_CONFIG_DEBUG SPECIAL +) + +add_executable(map_config map_config.cpp) +target_link_libraries(map_config iface_imported) diff --git a/Tests/InterfaceLibrary/map_config.cpp b/Tests/InterfaceLibrary/map_config.cpp new file mode 100644 index 0000000..81bb666 --- /dev/null +++ b/Tests/InterfaceLibrary/map_config.cpp @@ -0,0 +1,15 @@ + +#ifdef DEBUG_MODE +#ifndef SPECIAL_MODE +#error Special configuration should be mapped to debug configuration. +#endif +#else +#ifdef SPECIAL_MODE +#error Special configuration should not be enabled if not debug configuration +#endif +#endif + +int main(int,char**) +{ + return 0; +} |