diff options
author | Brad King <brad.king@kitware.com> | 2013-08-01 12:54:15 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-08-01 12:54:15 (GMT) |
commit | b341bf2178e3923636735ae1df53a33e5857df7d (patch) | |
tree | bc38c23e6590d2e5bfd4065e0fd18a08ba90b856 /Source | |
parent | 1a88bbf3f06f0858cf6957d80623d43dcd323a22 (diff) | |
parent | 80e652f5cc279715ff57e1c64c6e5c460b201db4 (diff) | |
download | CMake-b341bf2178e3923636735ae1df53a33e5857df7d.zip CMake-b341bf2178e3923636735ae1df53a33e5857df7d.tar.gz CMake-b341bf2178e3923636735ae1df53a33e5857df7d.tar.bz2 |
Merge topic 'INCLUDES-DESTINATION-no-config'
80e652f Export: Process generator expressions from INCLUDES DESTINATION.
4355815 cmTarget: Add NAME property
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 28 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 25 |
2 files changed, 49 insertions, 4 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 5b351bc..ef336ea 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -287,11 +287,33 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( const char *propName = "INTERFACE_INCLUDE_DIRECTORIES"; const char *input = target->GetProperty(propName); - if (!input && tei->InterfaceIncludeDirectories.empty()) + + cmListFileBacktrace lfbt; + cmGeneratorExpression ge(lfbt); + + std::string dirs = tei->InterfaceIncludeDirectories; + this->ReplaceInstallPrefix(dirs); + cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(dirs); + std::string exportDirs = cge->Evaluate(target->GetMakefile(), 0, + false, target); + + if (cge->GetHadContextSensitiveCondition()) + { + cmMakefile* mf = target->GetMakefile(); + cmOStringStream e; + e << "Target \"" << target->GetName() << "\" is installed with " + "INCLUDES DESTINATION set to a context sensitive path. Paths which " + "depend on the configuration, policy values or the link interface are " + "not supported. Consider using target_include_directories instead."; + mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + return; + } + + if (!input && exportDirs.empty()) { return; } - if ((input && !*input) && tei->InterfaceIncludeDirectories.empty()) + if ((input && !*input) && exportDirs.empty()) { // Set to empty properties[propName] = ""; @@ -300,7 +322,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( std::string includes = (input?input:""); const char* sep = input ? ";" : ""; - includes += sep + tei->InterfaceIncludeDirectories; + includes += sep + exportDirs; std::string prepro = cmGeneratorExpression::Preprocess(includes, preprocessRule, true); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 560f07c..667c685 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -945,6 +945,11 @@ void cmTarget::DefineProperties(cmake *cm) "OSX_ARCHITECTURES."); cm->DefineProperty + ("NAME", cmProperty::TARGET, + "Logical name for the target.", + "Read-only logical name for the target as used by CMake."); + + cm->DefineProperty ("EXPORT_NAME", cmProperty::TARGET, "Exported name for target files.", "This sets the name for the IMPORTED target generated when it this " @@ -2971,7 +2976,13 @@ void cmTarget::SetProperty(const char* prop, const char* value) { return; } - + if (strcmp(prop, "NAME") == 0) + { + cmOStringStream e; + e << "NAME property is read-only\n"; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); + return; + } if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0) { cmListFileBacktrace lfbt; @@ -3038,6 +3049,13 @@ void cmTarget::AppendProperty(const char* prop, const char* value, { return; } + if (strcmp(prop, "NAME") == 0) + { + cmOStringStream e; + e << "NAME property is read-only\n"; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); + return; + } if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0) { cmListFileBacktrace lfbt; @@ -4053,6 +4071,11 @@ const char *cmTarget::GetProperty(const char* prop, return 0; } + if (strcmp(prop, "NAME") == 0) + { + return this->GetName(); + } + // Watch for special "computed" properties that are dependent on // other properties or variables. Always recompute them. if(this->GetType() == cmTarget::EXECUTABLE || |