File tree 2 files changed +9
-5
lines changed
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)
2
2
project (stdlib Fortran)
3
3
enable_testing ()
4
4
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
-
10
5
# --- compiler options
11
6
if (CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
12
7
add_compile_options (-fimplicit-none)
Original file line number Diff line number Diff line change 9
9
10
10
add_library (fortran_stdlib ${SRC} )
11
11
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
+
12
20
if (f18errorstop)
13
21
target_sources (fortran_stdlib PRIVATE f18estop.f90)
14
22
else ()
@@ -22,3 +30,4 @@ install(TARGETS fortran_stdlib
22
30
ARCHIVE DESTINATION lib
23
31
LIBRARY DESTINATION lib
24
32
)
33
+ install (DIRECTORY ${LIB_MOD_DIR} DESTINATION include )
You can’t perform that action at this time.
0 commit comments