Skip to content

Commit

Permalink
Make installation optional (#6)
Browse files Browse the repository at this point in the history
Signed-off-by: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
RaisinTen committed Apr 4, 2024
1 parent 7f59fc6 commit 4738ba6
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set(CMAKE_CXX_STANDARD 20)

option(BENONI_TESTS "Build the Benoni tests" OFF)
option(BENONI_EXAMPLES "Build the Benoni examples" OFF)
option(BENONI_INSTALL "Install Benoni" ON)

if(APPLE)
add_subdirectory(src/apple)
Expand All @@ -17,19 +18,21 @@ elseif(UNIX)
add_subdirectory(src/linux)
endif()

set_target_properties(benoni PROPERTIES PUBLIC_HEADER include/benoni/http.h)
set_target_properties(benoni PROPERTIES PUBLIC_HEADER ${PROJECT_SOURCE_DIR}/include/benoni/http.h)

include(GNUInstallDirs)
if(BENONI_INSTALL)
include(GNUInstallDirs)

install(TARGETS benoni
EXPORT benoni
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}"
COMPONENT benoni
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
COMPONENT benoni)
install(EXPORT benoni
DESTINATION "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake"
COMPONENT benoni)
install(TARGETS benoni
EXPORT benoni
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}"
COMPONENT benoni
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
COMPONENT benoni)
install(EXPORT benoni
DESTINATION "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake"
COMPONENT benoni)
endif()

if(BENONI_EXAMPLES)
add_subdirectory(examples)
Expand Down

0 comments on commit 4738ba6

Please sign in to comment.