summaryrefslogtreecommitdiffstats
path: root/Tests/UseSWIG/BasicFortran/CMakeLists.txt
blob: e81fb85ce7ebf59015ebeac46ae9c7abdb6259e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
cmake_minimum_required(VERSION 3.12...3.13)

project(TestBasicFortran CXX Fortran)

include(CTest)

set(language "fortran")

include (../BasicConfiguration.cmake)
get_target_property(EXAMPLE_PREFIX example PREFIX)
if (NOT EXAMPLE_PREFIX STREQUAL "${CMAKE_SHARED_LIBRARY_PREFIX}"
    AND NOT EXAMPLE_PREFIX STREQUAL "EXAMPLE_PREFIX-NOTFOUND")
  message(FATAL_ERROR "Unexpected library prefix on target: got "
    "'${EXAMPLE_PREFIX}' but expected '${CMAKE_SHARED_LIBRARY_PREFIX}'")
endif()


add_executable(runme ${CMAKE_CURRENT_SOURCE_DIR}/../runme.f90)
target_link_libraries(runme example)
set_target_properties(runme PROPERTIES LINKER_LANGUAGE Fortran)

add_test (NAME BasicFortran
  COMMAND $<TARGET_FILE:runme>)