-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3502ca1
commit edd76bc
Showing
2 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,51 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(recycle) | ||
|
||
project(recycle | ||
VERSION 6.0.0 | ||
DESCRIPTION "Simple resource pool for recycling resources in C++" | ||
LANGUAGES CXX) | ||
|
||
# Define library | ||
add_library(recycle INTERFACE) | ||
target_compile_features(recycle INTERFACE cxx_std_14) | ||
target_include_directories(recycle INTERFACE src/) | ||
target_include_directories(recycle INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src> $<INSTALL_INTERFACE:include>) | ||
add_library(steinwurf::recycle ALIAS recycle) | ||
|
||
include(GNUInstallDirs) | ||
set(RECYCLE_CONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/recycle" CACHE PATH "recycle config directory") | ||
|
||
# Install headers | ||
install( | ||
DIRECTORY ./src/recycle | ||
DESTINATION ${CMAKE_INSTALL_PREFIX}/include | ||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" | ||
FILES_MATCHING | ||
PATTERN *.hpp) | ||
|
||
# Install targets | ||
install(TARGETS recycle EXPORT recycle-targets) | ||
install( | ||
EXPORT recycle-targets | ||
DESTINATION ${RECYCLE_CONFIG_DIR} | ||
NAMESPACE steinwurf::) | ||
|
||
# Install package config | ||
include(CMakePackageConfigHelpers) | ||
|
||
configure_package_config_file( | ||
cmake/recycle-config.cmake.in | ||
"${CMAKE_CURRENT_BINARY_DIR}/recycle-config.cmake" | ||
INSTALL_DESTINATION ${RECYCLE_CONFIG_DIR} | ||
NO_CHECK_REQUIRED_COMPONENTS_MACRO) | ||
|
||
write_basic_package_version_file( | ||
"${CMAKE_CURRENT_BINARY_DIR}/recycle-config-version.cmake" | ||
VERSION ${PROJECT_VERSION} | ||
COMPATIBILITY SameMajorVersion | ||
) | ||
|
||
install( | ||
FILES | ||
"${CMAKE_CURRENT_BINARY_DIR}/recycle-config.cmake" | ||
"${CMAKE_CURRENT_BINARY_DIR}/recycle-config-version.cmake" | ||
DESTINATION | ||
${RECYCLE_CONFIG_DIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@PACKAGE_INIT@ | ||
|
||
if(NOT TARGET steinwurf::recycle) | ||
set_and_check(RECYCLE_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@") | ||
include("${CMAKE_CURRENT_LIST_DIR}/recycle-targets.cmake") | ||
endif() |