Skip to content

Commit

Permalink
Merge pull request #118 from timrae/add-install-target
Browse files Browse the repository at this point in the history
Add install step
  • Loading branch information
SRombauts authored Mar 27, 2017
2 parents 4d6356f + 8387b59 commit 6932525
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,22 @@ include_directories("${PROJECT_SOURCE_DIR}/include")

# add sources of the wrapper as a "SQLiteCpp" static library
add_library(SQLiteCpp ${SQLITECPP_SRC} ${SQLITECPP_INC} ${SQLITECPP_DOC} ${SQLITECPP_SCRIPT})
target_include_directories(SQLiteCpp PUBLIC "${PROJECT_SOURCE_DIR}/include")

if (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-fPIC")
endif (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))

# Allow the library to be installed via "make install" and found with "find_package"
install(TARGETS SQLiteCpp
EXPORT ${PROJECT_NAME}Config
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
COMPONENT libraries)
target_include_directories(SQLiteCpp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/>)
install(DIRECTORY include/ DESTINATION include COMPONENT headers FILES_MATCHING REGEX ".*\\.(hpp|h)$")
install(EXPORT ${PROJECT_NAME}Config DESTINATION lib/cmake/${PROJECT_NAME})

## Build provided copy of SQLite3 C library ##

Expand Down

0 comments on commit 6932525

Please sign in to comment.