CMakeLists.txt 1.0 KB

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