diff options
20 files changed, 155 insertions, 102 deletions
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst index be60ebb..03f9115 100644 --- a/Help/manual/cmake-buildsystem.7.rst +++ b/Help/manual/cmake-buildsystem.7.rst @@ -218,6 +218,8 @@ each keyword: PRIVATE serialization ) +.. _`Compatible Interface Properties`: + Compatible Interface Properties ------------------------------- diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 12cfaf8..ac8c3f8 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -104,6 +104,8 @@ expands to ``OLD_COMPILER`` if the than 4.2.0. ``$<CONFIGURATION>`` + Configuration name. Deprecated. Use ``CONFIG`` instead. +``$<CONFIG>`` Configuration name ``$<PLATFORM_ID>`` The CMake-id of the platform diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst index 376ec78..b572bf7 100644 --- a/Help/manual/cmake-packages.7.rst +++ b/Help/manual/cmake-packages.7.rst @@ -72,6 +72,10 @@ or as a separate ``OPTIONAL_COMPONENTS`` list: Handling of ``COMPONENTS`` and ``OPTIONAL_COMPONENTS`` is defined by the package. +By setting the :variable:`CMAKE_DISABLE_FIND_PACKAGE_<PackageName>` variable to +``TRUE``, the ``PackageName`` package will not be searched, and will always +be ``NOTFOUND``. + Config-file Packages -------------------- @@ -276,6 +280,12 @@ shared library: add_library(ClimbingStats SHARED climbingstats.cpp) generate_export_header(ClimbingStats) + set_property(TARGET ClimbingStats PROPERTY VERSION ${Upstream_VERSION}) + set_property(TARGET ClimbingStats PROPERTY SOVERSION 3) + set_property(TARGET ClimbingStats PROPERTY INTERFACE_ClimbingStats_MAJOR_VERSION 3) + set_property(TARGET ClimbingStats APPEND PROPERTY + COMPATIBLE_INTERFACE_STRING ClimbingStats_MAJOR_VERSION + ) install(TARGETS ClimbingStats EXPORT ClimbingStatsTargets LIBRARY DESTINATION lib @@ -342,6 +352,22 @@ targets, suitable for use by downsteams and arranges to install it to and a ``cmake/ClimbingStatsConfig.cmake`` are installed to the same location, completing the package. +The generated :prop_tgt:`IMPORTED` targets have appropriate properties set +to define their usage requirements, such as +:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`, +:prop_tgt:`INTERFACE_COMPILE_DEFINITIONS` and other relevant built-in +``INTERFACE_`` properties. The ``INTERFACE`` variant of user-defined +properties listed in :prop_tgt:`COMPATIBLE_INTERFACE_STRING` and +other :ref:`Compatible Interface Properties` are also propagated to the +generated :prop_tgt:`IMPORTED` targets. In the above case, +``ClimbingStats_MAJOR_VERSION`` is defined as a string which must be +compatible among the dependencies of any depender. By setting this custom +defined user property in this version and in the next version of +``ClimbingStats``, :manual:`cmake(1)` will issue a diagnostic if there is an +attempt to use version 3 together with version 4. Packages can choose to +employ such a pattern if different major versions of the package are designed +to be incompatible. + A ``NAMESPACE`` with double-colons is specified when exporting the targets for installation. This convention of double-colons gives CMake a hint that the name is an :prop_tgt:`IMPORTED` target when it is used by downstreams diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst index 97cd650..fb529ad 100644 --- a/Help/manual/cmake-toolchains.7.rst +++ b/Help/manual/cmake-toolchains.7.rst @@ -20,7 +20,11 @@ with information about compiler and utility paths. Languages ========= -Languages are enabled by the :command:`project` command. If no project command +Languages are enabled by the :command:`project` command. Language-specific +built-in variables, such as +:variable:`CMAKE_CXX_COMPILER <CMAKE_<LANG>_COMPILER>`, +:variable:`CMAKE_CXX_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` etc are set by +invoking the :command:`project` command. If no project command is in the top-level CMakeLists file, one will be implicitly generated. By default the enabled languages are C and CXX: diff --git a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst index 2bc1881..3e6c4d1 100644 --- a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst +++ b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst @@ -9,6 +9,6 @@ files. As this ``_automoc`` target is created at generate-time, it is not possible to define dependencies of it, such as to create inputs for the ``moc`` executable. -The ``AUTOGEN_TARGET_DEPENDS`` target can be set instead to a list of dependencies -for the ``_automoc`` target. The buildsystem will be generated to depend on its -contents. +The ``AUTOGEN_TARGET_DEPENDS`` target property can be set instead to a list of +dependencies for the ``_automoc`` target. The buildsystem will be generated to +depend on its contents. diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index d051063..c59aafd 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -1151,8 +1151,8 @@ void cmFindPackageCommand::AddPrefixesSystemEnvironment() std::string const& d = *i; // If the path is a PREFIX/bin case then add its parent instead. - if((d.size() >= 4 && strcmp(d.c_str()+d.size()-4, "/bin") == 0) || - (d.size() >= 5 && strcmp(d.c_str()+d.size()-5, "/sbin") == 0)) + if((cmHasLiteralSuffix(d, "/bin")) || + (cmHasLiteralSuffix(d, "/sbin"))) { this->AddPathInternal(cmSystemTools::GetFilenamePath(d), EnvPath); } diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx index c2c4e20..e7e1d34 100644 --- a/Source/cmGeneratorExpressionDAGChecker.cxx +++ b/Source/cmGeneratorExpressionDAGChecker.cxx @@ -31,7 +31,7 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker( top = p; p = p->Parent; } - this->CheckResult = this->checkGraph(); + this->CheckResult = this->CheckGraph(); #define TEST_TRANSITIVE_PROPERTY_METHOD(METHOD) \ top->METHOD () || @@ -61,13 +61,13 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker( //---------------------------------------------------------------------------- cmGeneratorExpressionDAGChecker::Result -cmGeneratorExpressionDAGChecker::check() const +cmGeneratorExpressionDAGChecker::Check() const { return this->CheckResult; } //---------------------------------------------------------------------------- -void cmGeneratorExpressionDAGChecker::reportError( +void cmGeneratorExpressionDAGChecker::ReportError( cmGeneratorExpressionContext *context, const std::string &expr) { @@ -125,7 +125,7 @@ void cmGeneratorExpressionDAGChecker::reportError( //---------------------------------------------------------------------------- cmGeneratorExpressionDAGChecker::Result -cmGeneratorExpressionDAGChecker::checkGraph() const +cmGeneratorExpressionDAGChecker::CheckGraph() const { const cmGeneratorExpressionDAGChecker *parent = this->Parent; while (parent) @@ -179,44 +179,37 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries(const char *tgt) || strcmp(prop, "INTERFACE_LINK_LIBRARIES") == 0; } -//---------------------------------------------------------------------------- -bool cmGeneratorExpressionDAGChecker::EvaluatingIncludeDirectories() const -{ - const char *prop = this->Property.c_str(); - return (strcmp(prop, "INCLUDE_DIRECTORIES") == 0 - || strcmp(prop, "INTERFACE_INCLUDE_DIRECTORIES") == 0 ); -} +enum TransitiveProperty { +#define DEFINE_ENUM_ENTRY(NAME) NAME, + CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(DEFINE_ENUM_ENTRY) +#undef DEFINE_ENUM_ENTRY + TransitivePropertyTerminal +}; -//---------------------------------------------------------------------------- -bool -cmGeneratorExpressionDAGChecker::EvaluatingSystemIncludeDirectories() const +template<TransitiveProperty> +bool additionalTest(const char* const) { - const char *prop = this->Property.c_str(); - return (strcmp(prop, "SYSTEM_INCLUDE_DIRECTORIES") == 0 - || strcmp(prop, "INTERFACE_SYSTEM_INCLUDE_DIRECTORIES") == 0); + return false; } -//---------------------------------------------------------------------------- -bool cmGeneratorExpressionDAGChecker::EvaluatingCompileDefinitions() const +template<> +bool additionalTest<COMPILE_DEFINITIONS>(const char* const prop) { - const char *prop = this->Property.c_str(); - return (strcmp(prop, "COMPILE_DEFINITIONS") == 0 - || strcmp(prop, "INTERFACE_COMPILE_DEFINITIONS") == 0 - || cmHasLiteralPrefix(prop, "COMPILE_DEFINITIONS_")); + return cmHasLiteralPrefix(prop, "COMPILE_DEFINITIONS_"); } -//---------------------------------------------------------------------------- -bool cmGeneratorExpressionDAGChecker::EvaluatingCompileOptions() const -{ - const char *prop = this->Property.c_str(); - return (strcmp(prop, "COMPILE_OPTIONS") == 0 - || strcmp(prop, "INTERFACE_COMPILE_OPTIONS") == 0 ); +#define DEFINE_TRANSITIVE_PROPERTY_METHOD(METHOD, PROPERTY) \ +bool cmGeneratorExpressionDAGChecker::METHOD() const \ +{ \ + const char* const prop = this->Property.c_str(); \ + if (strcmp(prop, #PROPERTY) == 0 \ + || strcmp(prop, "INTERFACE_" #PROPERTY) == 0) \ + { \ + return true; \ + } \ + return additionalTest<PROPERTY>(prop); \ } -//---------------------------------------------------------------------------- -bool cmGeneratorExpressionDAGChecker::EvaluatingAutoUicOptions() const -{ - const char *prop = this->Property.c_str(); - return (strcmp(prop, "AUTOUIC_OPTIONS") == 0 - || strcmp(prop, "INTERFACE_AUTOUIC_OPTIONS") == 0 ); -} +CM_FOR_EACH_TRANSITIVE_PROPERTY(DEFINE_TRANSITIVE_PROPERTY_METHOD) + +#undef DEFINE_TRANSITIVE_PROPERTY_METHOD diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h index 98ffd36..b6effa1 100644 --- a/Source/cmGeneratorExpressionDAGChecker.h +++ b/Source/cmGeneratorExpressionDAGChecker.h @@ -16,19 +16,25 @@ #include "cmGeneratorExpressionEvaluator.h" +#define CM_SELECT_BOTH(F, A1, A2) F(A1, A2) +#define CM_SELECT_FIRST(F, A1, A2) F(A1) +#define CM_SELECT_SECOND(F, A1, A2) F(A2) + +#define CM_FOR_EACH_TRANSITIVE_PROPERTY_IMPL(F, SELECT) \ + SELECT(F, EvaluatingIncludeDirectories, INCLUDE_DIRECTORIES) \ + SELECT(F, EvaluatingSystemIncludeDirectories, SYSTEM_INCLUDE_DIRECTORIES) \ + SELECT(F, EvaluatingCompileDefinitions, COMPILE_DEFINITIONS) \ + SELECT(F, EvaluatingCompileOptions, COMPILE_OPTIONS) \ + SELECT(F, EvaluatingAutoUicOptions, AUTOUIC_OPTIONS) + +#define CM_FOR_EACH_TRANSITIVE_PROPERTY(F) \ + CM_FOR_EACH_TRANSITIVE_PROPERTY_IMPL(F, CM_SELECT_BOTH) + #define CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(F) \ - F(EvaluatingIncludeDirectories) \ - F(EvaluatingSystemIncludeDirectories) \ - F(EvaluatingCompileDefinitions) \ - F(EvaluatingCompileOptions) \ - F(EvaluatingAutoUicOptions) + CM_FOR_EACH_TRANSITIVE_PROPERTY_IMPL(F, CM_SELECT_FIRST) #define CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(F) \ - F(INCLUDE_DIRECTORIES) \ - F(SYSTEM_INCLUDE_DIRECTORIES) \ - F(COMPILE_DEFINITIONS) \ - F(COMPILE_OPTIONS) \ - F(AUTOUIC_OPTIONS) + CM_FOR_EACH_TRANSITIVE_PROPERTY_IMPL(F, CM_SELECT_SECOND) //---------------------------------------------------------------------------- struct cmGeneratorExpressionDAGChecker @@ -46,9 +52,9 @@ struct cmGeneratorExpressionDAGChecker ALREADY_SEEN }; - Result check() const; + Result Check() const; - void reportError(cmGeneratorExpressionContext *context, + void ReportError(cmGeneratorExpressionContext *context, const std::string &expr); bool EvaluatingLinkLibraries(const char *tgt = 0); @@ -65,7 +71,7 @@ struct cmGeneratorExpressionDAGChecker { this->TransitivePropertiesOnly = true; } private: - Result checkGraph() const; + Result CheckGraph() const; private: const cmGeneratorExpressionDAGChecker * const Parent; diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index f0e40ea..5edea86 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -215,18 +215,18 @@ static const struct EqualNode : public cmGeneratorExpressionNode bool flipSign = false; const char *lhs = parameters[0].c_str(); - if (cmHasLiteralPrefix(lhs, "0b")) + if (cmHasLiteralPrefix(lhs, "0b") || cmHasLiteralPrefix(lhs, "0B")) { base = 2; lhs += 2; } - if (cmHasLiteralPrefix(lhs, "-0b")) + if (cmHasLiteralPrefix(lhs, "-0b") || cmHasLiteralPrefix(lhs, "-0B")) { base = 2; lhs += 3; flipSign = true; } - if (cmHasLiteralPrefix(lhs, "+0b")) + if (cmHasLiteralPrefix(lhs, "+0b") || cmHasLiteralPrefix(lhs, "+0B")) { base = 2; lhs += 3; @@ -249,18 +249,18 @@ static const struct EqualNode : public cmGeneratorExpressionNode flipSign = false; const char *rhs = parameters[1].c_str(); - if (cmHasLiteralPrefix(rhs, "0b")) + if (cmHasLiteralPrefix(rhs, "0b") || cmHasLiteralPrefix(rhs, "0B")) { base = 2; rhs += 2; } - if (cmHasLiteralPrefix(rhs, "-0b")) + if (cmHasLiteralPrefix(rhs, "-0b") || cmHasLiteralPrefix(rhs, "-0B")) { base = 2; rhs += 3; flipSign = true; } - if (cmHasLiteralPrefix(rhs, "+0b")) + if (cmHasLiteralPrefix(rhs, "+0b") || cmHasLiteralPrefix(rhs, "+0B")) { base = 2; rhs += 3; @@ -676,13 +676,17 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode { ConfigurationTestNode() {} - virtual int NumExpectedParameters() const { return 1; } + virtual int NumExpectedParameters() const { return OneOrZeroParameters; } std::string Evaluate(const std::vector<std::string> ¶meters, cmGeneratorExpressionContext *context, const GeneratorExpressionContent *content, cmGeneratorExpressionDAGChecker *) const { + if (parameters.empty()) + { + return configurationNode.Evaluate(parameters, context, content, 0); + } cmsys::RegularExpression configValidator; configValidator.compile("^[A-Za-z0-9_]*$"); if (!configValidator.find(parameters.begin()->c_str())) @@ -957,10 +961,10 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode content, dagCheckerParent); - switch (dagChecker.check()) + switch (dagChecker.Check()) { case cmGeneratorExpressionDAGChecker::SELF_REFERENCE: - dagChecker.reportError(context, content->GetOriginalExpression()); + dagChecker.ReportError(context, content->GetOriginalExpression()); return std::string(); case cmGeneratorExpressionDAGChecker::CYCLIC_REFERENCE: // No error. We just skip cyclic references. @@ -1801,7 +1805,7 @@ std::string GeneratorExpressionContent::EvaluateParameters( + "> expression requires at least one parameter."); } if (numExpected == cmGeneratorExpressionNode::OneOrZeroParameters - && parameters.size() > 2) + && parameters.size() > 1) { reportError(context, this->GetOriginalExpression(), "$<" + identifier + "> expression requires one or zero parameters."); diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index eb6e52f..ebfa8f9 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -391,6 +391,22 @@ inline bool cmHasLiteralPrefixImpl(const char* str1, return strncmp(str1, str2, N) == 0; } +inline bool cmHasLiteralSuffixImpl(const std::string &str1, + const char *str2, + size_t N) +{ + size_t len = str1.size(); + return len >= N && strcmp(str1.c_str() + len - N, str2) == 0; +} + +inline bool cmHasLiteralSuffixImpl(const char* str1, + const char* str2, + size_t N) +{ + size_t len = strlen(str1); + return len >= N && strcmp(str1 + len - N, str2) == 0; +} + #if defined(_MSC_VER) && _MSC_VER < 1300 \ || defined(__GNUC__) && __GNUC__ < 3 \ || defined(__BORLANDC__) @@ -402,6 +418,9 @@ inline bool cmHasLiteralPrefixImpl(const char* str1, #define cmHasLiteralPrefix(STR1, STR2) \ cmHasLiteralPrefixImpl(STR1, "" STR2 "", sizeof(STR2) - 1) +#define cmHasLiteralSuffix(STR1, STR2) \ + cmHasLiteralSuffixImpl(STR1, "" STR2 "", sizeof(STR2) - 1) + #else template<typename T, size_t N> @@ -417,6 +436,12 @@ bool cmHasLiteralPrefix(T str1, const char (&str2)[N]) return cmHasLiteralPrefixImpl(str1, str2, N - 1); } +template<typename T, size_t N> +bool cmHasLiteralSuffix(T str1, const char (&str2)[N]) +{ + return cmHasLiteralSuffixImpl(str1, str2, N - 1); +} + #endif struct cmStrCmp { diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index e8e2007..41c7509 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -360,18 +360,11 @@ bool cmSystemTools::IsOn(const char* val) bool cmSystemTools::IsNOTFOUND(const char* val) { - size_t len = strlen(val); - const char* notfound = "-NOTFOUND"; - const size_t lenNotFound = 9; - if(len < lenNotFound-1) + if(strcmp(val, "NOTFOUND") == 0) { - return false; - } - if(len == lenNotFound-1) - { - return ( strcmp(val, "NOTFOUND") == 0); + return true; } - return ((strncmp((val + (len - lenNotFound)), notfound, lenNotFound) == 0)); + return cmHasLiteralSuffix(val, "-NOTFOUND"); } diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index 4fb7ecd..3b85dc3 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -13,6 +13,7 @@ add_custom_target(check-part1 ALL -Dtest_1=$<1:content> -Dtest_1_with_comma=$<1:-Wl,--no-undefined> -Dconfig=$<CONFIGURATION> + -Dshort_config=$<CONFIG> -Dtest_and_0=$<AND:0> -Dtest_and_0_0=$<AND:0,0> -Dtest_and_0_1=$<AND:0,1> @@ -199,7 +200,7 @@ add_custom_target(check-part3 ALL -Dequal1=$<EQUAL:1,2> -Dequal2=$<EQUAL:1,1> -Dequal3=$<EQUAL:0x1,1> - -Dequal4=$<EQUAL:0x1,2> + -Dequal4=$<EQUAL:0X1,2> -Dequal5=$<EQUAL:0xA,0xa> -Dequal6=$<EQUAL:0xA,10> -Dequal7=$<EQUAL:0xA,012> @@ -208,15 +209,17 @@ add_custom_target(check-part3 ALL -Dequal10=$<EQUAL:10,0b1010> -Dequal11=$<EQUAL:-10,-0xa> -Dequal12=$<EQUAL:10,+0xa> - -Dequal13=$<EQUAL:+10,+0xa> + -Dequal13=$<EQUAL:+10,+0Xa> -Dequal14=$<EQUAL:+10,0xa> - -Dequal15=$<EQUAL:-10,-0xa> + -Dequal15=$<EQUAL:-10,-0Xa> -Dequal16=$<EQUAL:-10,-0b1010> -Dequal17=$<EQUAL:-10,+0b1010> - -Dequal18=$<EQUAL:10,+0b1010> - -Dequal19=$<EQUAL:10,+012> - -Dequal20=$<EQUAL:10,-012> - -Dequal21=$<EQUAL:-10,-012> + -Dequal18=$<EQUAL:10,+0B1010> + -Dequal19=$<EQUAL:10,-0B1010> + -Dequal20=$<EQUAL:10,0B1010> + -Dequal21=$<EQUAL:10,+012> + -Dequal22=$<EQUAL:10,-012> + -Dequal23=$<EQUAL:-10,-012> -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 3)" VERBATIM diff --git a/Tests/GeneratorExpression/check-part1.cmake b/Tests/GeneratorExpression/check-part1.cmake index 9bef159..3207582 100644 --- a/Tests/GeneratorExpression/check-part1.cmake +++ b/Tests/GeneratorExpression/check-part1.cmake @@ -2,6 +2,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/check-common.cmake) message(STATUS "config=[${config}]") +check(config "${short_config}") check(test_0 "") check(test_0_with_comma "") check(test_1 "content") diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake index 2c6bf49..70ccfe1 100644 --- a/Tests/GeneratorExpression/check-part3.cmake +++ b/Tests/GeneratorExpression/check-part3.cmake @@ -55,6 +55,8 @@ check(equal15 "1") check(equal16 "1") check(equal17 "0") check(equal18 "1") -check(equal19 "1") -check(equal20 "0") +check(equal19 "0") +check(equal20 "1") check(equal21 "1") +check(equal22 "0") +check(equal23 "1") diff --git a/Tests/LinkDirectory/CMakeLists.txt b/Tests/LinkDirectory/CMakeLists.txt index b8d5a04..c60de84 100644 --- a/Tests/LinkDirectory/CMakeLists.txt +++ b/Tests/LinkDirectory/CMakeLists.txt @@ -11,13 +11,11 @@ endif() add_library(mylibA STATIC mylibA.c) set_property(TARGET mylibA PROPERTY ARCHIVE_OUTPUT_DIRECTORY "${LinkDirectory_BINARY_DIR}/External/lib") -# get_property(mylibA TARGET mylibA PROPERTY LOCATION) # Build a library into our build tree relative to the subproject build tree. add_library(mylibB STATIC mylibB.c) set_property(TARGET mylibB PROPERTY ARCHIVE_OUTPUT_DIRECTORY "${LinkDirectory_BINARY_DIR}/lib") -# get_property(mylibB TARGET mylibB PROPERTY LOCATION) # Create a custom target to drive the subproject build. include(ExternalProject) diff --git a/Tests/RunCMake/CompatibleInterface/AutoUic.cmake b/Tests/RunCMake/CompatibleInterface/AutoUic.cmake index 86bd5a0..03635e2 100644 --- a/Tests/RunCMake/CompatibleInterface/AutoUic.cmake +++ b/Tests/RunCMake/CompatibleInterface/AutoUic.cmake @@ -1,9 +1,6 @@ find_package(Qt4 REQUIRED) -set(QT_CORE_TARGET Qt4::QtCore) -set(QT_GUI_TARGET Qt4::QtGui) - set(CMAKE_AUTOUIC ON) set(CMAKE_DEBUG_TARGET_PROPERTIES AUTOUIC_OPTIONS) @@ -19,4 +16,4 @@ set_property(TARGET OtherI18n APPEND PROPERTY ) add_library(LibWidget empty.cpp) -target_link_libraries(LibWidget KI18n OtherI18n ${QT_GUI_TARGET}) +target_link_libraries(LibWidget KI18n OtherI18n Qt4::QtGui) diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt index e3efe28..17b8a5c 100644 --- a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt +++ b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt @@ -67,6 +67,12 @@ CMake Debug Log: \* Target "CompatibleInterface" has property content "prop3" + CMake Debug Log: + String compatibility of property "STRING_PROP4" for target + "CompatibleInterface" \(result: "\(unset\)"\): + + \* Target "CompatibleInterface" property not set. ++ +CMake Debug Log: Numeric minimum compatibility of property "NUMBER_MIN_PROP1" for target "CompatibleInterface" \(result: "50"\): diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake index 42a3af2..0196611 100644 --- a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake +++ b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake @@ -22,6 +22,7 @@ set_property(TARGET iface1 APPEND PROPERTY STRING_PROP1 STRING_PROP2 STRING_PROP3 + STRING_PROP4 # Not set. ) set_property(TARGET iface1 APPEND PROPERTY COMPATIBLE_INTERFACE_NUMBER_MIN @@ -36,7 +37,7 @@ set_property(TARGET iface1 APPEND PROPERTY set(CMAKE_DEBUG_TARGET_PROPERTIES BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4 BOOL_PROP5 BOOL_PROP6 BOOL_PROP7 - STRING_PROP1 STRING_PROP2 STRING_PROP3 + STRING_PROP1 STRING_PROP2 STRING_PROP3 STRING_PROP4 NUMBER_MIN_PROP1 NUMBER_MIN_PROP2 NUMBER_MAX_PROP1 NUMBER_MAX_PROP2 ) diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt index 1cfbf40..964ea4d 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt @@ -1,15 +1,6 @@ CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): Error evaluating generator expression: - \$<CONFIG> - - \$<CONFIG> expression requires exactly one parameter. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): - Error evaluating generator expression: - \$<CONFIG:.> Expression syntax not recognized. @@ -21,7 +12,7 @@ CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): \$<CONFIG:Foo,Bar> - \$<CONFIG> expression requires exactly one parameter. + \$<CONFIG> expression requires one or zero parameters. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake index c27ea5f..5c22aaa 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake @@ -1,5 +1,4 @@ add_custom_target(check ALL COMMAND check - $<CONFIG> $<CONFIG:.> $<CONFIG:Foo,Bar> $<CONFIG:Foo-Bar> |