summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CTestTargets.cmake2
-rw-r--r--Modules/ExternalProject.cmake8
-rw-r--r--Source/cmGlobalGenerator.cxx2
-rw-r--r--Source/cmLocalGenerator.cxx13
-rw-r--r--Source/cmLocalGenerator.h4
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx6
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx14
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx14
-rw-r--r--Source/cmMakefileTargetGenerator.cxx7
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx12
-rw-r--r--Source/cmNinjaTargetGenerator.cxx6
-rw-r--r--Tests/RunCMake/add_custom_command/WorkingDirectory.cmake2
-rw-r--r--Tests/RunCMake/add_link_options/LINKER_expansion-list.cmake2
13 files changed, 50 insertions, 42 deletions
diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake
index b91b48e..99ef8e5 100644
--- a/Modules/CTestTargets.cmake
+++ b/Modules/CTestTargets.cmake
@@ -41,7 +41,7 @@ set(__conf_types "")
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(_isMultiConfig)
# We need to pass the configuration type on the test command line.
- set(__conf_types -C "${CMAKE_CFG_INTDIR}")
+ set(__conf_types -C "$<CONFIG>")
endif()
# Add convenience targets. Do this at most once in case of nested
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 3752ceb..18068cb 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -2091,13 +2091,7 @@ function(_ep_get_configuration_subdir_genex suffix_var)
set(suffix "")
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(_isMultiConfig)
- if(CMAKE_GENERATOR STREQUAL "Xcode")
- # The Xcode generator does not support per-config sources,
- # so use the underlying build system's placeholder instead.
- set(suffix "/${CMAKE_CFG_INTDIR}")
- else()
- set(suffix "/$<CONFIG>")
- endif()
+ set(suffix "/$<CONFIG>")
endif()
set(${suffix_var} "${suffix}" PARENT_SCOPE)
endfunction()
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 4cfec22..492f848 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2911,7 +2911,7 @@ void cmGlobalGenerator::AddGlobalTarget_Install(
singleLine.push_back(cfgArg);
cfgArg = "-DEFFECTIVE_PLATFORM_NAME=$(EFFECTIVE_PLATFORM_NAME)";
} else {
- cfgArg += *mf->GetDefinition("CMAKE_CFG_INTDIR");
+ cfgArg += this->GetCMakeCFGIntDir();
}
singleLine.push_back(cfgArg);
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 15bcd02..c2138ee 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -827,13 +827,18 @@ cmStateSnapshot cmLocalGenerator::GetStateSnapshot() const
return this->Makefile->GetStateSnapshot();
}
-cmValue cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target,
- const std::string& prop)
+std::string cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target,
+ const std::string& prop,
+ const std::string& config)
{
+ cmValue value = this->Makefile->GetProperty(prop);
if (target) {
- return target->GetProperty(prop);
+ value = target->GetProperty(prop);
+ }
+ if (value) {
+ return cmGeneratorExpression::Evaluate(*value, this, config, target);
}
- return this->Makefile->GetProperty(prop);
+ return "";
}
std::string cmLocalGenerator::ConvertToIncludeReference(
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 20f23de..bda82bc 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -532,7 +532,9 @@ public:
void CreateEvaluationFileOutputs(const std::string& config);
void ProcessEvaluationFiles(std::vector<std::string>& generatedFiles);
- cmValue GetRuleLauncher(cmGeneratorTarget* target, const std::string& prop);
+ std::string GetRuleLauncher(cmGeneratorTarget* target,
+ const std::string& prop,
+ const std::string& config);
protected:
// The default implementation converts to a Windows shortpath to
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 7172d34..56a41b1 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1003,7 +1003,9 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
std::string launcher;
// Short-circuit if there is no launcher.
- cmValue val = this->GetRuleLauncher(target, "RULE_LAUNCH_CUSTOM");
+ std::string val = this->GetRuleLauncher(
+ target, "RULE_LAUNCH_CUSTOM",
+ this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
if (cmNonempty(val)) {
// Expand rule variables referenced in the given launcher command.
cmRulePlaceholderExpander::RuleVariables vars;
@@ -1022,7 +1024,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
}
vars.Output = output.c_str();
- launcher = *val;
+ launcher = val;
rulePlaceholderExpander->ExpandRuleVariables(this, launcher, vars);
if (!launcher.empty()) {
launcher += " ";
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index e53d28c..41daa5a 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -222,10 +222,11 @@ void cmMakefileExecutableTargetGenerator::WriteNvidiaDeviceExecutableRule(
std::string launcher;
- cmValue val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget,
- "RULE_LAUNCH_LINK");
+ std::string val = this->LocalGenerator->GetRuleLauncher(
+ this->GeneratorTarget, "RULE_LAUNCH_LINK",
+ this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
if (cmNonempty(val)) {
- launcher = cmStrCat(*val, ' ');
+ launcher = cmStrCat(val, ' ');
}
std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
@@ -587,10 +588,11 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
std::string launcher;
- cmValue val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget,
- "RULE_LAUNCH_LINK");
+ std::string val = this->LocalGenerator->GetRuleLauncher(
+ this->GeneratorTarget, "RULE_LAUNCH_LINK",
+ this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
if (cmNonempty(val)) {
- launcher = cmStrCat(*val, ' ');
+ launcher = cmStrCat(val, ' ');
}
std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 9669293..cb567ff 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -362,10 +362,11 @@ void cmMakefileLibraryTargetGenerator::WriteNvidiaDeviceLibraryRules(
vars.TargetCompilePDB = targetOutPathCompilePDB.c_str();
std::string launcher;
- cmValue val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget,
- "RULE_LAUNCH_LINK");
+ std::string val = this->LocalGenerator->GetRuleLauncher(
+ this->GeneratorTarget, "RULE_LAUNCH_LINK",
+ this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
if (cmNonempty(val)) {
- launcher = cmStrCat(*val, ' ');
+ launcher = cmStrCat(val, ' ');
}
std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
@@ -808,10 +809,11 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
}
std::string launcher;
- cmValue val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget,
- "RULE_LAUNCH_LINK");
+ std::string val = this->LocalGenerator->GetRuleLauncher(
+ this->GeneratorTarget, "RULE_LAUNCH_LINK",
+ this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
if (cmNonempty(val)) {
- launcher = cmStrCat(*val, ' ');
+ launcher = cmStrCat(val, ' ');
}
std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 6612595..2b817c3 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1167,10 +1167,11 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
std::string launcher;
{
- cmValue val = this->LocalGenerator->GetRuleLauncher(
- this->GeneratorTarget, "RULE_LAUNCH_COMPILE");
+ std::string val = this->LocalGenerator->GetRuleLauncher(
+ this->GeneratorTarget, "RULE_LAUNCH_COMPILE",
+ this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
if (cmNonempty(val)) {
- launcher = cmStrCat(*val, ' ');
+ launcher = cmStrCat(val, ' ');
}
}
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index a1633ca..45a4dda 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -263,10 +263,10 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkRule(
vars.LanguageCompileFlags = "$LANGUAGE_COMPILE_FLAGS";
std::string launcher;
- cmValue val = this->GetLocalGenerator()->GetRuleLauncher(
- this->GetGeneratorTarget(), "RULE_LAUNCH_LINK");
+ std::string val = this->GetLocalGenerator()->GetRuleLauncher(
+ this->GetGeneratorTarget(), "RULE_LAUNCH_LINK", config);
if (cmNonempty(val)) {
- launcher = cmStrCat(*val, ' ');
+ launcher = cmStrCat(val, ' ');
}
std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
@@ -458,10 +458,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile,
}
std::string launcher;
- cmValue val = this->GetLocalGenerator()->GetRuleLauncher(
- this->GetGeneratorTarget(), "RULE_LAUNCH_LINK");
+ std::string val = this->GetLocalGenerator()->GetRuleLauncher(
+ this->GetGeneratorTarget(), "RULE_LAUNCH_LINK", config);
if (cmNonempty(val)) {
- launcher = cmStrCat(*val, ' ');
+ launcher = cmStrCat(val, ' ');
}
std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index b77a363..cea58b7 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -670,10 +670,10 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
cmLocalGenerator::SHELL);
std::string launcher;
- cmValue val = this->GetLocalGenerator()->GetRuleLauncher(
- this->GetGeneratorTarget(), "RULE_LAUNCH_COMPILE");
+ std::string val = this->GetLocalGenerator()->GetRuleLauncher(
+ this->GetGeneratorTarget(), "RULE_LAUNCH_COMPILE", config);
if (cmNonempty(val)) {
- launcher = cmStrCat(*val, ' ');
+ launcher = cmStrCat(val, ' ');
}
std::string const cmakeCmd =
diff --git a/Tests/RunCMake/add_custom_command/WorkingDirectory.cmake b/Tests/RunCMake/add_custom_command/WorkingDirectory.cmake
index 65b7250..d8a5d86 100644
--- a/Tests/RunCMake/add_custom_command/WorkingDirectory.cmake
+++ b/Tests/RunCMake/add_custom_command/WorkingDirectory.cmake
@@ -2,7 +2,7 @@ add_custom_target(mkdir COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURR
add_custom_command(
OUTPUT out.txt
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/PrintDir.cmake
- WORKING_DIRECTORY ${CMAKE_CFG_INTDIR}
+ WORKING_DIRECTORY $<CONFIG>
)
set_property(SOURCE out.txt PROPERTY SYMBOLIC 1)
add_custom_target(drive ALL DEPENDS out.txt)
diff --git a/Tests/RunCMake/add_link_options/LINKER_expansion-list.cmake b/Tests/RunCMake/add_link_options/LINKER_expansion-list.cmake
index c77b43c..f7c551d 100644
--- a/Tests/RunCMake/add_link_options/LINKER_expansion-list.cmake
+++ b/Tests/RunCMake/add_link_options/LINKER_expansion-list.cmake
@@ -11,7 +11,7 @@ string(REPLACE "${CMAKE_END_TEMP_FILE}" "" CMAKE_C_CREATE_SHARED_LIBRARY "${CMAK
add_library(example SHARED LinkOptionsLib.c)
# use LAUNCH facility to dump linker command
-set_property(TARGET example PROPERTY RULE_LAUNCH_LINK "\"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/dump${CMAKE_EXECUTABLE_SUFFIX}\"")
+set_property(TARGET example PROPERTY RULE_LAUNCH_LINK "\"$<TARGET_FILE:dump>\"")
add_dependencies (example dump)