aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhihao Yuan <zy@simplerose.com>2019-05-01 12:05:59 -0500
committerZhihao Yuan <zy@simplerose.com>2019-05-01 12:51:33 -0500
commit24e3fd103598b4ec80150ddb8dddeb2410245b9a (patch)
tree99790af3605cb0ca18bb362f3f646ba2ce35a37f
parentturn ptrdiff_t into std::ptrdiff_t (diff)
downloadargs.hxx-24e3fd103598b4ec80150ddb8dddeb2410245b9a.tar.xz
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)