mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-07 19:26:10 -04:00
fix: hide installation behind an option
Currently, every project pulling in SQLiteCpp automatically gets an `make install` which installs SQLiteCpp into the system. This is often not desired, since other projects only statically link. The solution is to add another "SQLITECPP_install" option, which allows to turn on/off this behavior.
This commit is contained in:
parent
59a047b8d3
commit
47909c4afb
@ -363,7 +363,8 @@ target_include_directories(SQLiteCpp
|
||||
$<INSTALL_INTERFACE:include/>)
|
||||
|
||||
# Allow the library to be installed via "make install" and found with "find_package"
|
||||
|
||||
option(SQLITECPP_INSTALL "Enables the install target." ON)
|
||||
if (SQLITECPP_INSTALL)
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS SQLiteCpp
|
||||
EXPORT ${PROJECT_NAME}Targets
|
||||
@ -387,6 +388,7 @@ install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
||||
endif (SQLITECPP_INSTALL)
|
||||
|
||||
# Optional additional targets:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user