cmake/Tests/VSGNUFortran/CMakeLists.txt

28 lines
1.0 KiB
CMake
Raw Normal View History

2018-04-23 21:13:27 +02:00
cmake_minimum_required(VERSION 3.9)
2012-04-19 19:04:21 +03:00
project(VSGNUFortran)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
# force the executable to be put out of Debug/Release dir
# because gmake build of fortran will not be in a config
# directory, and for easier testing we want the exe and .dll
# to be in the same directory.
2018-04-23 21:13:27 +02:00
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(_isMultiConfig)
2022-11-16 20:14:03 +01:00
foreach(config IN LISTS CMAKE_CONFIGURATION_TYPES)
2012-04-19 19:04:21 +03:00
string(TOUPPER "${config}" config)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${config}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endforeach()
endif()
add_subdirectory(subdir)
include_directories(${VSGNUFortran_BINARY_DIR}/subdir/fortran)
add_subdirectory(c_code)
# use a cmake script to run the executable so that PATH
# can be set with the MinGW/bin in it, and the fortran
# runtime libraries can be found.
configure_file(runtest.cmake.in runtest.cmake @ONLY)