VS: Fix MSVC_IDE definition recently broken by refactoring
In commit 485a940e
(VS: Simplify MSVC version reporting, 2012-08-23) we
accidentally flipped the 0/1 values of MSVC_IDE. Flip them back and
teach the CheckCompilerRelatedVariables test to check the variable.
This commit is contained in:
parent
32b7c72623
commit
16fa7b7395
|
@ -56,9 +56,9 @@ enable_language(RC)
|
||||||
set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
|
set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
|
||||||
|
|
||||||
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
|
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
|
||||||
set(MSVC_IDE 0)
|
|
||||||
else()
|
|
||||||
set(MSVC_IDE 1)
|
set(MSVC_IDE 1)
|
||||||
|
else()
|
||||||
|
set(MSVC_IDE 0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT MSVC_VERSION)
|
if(NOT MSVC_VERSION)
|
||||||
|
|
|
@ -46,6 +46,7 @@ echo_var(MSVC80)
|
||||||
echo_var(MSVC90)
|
echo_var(MSVC90)
|
||||||
echo_var(MSVC10)
|
echo_var(MSVC10)
|
||||||
echo_var(MSVC11)
|
echo_var(MSVC11)
|
||||||
|
echo_var(MSVC_IDE)
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
#
|
#
|
||||||
|
@ -60,6 +61,13 @@ if(MSVC)
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "error: ${msvc_total} MSVC** variables are defined -- exactly 1 expected")
|
message(FATAL_ERROR "error: ${msvc_total} MSVC** variables are defined -- exactly 1 expected")
|
||||||
endif()
|
endif()
|
||||||
|
if(NOT DEFINED MSVC_IDE)
|
||||||
|
message(FATAL_ERROR "MSVC_IDE not defined but should be!")
|
||||||
|
elseif("${CMAKE_GENERATOR}" MATCHES "Visual Studio" AND NOT MSVC_IDE)
|
||||||
|
message(FATAL_ERROR "MSVC_IDE is not true but should be (${CMAKE_GENERATOR})!")
|
||||||
|
elseif(NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio" AND MSVC_IDE)
|
||||||
|
message(FATAL_ERROR "MSVC_IDE is true but should not be (${CMAKE_GENERATOR})!")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
#
|
#
|
||||||
# The compiler is something other than cl... None of the MSVC** variables
|
# The compiler is something other than cl... None of the MSVC** variables
|
||||||
|
@ -70,6 +78,9 @@ else()
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "error: ${msvc_total} MSVC** variables are defined -- exactly 0 expected")
|
message(FATAL_ERROR "error: ${msvc_total} MSVC** variables are defined -- exactly 0 expected")
|
||||||
endif()
|
endif()
|
||||||
|
if(DEFINED MSVC_IDE)
|
||||||
|
message(FATAL_ERROR "MSVC_IDE is defined but should not be!")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue