This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via b6947b77d5109c192cb2c64b061fb0cb771882f8 (commit) via 2da342e70df8b1121f3a9364641f8e81c6382c63 (commit) via 65d1cab7b26734759f6e29deb69dbebc2f3f6fef (commit) via 114e0533907f06914372bee96f54cb586fb3476c (commit) via e0e9642fa3595c8b35bc194031933d2706e7ed6e (commit) via 52c9f98d7c4e092e6294e3996454155879da81e0 (commit) via 5d590aa7eb3a3b481148a02770dc83c7926f0b0b (commit) from 2c8c851fd53d0955000364060f9c41cf0b5f3937 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b6947b77d5109c192cb2c64b061fb0cb771882f8 commit b6947b77d5109c192cb2c64b061fb0cb771882f8 Merge: 2c8c851 2da342e Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Thu Feb 7 04:02:35 2013 -0500 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Thu Feb 7 04:02:35 2013 -0500 Merge topic 'minor-fixes' into next 2da342e Fix generation of COMPILE_DEFINITIONS in DependInfo.cmake. 65d1cab Ensure type specific compatible interface properties do not intersect. 114e053 The COMPATIBLE_INTERFACE does not affect the target it is set on. e0e9642 Test printing origin of include dirs from tll(). 52c9f98 De-duplicate validation of genex target names. 5d590aa Deduplicate the isGeneratorExpression method. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2da342e70df8b1121f3a9364641f8e81c6382c63 commit 2da342e70df8b1121f3a9364641f8e81c6382c63 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Thu Feb 7 01:49:17 2013 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Thu Feb 7 10:01:38 2013 +0100 Fix generation of COMPILE_DEFINITIONS in DependInfo.cmake. As INTERFACE_COMPILE_DEFINITIONS are now possible, we can have situations like this: add_library(foo ...) add_library(bar ...) target_link_libraries(foo bar) target_compile_definitions(bar INTERFACE SOME_DEF) The INTERFACE_COMPILE_DEFINITIONS of bar determine how foo should be compiled, and if they change, foo should be rebuilt. Additionally, as of commit d1446ca7 (Append the COMPILE_DEFINITIONS from the Makefile to all targets., 2012-09-17), we don't need to read definitions from the makefile if we read them from the target, so also de-duplicate the cached info. The DependInfo for INTERFACE_INCLUDE_DIRECTORIES is already handled correctly. diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index d629e71..f6ab0d0 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1961,34 +1961,17 @@ void cmLocalUnixMakefileGenerator3 } // Build a list of preprocessor definitions for the target. - std::vector<std::string> defines; - { - std::string defPropName = "COMPILE_DEFINITIONS_"; - defPropName += cmSystemTools::UpperCase(this->ConfigurationName); - if(const char* ddefs = this->Makefile->GetProperty("COMPILE_DEFINITIONS")) - { - cmSystemTools::ExpandListArgument(ddefs, defines); - } - if(const char* cdefs = target.GetProperty("COMPILE_DEFINITIONS")) - { - cmSystemTools::ExpandListArgument(cdefs, defines); - } - if(const char* dcdefs = this->Makefile->GetProperty(defPropName.c_str())) - { - cmSystemTools::ExpandListArgument(dcdefs, defines); - } - if(const char* ccdefs = target.GetProperty(defPropName.c_str())) - { - cmSystemTools::ExpandListArgument(ccdefs, defines); - } - } + std::set<std::string> defines; + this->AppendDefines(defines, target.GetCompileDefinitions()); + this->AppendDefines(defines, target.GetCompileDefinitions( + this->ConfigurationName.c_str())); if(!defines.empty()) { cmakefileStream << "\n" << "# Preprocessor definitions for this target.\n" << "SET(CMAKE_TARGET_DEFINITIONS\n"; - for(std::vector<std::string>::const_iterator di = defines.begin(); + for(std::set<std::string>::const_iterator di = defines.begin(); di != defines.end(); ++di) { cmakefileStream http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=65d1cab7b26734759f6e29deb69dbebc2f3f6fef commit 65d1cab7b26734759f6e29deb69dbebc2f3f6fef Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Thu Feb 7 00:47:31 2013 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Thu Feb 7 10:01:38 2013 +0100 Ensure type specific compatible interface properties do not intersect. Before, the boolean version would always win, and the string one would be ignored. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 4109929..b92bf77 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -906,7 +906,10 @@ void cmTarget::DefineProperties(cmake *cm) "consistent with each other, and with the \"FOO\" property in the " "dependee. Consistency in this sense has the meaning that if the " "property is set, then it must have the same boolean value as all " - "others, and if the property is not set, then it is ignored."); + "others, and if the property is not set, then it is ignored. Note that " + "for each dependee, the set of properties from this property must not " + "intersect with the set of properties from the " + "COMPATIBLE_INTERFACE_STRING property."); cm->DefineProperty ("COMPATIBLE_INTERFACE_STRING", cmProperty::TARGET, @@ -917,7 +920,10 @@ void cmTarget::DefineProperties(cmake *cm) "if a property \"FOO\" appears in the list, then for each dependee, the " "\"INTERFACE_FOO\" property content in all of its dependencies must be " "equal with each other, and with the \"FOO\" property in the dependee. " - "If the property is not set, then it is ignored."); + "If the property is not set, then it is ignored. Note that for each " + "dependee, the set of properties from this property must not intersect " + "with the set of properties from the COMPATIBLE_INTERFACE_BOOL " + "property."); cm->DefineProperty ("POST_INSTALL_SCRIPT", cmProperty::TARGET, @@ -5616,7 +5622,8 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info, { const cmComputeLinkInformation::ItemVector &deps = info->GetItems(); - std::set<cmStdString> emitted; + std::set<cmStdString> emittedBools; + std::set<cmStdString> emittedStrings; for(cmComputeLinkInformation::ItemVector::const_iterator li = deps.begin(); @@ -5629,19 +5636,36 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info, checkPropertyConsistency<bool>(this, li->Target, "COMPATIBLE_INTERFACE_BOOL", - emitted, config, 0); + emittedBools, config, 0); if (cmSystemTools::GetErrorOccuredFlag()) { return; } checkPropertyConsistency<const char *>(this, li->Target, "COMPATIBLE_INTERFACE_STRING", - emitted, config, 0); + emittedStrings, config, 0); if (cmSystemTools::GetErrorOccuredFlag()) { return; } } + + for(std::set<cmStdString>::const_iterator li = emittedBools.begin(); + li != emittedBools.end(); ++li) + { + const std::set<cmStdString>::const_iterator si = emittedStrings.find(*li); + if (si != emittedStrings.end()) + { + cmOStringStream e; + e << "Property \"" << *li << "\" appears in both the " + "COMPATIBLE_INTERFACE_BOOL and the COMPATIBLE_INTERFACE_STRING " + "property in the dependencies of target \"" << this->GetName() << + "\". This is not allowed. A property may only require compatibility " + "in a boolean interpretation or a string interpretation, but not both."; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); + break; + } + } } //---------------------------------------------------------------------------- diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-result.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt new file mode 100644 index 0000000..5a8f99d --- /dev/null +++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt @@ -0,0 +1,5 @@ +CMake Error in CMakeLists.txt: + Property "SOMETHING" appears in both the COMPATIBLE_INTERFACE_BOOL and the + COMPATIBLE_INTERFACE_STRING property in the dependencies of target "user". + This is not allowed. A property may only require compatibility in a + boolean interpretation or a string interpretation, but not both. diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake new file mode 100644 index 0000000..711368a --- /dev/null +++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake @@ -0,0 +1,9 @@ + +add_library(foo UNKNOWN IMPORTED) +add_library(bar UNKNOWN IMPORTED) + +set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SOMETHING) +set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING SOMETHING) + +add_executable(user main.cpp) +target_link_libraries(user foo bar) diff --git a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake index 922ad7f..9768151 100644 --- a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake @@ -8,3 +8,4 @@ run_cmake(InterfaceString-mismatch-depends) run_cmake(InterfaceString-mismatch-depend-self) run_cmake(InterfaceString-mismatched-use) run_cmake(InterfaceString-builtin-prop) +run_cmake(InterfaceString-Bool-Conflict) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=114e0533907f06914372bee96f54cb586fb3476c commit 114e0533907f06914372bee96f54cb586fb3476c Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Thu Feb 7 00:43:54 2013 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Thu Feb 7 10:01:38 2013 +0100 The COMPATIBLE_INTERFACE does not affect the target it is set on. Test and document this. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 2eaf1c1..4109929 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -900,24 +900,24 @@ void cmTarget::DefineProperties(cmake *cm) "Properties which must be compatible with their link interface", "The COMPATIBLE_INTERFACE_BOOL property may contain a list of properties" "for this target which must be consistent when evaluated as a boolean " - "in the INTERFACE of all linked dependencies. For example, if a " - "property \"FOO\" appears in the list, then the \"INTERFACE_FOO\" " - "property content in all dependencies must be consistent with each " - "other, and with the \"FOO\" property in this target. " - "Consistency in this sense has the meaning that if the property is set," - "then it must have the same boolean value as all others, and if the " - "property is not set, then it is ignored."); + "in the INTERFACE of all linked dependees. For example, if a " + "property \"FOO\" appears in the list, then for each dependee, the " + "\"INTERFACE_FOO\" property content in all of its dependencies must be " + "consistent with each other, and with the \"FOO\" property in the " + "dependee. Consistency in this sense has the meaning that if the " + "property is set, then it must have the same boolean value as all " + "others, and if the property is not set, then it is ignored."); cm->DefineProperty ("COMPATIBLE_INTERFACE_STRING", cmProperty::TARGET, "Properties which must be string-compatible with their link interface", "The COMPATIBLE_INTERFACE_STRING property may contain a list of " "properties for this target which must be the same when evaluated as " - "a string in the INTERFACE of all linked dependencies. For example, " - "if a property \"FOO\" appears in the list, then the \"INTERFACE_FOO\" " - "property content in all dependencies must be equal with each " - "other, and with the \"FOO\" property in this target. If the " - "property is not set, then it is ignored."); + "a string in the INTERFACE of all linked dependees. For example, " + "if a property \"FOO\" appears in the list, then for each dependee, the " + "\"INTERFACE_FOO\" property content in all of its dependencies must be " + "equal with each other, and with the \"FOO\" property in the dependee. " + "If the property is not set, then it is ignored."); cm->DefineProperty ("POST_INSTALL_SCRIPT", cmProperty::TARGET, diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt index 329510b..cd0a37d 100644 --- a/Tests/CompatibleInterface/CMakeLists.txt +++ b/Tests/CompatibleInterface/CMakeLists.txt @@ -67,3 +67,18 @@ target_compile_definitions(CompatibleInterface PRIVATE $<$<BOOL:$<TARGET_PROPERTY:Iface2_PROP>>:SOME_DEFINE> ) + +# The COMPATIBLE_INTERFACE_* properties are only read from dependencies +# in the interface. Populating it on the CompatibleInterface target does +# not have any affect on the interpretation of the INTERFACE variants +# in dependencies. +set_property(TARGET iface1 PROPERTY + INTERFACE_NON_RELEVANT_PROP ON +) +set_property(TARGET iface2 PROPERTY + INTERFACE_NON_RELEVANT_PROP ON +) +set_property(TARGET CompatibleInterface APPEND PROPERTY + COMPATIBLE_INTERFACE_BOOL + NON_RELEVANT_PROP +) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e0e9642fa3595c8b35bc194031933d2706e7ed6e commit e0e9642fa3595c8b35bc194031933d2706e7ed6e Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Feb 5 10:24:39 2013 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Thu Feb 7 10:01:38 2013 +0100 Test printing origin of include dirs from tll(). diff --git a/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt b/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt index 736fe69..c17e0ae 100644 --- a/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt +++ b/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt @@ -23,13 +23,21 @@ CMake Debug Log at DebugIncludes.cmake:18 \(include_directories\): Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + -CMake Debug Log at DebugIncludes.cmake:25 \(set_property\): +CMake Debug Log at DebugIncludes.cmake:26 \(target_link_libraries\): Used includes for target lll: \* .*/Tests/RunCMake/include_directories/five + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Debug Log at DebugIncludes.cmake:29 \(set_property\): + Used includes for target lll: + \* .*/Tests/RunCMake/include_directories/six + \* .*/Tests/RunCMake/include_directories/seven Call Stack \(most recent call first\): - DebugIncludes.cmake:35 \(some_macro\) - DebugIncludes.cmake:38 \(some_function\) + DebugIncludes.cmake:40 \(some_macro\) + DebugIncludes.cmake:43 \(some_function\) CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/include_directories/DebugIncludes.cmake b/Tests/RunCMake/include_directories/DebugIncludes.cmake index 51daf74..794a852 100644 --- a/Tests/RunCMake/include_directories/DebugIncludes.cmake +++ b/Tests/RunCMake/include_directories/DebugIncludes.cmake @@ -21,6 +21,10 @@ include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/four" ) +add_library(foo "${CMAKE_CURRENT_BINARY_DIR}/DebugIncludes.cpp") +target_include_directories(foo INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/five") +target_link_libraries(lll foo) + macro(some_macro) set_property(TARGET lll APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/one" @@ -28,6 +32,7 @@ macro(some_macro) "${CMAKE_CURRENT_SOURCE_DIR}/four" "${CMAKE_CURRENT_SOURCE_DIR}/five" "${CMAKE_CURRENT_SOURCE_DIR}/six" + "${CMAKE_CURRENT_SOURCE_DIR}/seven" ) endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52c9f98d7c4e092e6294e3996454155879da81e0 commit 52c9f98d7c4e092e6294e3996454155879da81e0 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Wed Feb 6 13:32:15 2013 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Thu Feb 7 10:01:38 2013 +0100 De-duplicate validation of genex target names. diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index c9f784b..60bf179 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -371,10 +371,20 @@ std::string::size_type cmGeneratorExpression::Find(const std::string &input) { const std::string::size_type openpos = input.find("$<"); if (openpos != std::string::npos - && input.find(">", openpos) != std::string::npos) - { - return openpos; - } + && input.find(">", openpos) != std::string::npos) + { + return openpos; } return std::string::npos; } + +//---------------------------------------------------------------------------- +bool cmGeneratorExpression::IsValidTargetName(const std::string &input) +{ + cmsys::RegularExpression targetNameValidator; + // The ':' is supported to allow use with IMPORTED targets. At least + // Qt 4 and 5 IMPORTED targets use ':' as the namespace delimiter. + targetNameValidator.compile("^[A-Za-z0-9_.:-]+$"); + + return targetNameValidator.find(input.c_str()); +} diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index d487919..4eab2dd 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -64,6 +64,8 @@ public: static std::string::size_type Find(const std::string &input); + static bool IsValidTargetName(const std::string &input); + private: cmGeneratorExpression(const cmGeneratorExpression &); void operator=(const cmGeneratorExpression &); diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 5d94718..4779b11 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -333,10 +333,6 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode "$<TARGET_PROPERTY:...> expression requires one or two parameters"); return std::string(); } - cmsys::RegularExpression targetNameValidator; - // The ':' is supported to allow use with IMPORTED targets. At least - // Qt 4 and 5 IMPORTED targets use ':' as the namespace delimiter. - targetNameValidator.compile("^[A-Za-z0-9_.:-]+$"); cmsys::RegularExpression propertyNameValidator; propertyNameValidator.compile("^[A-Za-z0-9_]+$"); @@ -372,7 +368,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode std::string targetName = parameters.front(); propertyName = parameters[1]; - if (!targetNameValidator.find(targetName.c_str())) + if (!cmGeneratorExpression::IsValidTargetName(targetName)) { if (!propertyNameValidator.find(propertyName.c_str())) { @@ -867,10 +863,7 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode // Lookup the referenced target. std::string name = *parameters.begin(); - cmsys::RegularExpression targetValidator; - // The ':' is supported to allow use with IMPORTED targets. - targetValidator.compile("^[A-Za-z0-9_.:-]+$"); - if (!targetValidator.find(name.c_str())) + if (!cmGeneratorExpression::IsValidTargetName(name)) { ::reportError(context, content->GetOriginalExpression(), "Expression syntax not recognized."); diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index cb913f5..520c7a8 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -11,6 +11,8 @@ ============================================================================*/ #include "cmTargetLinkLibrariesCommand.h" +#include "cmGeneratorExpression.h" + const char* cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[3] = { "general", @@ -279,9 +281,8 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib, { const bool isGenex = isGeneratorExpression(lib); - cmsys::RegularExpression targetNameValidator; - targetNameValidator.compile("^[A-Za-z0-9_.:-]+$"); - const bool potentialTargetName = targetNameValidator.find(lib); + const bool potentialTargetName + = cmGeneratorExpression::IsValidTargetName(lib); if (potentialTargetName || isGenex) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d590aa7eb3a3b481148a02770dc83c7926f0b0b commit 5d590aa7eb3a3b481148a02770dc83c7926f0b0b Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Wed Feb 6 13:18:10 2013 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Thu Feb 7 10:01:18 2013 +0100 Deduplicate the isGeneratorExpression method. This API seems like the most appropriate. diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 7e4c3df..fbed95a 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -315,14 +315,6 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input, } //---------------------------------------------------------------------------- -static bool isGeneratorExpression(const std::string &lib) -{ - const std::string::size_type openpos = lib.find("$<"); - return (openpos != std::string::npos) - && (lib.find(">", openpos) != std::string::npos); -} - -//---------------------------------------------------------------------------- void cmExportFileGenerator::ResolveTargetsInGeneratorExpressions( std::string &input, @@ -344,7 +336,7 @@ cmExportFileGenerator::ResolveTargetsInGeneratorExpressions( for(std::vector<std::string>::iterator li = parts.begin(); li != parts.end(); ++li) { - if (!isGeneratorExpression(*li)) + if (cmGeneratorExpression::Find(*li) == std::string::npos) { this->AddTargetNamespace(*li, target, missingTargets); } diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 7add1bf..c9f784b 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -365,3 +365,16 @@ std::string cmGeneratorExpression::Preprocess(const std::string &input, assert(!"cmGeneratorExpression::Preprocess called with invalid args"); return std::string(); } + +//---------------------------------------------------------------------------- +std::string::size_type cmGeneratorExpression::Find(const std::string &input) +{ + const std::string::size_type openpos = input.find("$<"); + if (openpos != std::string::npos + && input.find(">", openpos) != std::string::npos) + { + return openpos; + } + } + return std::string::npos; +} diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 700fe03..d487919 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -62,6 +62,8 @@ public: static void Split(const std::string &input, std::vector<std::string> &output); + static std::string::size_type Find(const std::string &input); + private: cmGeneratorExpression(const cmGeneratorExpression &); void operator=(const cmGeneratorExpression &); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ca0e24b..2eaf1c1 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2270,14 +2270,6 @@ static std::string targetNameGenex(const char *lib) } //---------------------------------------------------------------------------- -static bool isGeneratorExpression(const std::string &lib) -{ - const std::string::size_type openpos = lib.find("$<"); - return (openpos != std::string::npos) - && (lib.find(">", openpos) != std::string::npos); -} - -//---------------------------------------------------------------------------- void cmTarget::AddLinkLibrary(cmMakefile& mf, const char *target, const char* lib, LinkLibraryType llt) @@ -2300,7 +2292,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, llt).c_str()); } - if (isGeneratorExpression(lib)) + if (cmGeneratorExpression::Find(lib) != std::string::npos) { return; } diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx index eaacfa9..808806a 100644 --- a/Source/cmTargetIncludeDirectoriesCommand.cxx +++ b/Source/cmTargetIncludeDirectoriesCommand.cxx @@ -41,14 +41,6 @@ void cmTargetIncludeDirectoriesCommand } //---------------------------------------------------------------------------- -static bool isGeneratorExpression(const std::string &lib) -{ - const std::string::size_type openpos = lib.find("$<"); - return (openpos != std::string::npos) - && (lib.find(">", openpos) != std::string::npos); -} - -//---------------------------------------------------------------------------- std::string cmTargetIncludeDirectoriesCommand ::Join(const std::vector<std::string> &content) { @@ -59,7 +51,7 @@ std::string cmTargetIncludeDirectoriesCommand it != content.end(); ++it) { if (cmSystemTools::FileIsFullPath(it->c_str()) - || isGeneratorExpression(*it)) + || cmGeneratorExpression::Find(*it) != std::string::npos) { dirs += sep + *it; } ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits