Skip to content

Commit

Permalink
Export targets
Browse files Browse the repository at this point in the history
  • Loading branch information
Martchus committed Jul 3, 2017
1 parent 9827cda commit ef1474e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.7)
cmake_minimum_required (VERSION 3.0.2)
project (pistache)
include(CheckCXXCompilerFlag)

Expand Down
20 changes: 20 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,23 @@ install(
DIRECTORY "${PROJECT_SOURCE_DIR}/include/pistache"
DESTINATION ${include_install_dir}
FILES_MATCHING PATTERN "*.*h")
install(TARGETS pistache
EXPORT PistacheTargets
DESTINATION lib)
install(EXPORT PistacheTargets
DESTINATION "lib/cmake/pistache"
EXPORT_LINK_INTERFACE_LIBRARIES
COMPONENT cmake-config
)

include(CMakePackageConfigHelpers)
configure_package_config_file(
"PistacheConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/PistacheConfig.cmake"
INSTALL_DESTINATION "lib/cmake/pistache"
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/PistacheConfig.cmake"
DESTINATION "lib/cmake/pistache"
COMPONENT cmake-config
)
3 changes: 3 additions & 0 deletions src/PistacheConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/PistacheTargets.cmake")

0 comments on commit ef1474e

Please sign in to comment.