Skip to content

Commit 2b57126

Browse files
committed
Use standard GNU installation paths
1 parent 4be1aaa commit 2b57126

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

CMakeLists.txt

+2-12
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,8 @@ option(BUILD_SHARED_LIBS "Whether the library should be a shared one" FALSE)
66

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

9-
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH
10-
"Installation directory for executables")
11-
12-
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH
13-
"Installation directory for libraries")
14-
15-
set(INSTALL_MOD_DIR "${CMAKE_INSTALL_PREFIX}/include/dftd3" CACHE PATH
16-
"Installation directory for Fortran module files")
17-
18-
set(INSTALL_CMAKE_DIR "${CMAKE_INSTALL_PREFIX}/lib/cmake" CACHE PATH
19-
"Installation directory for CMake package export files")
20-
9+
set(INSTALL_MODDIR "dftd3/modfiles" CACHE PATH
10+
"Installation directory for Fortran module files (within standard include folder)")
2111

2212
add_subdirectory(lib)
2313
if(NOT LIBRARY_ONLY)

lib/CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ set_target_properties(dftd3 PROPERTIES Fortran_MODULE_DIRECTORY ${includedir})
1313

1414
target_include_directories(dftd3 PUBLIC
1515
$<BUILD_INTERFACE:${includedir}>
16-
$<INSTALL_INTERFACE:${INSTALL_MOD_DIR}>)
16+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${INSTALL_MODDIR}>)
1717

1818
install(TARGETS dftd3
1919
EXPORT ${INSTALL_EXPORT_NAME}
20-
ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
21-
LIBRARY DESTINATION ${INSTALL_LIB_DIR})
20+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
21+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
2222

2323
if(INSTALL_INCLUDE_FILES)
24-
install(DIRECTORY ${includedir}/ DESTINATION ${INSTALL_MOD_DIR})
24+
install(DIRECTORY ${includedir}/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${INSTALL_MODDIR})
2525
endif()
2626

prg/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ target_link_libraries(dftd3_standalone dftd3)
99
set_target_properties(dftd3_standalone PROPERTIES OUTPUT_NAME "dftd3")
1010

1111
install(TARGETS dftd3_standalone
12-
RUNTIME DESTINATION ${INSTALL_BIN_DIR})
12+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

0 commit comments

Comments
 (0)