From 2e39d21c87786d7b714dd0f88ec4386fce8ac0b1 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 25 Feb 2013 15:24:15 +0100 Subject: Remove use of TARGET_DEFINED from target_include_directories test. Change the unit test introduced in commit 24dcf0c0 (Make sure generator expressions can be used with target_include_directories., 2013-01-16) to not use the expression, but still test the appropriate code. --- Tests/CMakeCommands/target_include_directories/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt index c2da175..c03f0f8 100644 --- a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt +++ b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt @@ -30,12 +30,12 @@ target_include_directories(target_include_directories PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/poison" ) target_include_directories(target_include_directories - BEFORE PUBLIC "$<$:${CMAKE_CURRENT_BINARY_DIR}/cure>" + BEFORE PUBLIC "$<$,EXECUTABLE>:${CMAKE_CURRENT_BINARY_DIR}/cure>" ) -# Has no effect because the target is not defined: +# Has no effect because the target type is not SHARED_LIBRARY: target_include_directories(target_include_directories - BEFORE PUBLIC "$<$:${CMAKE_CURRENT_BINARY_DIR}/poison>" + BEFORE PUBLIC "$<$,SHARED_LIBRARY>:${CMAKE_CURRENT_BINARY_DIR}/poison>" ) add_executable(consumer -- cgit v0.12 From 47b8d322a4d9598706948553dfbf9daebe80dcef Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 25 Feb 2013 15:26:37 +0100 Subject: Remove use of TARGET_DEFINED from the ExportImport test. Update the unit test introduced in commit 5daaa5c4 (Fix TARGET_PROPERTY target extractions., 2013-01-26) to not use the expression, but still test the appropriate code. --- Tests/ExportImport/Export/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index ae938cd..c00ef82 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -149,7 +149,7 @@ set_property(TARGET testLibRequired APPEND PROPERTY $> $> # Test that the below is non-fatal - $<$:$> + $<$:$> ) set_property(TARGET testLibRequired APPEND PROPERTY -- cgit v0.12 From 21a342c8b16df2cc9ea34ef494ba8ffd7f3a450a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 25 Feb 2013 15:31:40 +0100 Subject: Remove use of TARGET_DEFINED from the target_link_libraries test. Update the unit test introduced in commit 57175d55 (Only use early evaluation termination for transitive properties., 2013-02-07) to not use the expression, but still test the appropriate code. --- Tests/CMakeCommands/target_link_libraries/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt index 19ee59f..b13c13d 100644 --- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt +++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt @@ -103,7 +103,7 @@ target_compile_definitions(depG INTERFACE ) add_executable(targetC targetC.cpp) -# Creates a generator expression for include directories like -# $<$,EXECUTABLE>:depG>>:\ -# $,EXECUTABLE>:depG>,INTERFACE_INCLUDE_DIRECTORIES>> -target_link_libraries(targetC $<$,EXECUTABLE>:depG>) +# The TARGET_PROPERTY expression is duplicated below to test that there is no +# shortcutting of the evaluation by returning an empty string. +set(_exe_test $,EXECUTABLE>) +target_link_libraries(targetC $<$:depG>) -- cgit v0.12 From cbf07569ed0a1e64b7131ba989c2cc16f1e3c16f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 23 Feb 2013 13:30:38 +0100 Subject: Revert "Add the TARGET_DEFINED generator expression" This reverts commit 2bee6f5ba5b3f33817cc00e056a7df60d05c9399. This expression is not used, and has a semantic which is not completely optimal (namely considering utility targets to be targets, though usually we are interested in linkable targets). Remove it so that we have more freedom to define better expressions in the future. Conflicts: Source/cmGeneratorExpressionEvaluator.cxx Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt Tests/CMakeCommands/target_compile_definitions/consumer.cpp --- Source/cmDocumentGeneratorExpressions.h | 1 - Source/cmGeneratorExpressionEvaluator.cxx | 18 ------------------ .../target_compile_definitions/CMakeLists.txt | 2 -- .../target_compile_definitions/consumer.cpp | 8 -------- 4 files changed, 29 deletions(-) diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h index 8b80a8a..76a60c3 100644 --- a/Source/cmDocumentGeneratorExpressions.h +++ b/Source/cmDocumentGeneratorExpressions.h @@ -37,7 +37,6 @@ "target in the same buildsystem. Expands to the empty string " \ "otherwise.\n" \ " $ = main file (.exe, .so.1.2, .a)\n" \ - " $ = '1' if tgt is a target, else '0'\n" \ " $ = file used to link (.a, .lib, .so)\n" \ " $ = file with soname (.so.3)\n" \ "where \"tgt\" is the name of a target. " \ diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index cd6a40b..b5fe8ba 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -291,22 +291,6 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode } configurationTestNode; -static const struct TargetDefinedNode : public cmGeneratorExpressionNode -{ - TargetDefinedNode() {} - - virtual int NumExpectedParameters() const { return 1; } - - std::string Evaluate(const std::vector ¶meters, - cmGeneratorExpressionContext *context, - const GeneratorExpressionContent *, - cmGeneratorExpressionDAGChecker *) const - { - return context->Makefile->FindTargetToUse(parameters.front().c_str()) - ? "1" : "0"; - } -} targetDefinedNode; - //---------------------------------------------------------------------------- static const char* targetPropertyTransitiveWhitelist[] = { "INTERFACE_INCLUDE_DIRECTORIES" @@ -942,8 +926,6 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier) return &buildInterfaceNode; else if (identifier == "INSTALL_INTERFACE") return &installInterfaceNode; - else if (identifier == "TARGET_DEFINED") - return &targetDefinedNode; else if (identifier == "INSTALL_PREFIX") return &installPrefixNode; return 0; diff --git a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt index 8a4437b..6d0e646 100644 --- a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt +++ b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt @@ -18,7 +18,5 @@ add_executable(consumer target_compile_definitions(consumer PRIVATE $ - $<$:SHOULD_NOT_BE_DEFINED> - $<$:SHOULD_BE_DEFINED> -DDASH_D_DEFINE ) diff --git a/Tests/CMakeCommands/target_compile_definitions/consumer.cpp b/Tests/CMakeCommands/target_compile_definitions/consumer.cpp index 1a46aa5..a391114 100644 --- a/Tests/CMakeCommands/target_compile_definitions/consumer.cpp +++ b/Tests/CMakeCommands/target_compile_definitions/consumer.cpp @@ -11,14 +11,6 @@ #error Expected MY_INTERFACE_DEFINE #endif -#ifdef SHOULD_NOT_BE_DEFINED -#error Unexpected SHOULD_NOT_BE_DEFINED -#endif - -#ifndef SHOULD_BE_DEFINED -#error Expected SHOULD_BE_DEFINED -#endif - #ifndef DASH_D_DEFINE #error Expected DASH_D_DEFINE #endif -- cgit v0.12