aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor C. Richberger <taywee@gmx.com>2019-05-01 14:16:53 -0600
committerGitHub <noreply@github.com>2019-05-01 14:16:53 -0600
commit623e52cb128cfc572ad4e79de8d5f8861d13d017 (patch)
tree99790af3605cb0ca18bb362f3f646ba2ce35a37f
parentturn ptrdiff_t into std::ptrdiff_t (diff)
parentinstall CMake target taywee::args (diff)
downloadargs.hxx-623e52cb128cfc572ad4e79de8d5f8861d13d017.tar.xz
Merge pull request #73 from zhihaoy/cmake-targets
install CMake target taywee::args
-rw-r--r--CMakeLists.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c59cfa9..6f63af6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,7 +26,16 @@ option(ARGS_BUILD_EXAMPLE "Build example" ON)
option(ARGS_BUILD_UNITTESTS "Build unittests" ON)
add_library(args INTERFACE)
-target_include_directories(args INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
+target_include_directories(args INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
+ $<INSTALL_INTERFACE:include>)
+
+install(FILES args.hxx DESTINATION include)
+install(TARGETS args EXPORT args-targets)
+install(EXPORT args-targets
+ FILE args-config.cmake
+ NAMESPACE taywee::
+ DESTINATION lib/cmake/args)
if (ARGS_BUILD_EXAMPLE)
add_executable(gitlike examples/gitlike.cxx)