Skip to content

Commit 4be1aaa

Browse files
committed
Improve interaction when called as a CMake-subproject
1 parent 37cfff0 commit 4be1aaa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.5)
22

33
project(libdftd3 VERSION 0.9.2 LANGUAGES Fortran)
44

5-
set(LIBRARY_ONLY FALSE CACHE BOOL "Whether only library should be compiled")
6-
75
option(BUILD_SHARED_LIBS "Whether the library should be a shared one" FALSE)
86

97
option(INSTALL_INCLUDE_FILES "Whether include / module files should be installed" TRUE)

lib/CMakeLists.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ set(includedir ${CMAKE_CURRENT_BINARY_DIR}/include)
1111

1212
set_target_properties(dftd3 PROPERTIES Fortran_MODULE_DIRECTORY ${includedir})
1313

14-
target_include_directories(dftd3 PUBLIC ${includedir})
14+
target_include_directories(dftd3 PUBLIC
15+
$<BUILD_INTERFACE:${includedir}>
16+
$<INSTALL_INTERFACE:${INSTALL_MOD_DIR}>)
1517

1618
install(TARGETS dftd3
17-
EXPORT dftd3-targets
19+
EXPORT ${INSTALL_EXPORT_NAME}
1820
ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
1921
LIBRARY DESTINATION ${INSTALL_LIB_DIR})
2022

0 commit comments

Comments
 (0)