From 083de7ed35b26dceff6edeb4fc8f9d2500855a9b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 20 Sep 2012 23:28:09 +0200 Subject: Process generator expressions in the COMPILE_DEFINITIONS target property. --- Tests/CompileDefinitions/compiletest.cpp | 9 +++++++++ Tests/CompileDefinitions/target_prop/CMakeLists.txt | 6 ++++++ 2 files changed, 15 insertions(+) (limited to 'Tests/CompileDefinitions') diff --git a/Tests/CompileDefinitions/compiletest.cpp b/Tests/CompileDefinitions/compiletest.cpp index 6db6f3f96b..4a68a0750c 100644 --- a/Tests/CompileDefinitions/compiletest.cpp +++ b/Tests/CompileDefinitions/compiletest.cpp @@ -27,6 +27,15 @@ enum { #endif }; +#ifdef TEST_GENERATOR_EXPRESSIONS +#ifndef CMAKE_IS_DECLARATIVE +#error Expect declarative definition +#endif +#ifdef GE_NOT_DEFINED +#error Expect not defined generator expression +#endif +#endif + int main(int argc, char **argv) { return 0; diff --git a/Tests/CompileDefinitions/target_prop/CMakeLists.txt b/Tests/CompileDefinitions/target_prop/CMakeLists.txt index e2b6ba9b22..fcb22b0193 100644 --- a/Tests/CompileDefinitions/target_prop/CMakeLists.txt +++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt @@ -7,3 +7,9 @@ set_target_properties(target_prop_executable PROPERTIES COMPILE_DEFINITIONS CMAK set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_REALLY="Very Fun" CMAKE_IS=Fun) set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_FUN CMAKE_IS_="Fun") + +set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS + TEST_GENERATOR_EXPRESSIONS + "$<1:CMAKE_IS_DECLARATIVE>" + "$<0:GE_NOT_DEFINED>" +) -- cgit v1.2.1