Skip to content

Commit 0c50e78

Browse files
authored
Fix subproject build (#284)
- export stdlib targets for dependent projects
1 parent f84f059 commit 0c50e78

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CMakeLists.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14.0)
22
project(stdlib Fortran)
33
enable_testing()
44

5-
include(${CMAKE_SOURCE_DIR}/cmake/stdlib.cmake)
5+
include(${PROJECT_SOURCE_DIR}/cmake/stdlib.cmake)
66

77
# --- compiler options
88
if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
@@ -52,3 +52,8 @@ if(NOT FYPP)
5252
endif()
5353

5454
add_subdirectory(src)
55+
56+
install(EXPORT fortran_stdlib-targets
57+
NAMESPACE fortran_stdlib::
58+
DESTINATION "lib/cmake/fortran_stdlib"
59+
)

src/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ endif()
6363
add_subdirectory(tests)
6464

6565
install(TARGETS fortran_stdlib
66+
EXPORT fortran_stdlib-targets
6667
RUNTIME DESTINATION bin
6768
ARCHIVE DESTINATION lib
6869
LIBRARY DESTINATION lib
69-
)
70+
)
7071
install(DIRECTORY ${LIB_MOD_DIR} DESTINATION include)

0 commit comments

Comments
 (0)