2016-09-27 22:01:08 +03:00
|
|
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
2009-09-28 19:46:51 +04:00
|
|
|
|
2014-05-13 13:02:19 +04:00
|
|
|
cmake_minimum_required(VERSION ${CMAKE_VERSION})
|
2009-08-24 16:49:35 +04:00
|
|
|
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})
|
|
|
|
|
2011-09-08 22:56:48 +04:00
|
|
|
add_library(VerifyFortran STATIC VerifyFortran.f)
|
|
|
|
add_executable(VerifyFortranC main.c VerifyC.c ${VerifyCXX})
|
|
|
|
target_link_libraries(VerifyFortranC VerifyFortran)
|
2009-09-01 21:03:12 +04:00
|
|
|
|
|
|
|
if(NOT VERIFY_CXX)
|
|
|
|
# The entry point (main) is defined in C; link with the C compiler.
|
|
|
|
set_property(TARGET VerifyFortranC PROPERTY LINKER_LANGUAGE C)
|
|
|
|
endif()
|