Skip to content

Commit

Permalink
[cmake] Use GNUInstallDirs to obtain installation directories
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentzell committed Jan 30, 2024
1 parent e3b947a commit f6a2e98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ target_compile_options(${PROJECT_NAME}_warnings
$<$<CXX_COMPILER_ID:IntelLLVM>:-Wno-tautological-constant-compare>
)

# Provide GNU Installation directories
include(GNUInstallDirs)

# #############
# Build Project

Expand Down
6 changes: 3 additions & 3 deletions c++/app4triqs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set_target_properties(${PROJECT_NAME}_c PROPERTIES
VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
)
target_include_directories(${PROJECT_NAME}_c PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/c++>)
target_include_directories(${PROJECT_NAME}_c SYSTEM INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>)
target_include_directories(${PROJECT_NAME}_c SYSTEM INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_FULL_INCLUDEDIR}>)
target_compile_definitions(${PROJECT_NAME}_c PUBLIC
APP4TRIQS_GIT_HASH=${PROJECT_GIT_HASH}
TRIQS_GIT_HASH=${TRIQS_GIT_HASH}
Expand All @@ -21,8 +21,8 @@ target_compile_definitions(${PROJECT_NAME}_c PUBLIC
)

# Install library and headers
install(TARGETS ${PROJECT_NAME}_c EXPORT ${PROJECT_NAME}-targets DESTINATION lib)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h")
install(TARGETS ${PROJECT_NAME}_c EXPORT ${PROJECT_NAME}-targets DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h")


# ========= Static Analyzer Checks ==========
Expand Down

0 comments on commit f6a2e98

Please sign in to comment.