diff --git a/CMakeLists.txt b/CMakeLists.txt index d62689913..cbed6ba9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14.0) project(stdlib Fortran) enable_testing() -include(${CMAKE_SOURCE_DIR}/cmake/stdlib.cmake) +include(${PROJECT_SOURCE_DIR}/cmake/stdlib.cmake) # --- compiler options if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU) @@ -52,3 +52,8 @@ if(NOT FYPP) endif() add_subdirectory(src) + +install(EXPORT fortran_stdlib-targets + NAMESPACE fortran_stdlib:: + DESTINATION "lib/cmake/fortran_stdlib" +) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e2caa0bbc..bfdcaf7c8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -63,8 +63,9 @@ endif() add_subdirectory(tests) install(TARGETS fortran_stdlib + EXPORT fortran_stdlib-targets RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - ) +) install(DIRECTORY ${LIB_MOD_DIR} DESTINATION include)