993d0d65f7782b89a6920f32a49f5b655e3c6c75
[platform/upstream/cmake.git] / Tests / VSGNUFortran / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.9)
2 project(VSGNUFortran)
3
4 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
5 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
6 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
7
8 # force the executable to be put out of Debug/Release dir
9 # because gmake build of fortran will not be in a config
10 # directory, and for easier testing we want the exe and .dll
11 # to be in the same directory.
12 get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
13 if(_isMultiConfig)
14   foreach(config ${CMAKE_CONFIGURATION_TYPES})
15     string(TOUPPER "${config}" config)
16     set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${config}
17       ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
18   endforeach()
19 endif()
20
21 add_subdirectory(subdir)
22 include_directories(${VSGNUFortran_BINARY_DIR}/subdir/fortran)
23 add_subdirectory(c_code)
24 # use a cmake script to run the executable so that PATH
25 # can be set with the MinGW/bin in it, and the fortran
26 # runtime libraries can be found.
27 configure_file(runtest.cmake.in runtest.cmake @ONLY)