From 567c8d103ed3c3cb7303877d89e8508dd3f8d0ca Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 12 Feb 2013 11:53:36 +0100 Subject: Revert "Don't allow utility or global targets in the LINKED expression." This reverts commit 9712362b4580fb92394ecf8ff57be186571f4319. --- Source/cmGeneratorExpressionEvaluator.cxx | 8 -------- .../BadLinked-UtilityTarget-result.txt | 1 - .../BadLinked-UtilityTarget-stderr.txt | 8 -------- .../BadLinked-UtilityTarget.cmake | 7 ------- .../TargetPropertyGeneratorExpressions/RunCMakeTest.cmake | 1 - Tests/RunCMake/TargetPropertyGeneratorExpressions/empty.cpp | 1 - 6 files changed, 26 deletions(-) delete mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadLinked-UtilityTarget-result.txt delete mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadLinked-UtilityTarget-stderr.txt delete mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadLinked-UtilityTarget.cmake delete mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/empty.cpp diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 6c1c12a..eb8cdc8 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -759,14 +759,6 @@ private: { return std::string(); } - if(target->GetType() >= cmTarget::UTILITY && - target->GetType() != cmTarget::UNKNOWN_LIBRARY) - { - ::reportError(context, content->GetOriginalExpression(), - "Target \"" + item - + "\" is not an executable or library."); - return std::string(); - } std::string propertyName = "INTERFACE_" + prop; const char *propContent = target->GetProperty(propertyName.c_str()); if (!propContent) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadLinked-UtilityTarget-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadLinked-UtilityTarget-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadLinked-UtilityTarget-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadLinked-UtilityTarget-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadLinked-UtilityTarget-stderr.txt deleted file mode 100644 index fb06554..0000000 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadLinked-UtilityTarget-stderr.txt +++ /dev/null @@ -1,8 +0,0 @@ -CMake Error at BadLinked-UtilityTarget.cmake:7 \(set_property\): - Error evaluating generator expression: - - \$ - - Target "check" is not an executable or library. -Call Stack \(most recent call first\): - CMakeLists.txt:8 \(include\) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadLinked-UtilityTarget.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadLinked-UtilityTarget.cmake deleted file mode 100644 index d114c8f..0000000 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadLinked-UtilityTarget.cmake +++ /dev/null @@ -1,7 +0,0 @@ - -add_custom_target(check ALL - COMMAND ${CMAKE_COMMAND} -E echo check -) - -add_library(foo STATIC empty.cpp) -set_property(TARGET foo PROPERTY INCLUDE_DIRECTORIES $) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake index 84039c4..ea48f61 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake @@ -16,4 +16,3 @@ run_cmake(BadInvalidName6) run_cmake(BadInvalidName7) run_cmake(BadInvalidName8) run_cmake(BadLinked) -run_cmake(BadLinked-UtilityTarget) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/empty.cpp b/Tests/RunCMake/TargetPropertyGeneratorExpressions/empty.cpp deleted file mode 100644 index 8b1a393..0000000 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/empty.cpp +++ /dev/null @@ -1 +0,0 @@ -// empty -- cgit v0.12