Skip to content

Commit

Permalink
Add CMake installation target (inspired on PR #30)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmoene committed Sep 13, 2018
1 parent 71458b2 commit 063af3e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ option( OPTIONAL_LITE_OPT_SELECT_NONSTD "Select nonstd::optional" OFF )

project( optional_lite LANGUAGES CXX )

include( GNUInstallDirs )

set( package_name "optional-lite" )
set( include_source_dir "${PROJECT_SOURCE_DIR}/include" )

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

# Installation:

install(
DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )

# If requested, build and perform tests, build examples:

enable_testing()

if ( OPTIONAL_LITE_OPT_BUILD_TESTS )
Expand Down

0 comments on commit 063af3e

Please sign in to comment.