summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-07-06 14:18:45 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2010-07-06 14:18:45 (GMT)
commita5d67513a2c636f720f4e4bc99fd8380b7372069 (patch)
tree65cc2d41545740f1748211a982c16d6acb9ba122
parentf74baa4fcfa51959bd884951006d55d3e97fbb1b (diff)
parentc8ea2705a7115208f59839828a82b42a58293576 (diff)
downloadCMake-a5d67513a2c636f720f4e4bc99fd8380b7372069.zip
CMake-a5d67513a2c636f720f4e4bc99fd8380b7372069.tar.gz
CMake-a5d67513a2c636f720f4e4bc99fd8380b7372069.tar.bz2
Merge branch 'user-override-try-compile'
-rw-r--r--Source/cmCoreTryCompile.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index dab0c0d..b8a0c95 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -175,6 +175,23 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
{
fprintf(fout, "SET(CMAKE_MODULE_PATH %s)\n", def);
}
+
+ const char* rulesOverrideBase = "CMAKE_USER_MAKE_RULES_OVERRIDE";
+ std::string rulesOverrideLang =
+ rulesOverrideBase + (lang ? std::string("_") + lang : std::string(""));
+ if(const char* rulesOverridePath =
+ this->Makefile->GetDefinition(rulesOverrideLang.c_str()))
+ {
+ fprintf(fout, "SET(%s \"%s\")\n",
+ rulesOverrideLang.c_str(), rulesOverridePath);
+ }
+ else if(const char* rulesOverridePath2 =
+ this->Makefile->GetDefinition(rulesOverrideBase))
+ {
+ fprintf(fout, "SET(%s \"%s\")\n",
+ rulesOverrideBase, rulesOverridePath2);
+ }
+
if(lang)
{
fprintf(fout, "PROJECT(CMAKE_TRY_COMPILE %s)\n", lang);