summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorDavid Genest <david.genest@ubisoft.com>2010-06-29 12:28:47 (GMT)
committerBrad King <brad.king@kitware.com>2010-06-29 12:29:41 (GMT)
commit295b5b60df5d9427fdb891fd51333c12089ee129 (patch)
treedbb784eb3090cc59a0bc48b9d06b3a25db83d3fa /Source/cmCoreTryCompile.cxx
parenta55aee5cddc00c33536c957ec4c7732a6083047c (diff)
downloadCMake-295b5b60df5d9427fdb891fd51333c12089ee129.zip
CMake-295b5b60df5d9427fdb891fd51333c12089ee129.tar.gz
CMake-295b5b60df5d9427fdb891fd51333c12089ee129.tar.bz2
Honor CMAKE_USER_MAKE_RULES_OVERRIDE in try_compile (#10902)
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-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..fcec3e9 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 : "");
+ 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);