From 2afb820352845513d46af1464cb1161e335eb435 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 14 Dec 2010 09:36:06 -0500 Subject: [PATCH] Write full version into try_compile CMakeLists Pass the full version to cmake_minimum_required(VERSION) in generated CMake files for try_compile projects. This tells CMake not to use any backward compatibility behavior while processing code it generates. --- Source/cmCoreTryCompile.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index b8a0c95b1..a1c707d0f 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -169,8 +169,9 @@ 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_minimum_required(VERSION %u.%u)\n", - cmVersion::GetMajorVersion(), cmVersion::GetMinorVersion()); + fprintf(fout, "cmake_minimum_required(VERSION %u.%u.%u.%u)\n", + cmVersion::GetMajorVersion(), cmVersion::GetMinorVersion(), + cmVersion::GetPatchVersion(), cmVersion::GetTweakVersion()); if(def) { fprintf(fout, "SET(CMAKE_MODULE_PATH %s)\n", def);