File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,6 @@ cmake_minimum_required(VERSION 3.14.0)
22project (stdlib Fortran)
33enable_testing ()
44
5- # this avoids stdlib and projects using stdlib from having to introspect stdlib's directory structure
6- # FIXME: this eventually needs to be handled more precisely, as this spills all .mod/.smod into one directory
7- # and thereby can clash if module/submodule names are the same in different parts of library
8- set (CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR} )
9-
105# --- compiler options
116if (CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
127 add_compile_options (-fimplicit-none)
Original file line number Diff line number Diff line change 99
1010add_library (fortran_stdlib ${SRC} )
1111
12+ set (LIB_MOD_DIR ${CMAKE_CURRENT_BINARY_DIR} /mod_files/)
13+ set_target_properties (fortran_stdlib PROPERTIES
14+ Fortran_MODULE_DIRECTORY ${LIB_MOD_DIR} )
15+ target_include_directories (fortran_stdlib PUBLIC
16+ $<BUILD_INTERFACE:${LIB_MOD_DIR} >
17+ $<INSTALL_INTERFACE:include >
18+ )
19+
1220if (f18errorstop)
1321 target_sources (fortran_stdlib PRIVATE f18estop.f90)
1422else ()
@@ -22,3 +30,4 @@ install(TARGETS fortran_stdlib
2230 ARCHIVE DESTINATION lib
2331 LIBRARY DESTINATION lib
2432 )
33+ install (DIRECTORY ${LIB_MOD_DIR} DESTINATION include )
You can’t perform that action at this time.
0 commit comments