Merge topic 'vs-configurations'

42bb42d VS: Always initialize CMAKE_CONFIGURATION_TYPES in IDE generators
This commit is contained in:
Brad King 2013-05-16 14:38:40 -04:00 committed by CMake Topic Stage
commit f122dd3d47
3 changed files with 10 additions and 5 deletions

View File

@ -52,9 +52,6 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
endif() endif()
if(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio") if(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
set (CMAKE_NO_BUILD_TYPE 1) set (CMAKE_NO_BUILD_TYPE 1)
set (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING
"Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.")
mark_as_advanced(CMAKE_CONFIGURATION_TYPES)
endif() endif()
# make sure to enable languages after setting configuration types # make sure to enable languages after setting configuration types

View File

@ -38,8 +38,6 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
endif() endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") if(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
set (CMAKE_NO_BUILD_TYPE 1) set (CMAKE_NO_BUILD_TYPE 1)
set (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING
"Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.")
endif() endif()
# does the compiler support pdbtype and is it the newer compiler # does the compiler support pdbtype and is it the newer compiler

View File

@ -31,6 +31,16 @@ void cmGlobalVisualStudio7Generator
mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1"); mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
mf->AddDefinition("CMAKE_GENERATOR_FC", "ifort"); mf->AddDefinition("CMAKE_GENERATOR_FC", "ifort");
this->AddPlatformDefinitions(mf); this->AddPlatformDefinitions(mf);
if(!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
{
mf->AddCacheDefinition(
"CMAKE_CONFIGURATION_TYPES",
"Debug;Release;MinSizeRel;RelWithDebInfo",
"Semicolon separated list of supported configuration types, "
"only supports Debug, Release, MinSizeRel, and RelWithDebInfo, "
"anything else will be ignored.",
cmCacheManager::STRING);
}
// Create list of configurations requested by user's cache, if any. // Create list of configurations requested by user's cache, if any.
this->cmGlobalGenerator::EnableLanguage(lang, mf, optional); this->cmGlobalGenerator::EnableLanguage(lang, mf, optional);