Commit 1d23ea1a authored by Brad King's avatar Brad King
Browse files

BUG: Generated try-compile CMakeLists.txt file should call cmake_policy with...

BUG: Generated try-compile CMakeLists.txt file should call cmake_policy with the current version of CMake, not just 2.6.
parent 680104a4
......@@ -175,7 +175,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
const char* lang =(this->Makefile->GetCMakeInstance()->GetGlobalGenerator()
->GetLanguageFromExtension(ext.c_str()));
const char* def = this->Makefile->GetDefinition("CMAKE_MODULE_PATH");
fprintf(fout, "cmake_policy(VERSION 2.6)\n");
fprintf(fout, "cmake_policy(VERSION %u.%u)\n",
cmVersion::GetMajorVersion(), cmVersion::GetMinorVersion());
if(def)
{
fprintf(fout, "SET(CMAKE_MODULE_PATH %s)\n", def);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment