[Cmake-commits] CMake branch, next, updated. v2.8.3-1400-g376f4dc
Brad King
brad.king at kitware.com
Mon Jan 17 17:27:27 EST 2011
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 376f4dcdbb1b7a697f1b1b0b9f3b4e28502bf3ac (commit)
via 052c2ae1aa9759e141a4331877f7e39ba5688ca5 (commit)
via 56efc60fa0b9ef067d4b5648e43136b250872088 (commit)
from 535706df769cf75b92397bdaa3ba9f3e5ac6220a (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=376f4dcdbb1b7a697f1b1b0b9f3b4e28502bf3ac
commit 376f4dcdbb1b7a697f1b1b0b9f3b4e28502bf3ac
Merge: 535706d 052c2ae
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 17 17:27:23 2011 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jan 17 17:27:23 2011 -0500
Merge topic 'try_compile-Makefile-config' into next
052c2ae Document CMAKE_TRY_COMPILE_CONFIGURATION variable
56efc60 Honor CMAKE_TRY_COMPILE_CONFIGURATION in Makefile generators (#10809)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=052c2ae1aa9759e141a4331877f7e39ba5688ca5
commit 052c2ae1aa9759e141a4331877f7e39ba5688ca5
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 17 17:23:15 2011 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Jan 17 17:23:15 2011 -0500
Document CMAKE_TRY_COMPILE_CONFIGURATION variable
Also reference it from try_compile and try_run since it affects those
commands.
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 5dfa64e..e9b54d8 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1121,6 +1121,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"this variable for a target if they are set. "
"Library targets are otherwise placed in this directory.",false,
"Variables that Control the Build");
+ cm->DefineProperty
+ ("CMAKE_TRY_COMPILE_CONFIGURATION", cmProperty::VARIABLE,
+ "Build configuration used for try_compile and try_run projects.",
+ "Projects built by try_compile and try_run are built "
+ "synchronously during the CMake configuration step. "
+ "Therefore a specific build configuration must be chosen even "
+ "if the generated build system supports multiple configurations.",false,
+ "Variables that Control the Build");
// Variables defined when the a language is enabled These variables will
diff --git a/Source/cmTryCompileCommand.h b/Source/cmTryCompileCommand.h
index 3a30e4c..d8ce529 100644
--- a/Source/cmTryCompileCommand.h
+++ b/Source/cmTryCompileCommand.h
@@ -94,7 +94,9 @@ public:
"Return the success or failure in "
"RESULT_VAR. CMAKE_FLAGS can be used to pass -DVAR:TYPE=VALUE flags "
"to the cmake that is run during the build. "
- "";
+ "Set variable CMAKE_TRY_COMPILE_CONFIGURATION to choose a build "
+ "configuration."
+ ;
}
cmTypeMacro(cmTryCompileCommand, cmCoreTryCompile);
diff --git a/Source/cmTryRunCommand.h b/Source/cmTryRunCommand.h
index ca48e90..f86d863 100644
--- a/Source/cmTryRunCommand.h
+++ b/Source/cmTryRunCommand.h
@@ -93,7 +93,10 @@ public:
"that when crosscompiling, the cache variables will have to be set "
"manually to the output of the executable. You can also \"guard\" the "
"calls to try_run with if(CMAKE_CROSSCOMPILING) and provide an "
- "easy-to-preset alternative for this case.\n";
+ "easy-to-preset alternative for this case.\n"
+ "Set variable CMAKE_TRY_COMPILE_CONFIGURATION to choose a build "
+ "configuration."
+ ;
}
cmTypeMacro(cmTryRunCommand, cmCoreTryCompile);
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=56efc60fa0b9ef067d4b5648e43136b250872088
commit 56efc60fa0b9ef067d4b5648e43136b250872088
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 17 17:21:30 2011 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Jan 17 17:21:30 2011 -0500
Honor CMAKE_TRY_COMPILE_CONFIGURATION in Makefile generators (#10809)
Previously this was used only in multi-configuration generators to
choose the configuration of try_compile and try_run at their build time.
Teach CMake to honor the variable in single-configuration generators as
the CMAKE_BUILD_TYPE.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 53f4c3c..43a7ae0 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2717,6 +2717,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)
{
-----------------------------------------------------------------------
Summary of changes:
Source/cmDocumentVariables.cxx | 8 ++++++++
Source/cmMakefile.cxx | 12 ++++++++++++
Source/cmTryCompileCommand.h | 4 +++-
Source/cmTryRunCommand.h | 5 ++++-
4 files changed, 27 insertions(+), 2 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list