summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-01-19 19:28:32 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-01-19 19:28:32 (GMT)
commit3a1975c529ee254277b86cc3f16920ac61c5f54e (patch)
tree8029293cf80cab0675bd6281f42be5cba6f97adb /Source/cmMakefile.cxx
parent863c7dfd881148da8a8ef6b24a5fee23ae8b3b8b (diff)
parent052c2ae1aa9759e141a4331877f7e39ba5688ca5 (diff)
downloadCMake-3a1975c529ee254277b86cc3f16920ac61c5f54e.zip
CMake-3a1975c529ee254277b86cc3f16920ac61c5f54e.tar.gz
CMake-3a1975c529ee254277b86cc3f16920ac61c5f54e.tar.bz2
Merge topic 'try_compile-Makefile-config'
052c2ae Document CMAKE_TRY_COMPILE_CONFIGURATION variable 56efc60 Honor CMAKE_TRY_COMPILE_CONFIGURATION in Makefile generators (#10809)
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 41d36dc..e1cea22 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2718,6 +2718,18 @@ int cmMakefile::TryCompile(const char *srcdir, const char *bindir,
cm.SetStartOutputDirectory(bindir);
cm.SetCMakeCommand(cmakeCommand.c_str());
cm.LoadCache();
+ if(!gg->IsMultiConfig())
+ {
+ if(const char* config =
+ this->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION"))
+ {
+ // Tell the single-configuration generator which one to use.
+ // Add this before the user-provided CMake arguments in case
+ // one of the arguments is -DCMAKE_BUILD_TYPE=...
+ cm.AddCacheEntry("CMAKE_BUILD_TYPE", config,
+ "Build configuration", cmCacheManager::STRING);
+ }
+ }
// if cmake args were provided then pass them in
if (cmakeArgs)
{