mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-21 21:58:50 -05:00
a9be85da2e
This function builds a simple test project using a combination of Fortran and C (and optionally C++) to verify that the compilers are compatible. The idea is to help projects report very early to users that the compilers specified cannot mix languages.
17 lines
460 B
CMake
17 lines
460 B
CMake
cmake_minimum_required(VERSION 2.7)
|
|
project(VerifyFortranC C Fortran)
|
|
|
|
option(VERIFY_CXX "Whether to verify C++ and Fortran" OFF)
|
|
if(VERIFY_CXX)
|
|
enable_language(CXX)
|
|
set(VerifyCXX VerifyCXX.cxx)
|
|
add_definitions(-DVERIFY_CXX)
|
|
endif()
|
|
|
|
include(FortranCInterface)
|
|
|
|
FortranCInterface_HEADER(VerifyFortran.h SYMBOLS VerifyFortran)
|
|
include_directories(${VerifyFortranC_BINARY_DIR})
|
|
|
|
add_executable(VerifyFortranC main.c VerifyC.c VerifyFortran.f ${VerifyCXX})
|