Test variables CMAKE_(C|CXX|Fortran)_COMPILER(|_ID|_VERSION)
Add tests CMakeOnly.CompilerId(C|CXX|Fortran) to check that the basic compiler tool path, vendor, and version variables have been set as expected.
This commit is contained in:
parent
ec22a9b521
commit
8be51f6694
|
@ -19,6 +19,12 @@ add_CMakeOnly_test(CheckCXXCompilerFlag)
|
|||
|
||||
add_CMakeOnly_test(CheckLanguage)
|
||||
|
||||
add_CMakeOnly_test(CompilerIdC)
|
||||
add_CMakeOnly_test(CompilerIdCXX)
|
||||
if(CMAKE_Fortran_COMPILER)
|
||||
add_CMakeOnly_test(CompilerIdFortran)
|
||||
endif()
|
||||
|
||||
add_CMakeOnly_test(AllFindModules)
|
||||
|
||||
add_CMakeOnly_test(TargetScope)
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
cmake_minimum_required(VERSION 2.8.9)
|
||||
project(CompilerIdC C)
|
||||
|
||||
foreach(v
|
||||
CMAKE_C_COMPILER
|
||||
CMAKE_C_COMPILER_ID
|
||||
CMAKE_C_COMPILER_VERSION
|
||||
)
|
||||
if(${v})
|
||||
message(STATUS "${v}=[${${v}}]")
|
||||
else()
|
||||
message(SEND_ERROR "${v} not set!")
|
||||
endif()
|
||||
endforeach()
|
|
@ -0,0 +1,14 @@
|
|||
cmake_minimum_required(VERSION 2.8.9)
|
||||
project(CompilerIdCXX CXX)
|
||||
|
||||
foreach(v
|
||||
CMAKE_CXX_COMPILER
|
||||
CMAKE_CXX_COMPILER_ID
|
||||
CMAKE_CXX_COMPILER_VERSION
|
||||
)
|
||||
if(${v})
|
||||
message(STATUS "${v}=[${${v}}]")
|
||||
else()
|
||||
message(SEND_ERROR "${v} not set!")
|
||||
endif()
|
||||
endforeach()
|
|
@ -0,0 +1,22 @@
|
|||
cmake_minimum_required(VERSION 2.8.9)
|
||||
project(CompilerIdFortran Fortran)
|
||||
|
||||
foreach(v
|
||||
CMAKE_Fortran_COMPILER
|
||||
CMAKE_Fortran_COMPILER_ID
|
||||
)
|
||||
if(${v})
|
||||
message(STATUS "${v}=[${${v}}]")
|
||||
else()
|
||||
message(SEND_ERROR "${v} not set!")
|
||||
endif()
|
||||
endforeach()
|
||||
foreach(v
|
||||
CMAKE_Fortran_COMPILER_VERSION
|
||||
)
|
||||
if(${v})
|
||||
message(STATUS "${v}=[${${v}}]")
|
||||
else()
|
||||
message(WARNING "${v} not set!")
|
||||
endif()
|
||||
endforeach()
|
Loading…
Reference in New Issue