From 1d23ea1a2de47e16929557e169b7fb041236f5d3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 7 Mar 2008 08:53:22 -0500 Subject: [PATCH] BUG: Generated try-compile CMakeLists.txt file should call cmake_policy with the current version of CMake, not just 2.6. --- Source/cmCoreTryCompile.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 7a9a6cd7a..a24c1eeb7 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -175,7 +175,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector 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);