Skip to content

Commit 063af3e

Browse files
committed
Add CMake installation target (inspired on PR #30)
1 parent 71458b2 commit 063af3e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ option( OPTIONAL_LITE_OPT_SELECT_NONSTD "Select nonstd::optional" OFF )
2121

2222
project( optional_lite LANGUAGES CXX )
2323

24+
include( GNUInstallDirs )
25+
2426
set( package_name "optional-lite" )
2527
set( include_source_dir "${PROJECT_SOURCE_DIR}/include" )
2628

@@ -32,6 +34,13 @@ add_library(
3234
target_include_directories(
3335
${package_name} INTERFACE "$<BUILD_INTERFACE:${include_source_dir}>" )
3436

37+
# Installation:
38+
39+
install(
40+
DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
41+
42+
# If requested, build and perform tests, build examples:
43+
3544
enable_testing()
3645

3746
if ( OPTIONAL_LITE_OPT_BUILD_TESTS )

0 commit comments

Comments
 (0)