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.
This commit is contained in:
parent
b90e9f9c3a
commit
2afb820352
@ -169,8 +169,9 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
|
|||||||
const char* lang =(this->Makefile->GetCMakeInstance()->GetGlobalGenerator()
|
const char* lang =(this->Makefile->GetCMakeInstance()->GetGlobalGenerator()
|
||||||
->GetLanguageFromExtension(ext.c_str()));
|
->GetLanguageFromExtension(ext.c_str()));
|
||||||
const char* def = this->Makefile->GetDefinition("CMAKE_MODULE_PATH");
|
const char* def = this->Makefile->GetDefinition("CMAKE_MODULE_PATH");
|
||||||
fprintf(fout, "cmake_minimum_required(VERSION %u.%u)\n",
|
fprintf(fout, "cmake_minimum_required(VERSION %u.%u.%u.%u)\n",
|
||||||
cmVersion::GetMajorVersion(), cmVersion::GetMinorVersion());
|
cmVersion::GetMajorVersion(), cmVersion::GetMinorVersion(),
|
||||||
|
cmVersion::GetPatchVersion(), cmVersion::GetTweakVersion());
|
||||||
if(def)
|
if(def)
|
||||||
{
|
{
|
||||||
fprintf(fout, "SET(CMAKE_MODULE_PATH %s)\n", def);
|
fprintf(fout, "SET(CMAKE_MODULE_PATH %s)\n", def);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user