mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-07 03:06:05 -04:00
Merge pull request #277 from cuberite/cmake-scoping
Fix cmake scoping issues with packaged SQLite
This commit is contained in:
commit
c68f651a10
@ -245,7 +245,7 @@ if (SQLITECPP_INTERNAL_SQLITE)
|
|||||||
option(SQLITE_ENABLE_JSON1 "Enable JSON1 extension when building internal sqlite3 library." ON)
|
option(SQLITE_ENABLE_JSON1 "Enable JSON1 extension when building internal sqlite3 library." ON)
|
||||||
# build the SQLite3 C library (for ease of use/compatibility) versus Linux sqlite3-dev package
|
# build the SQLite3 C library (for ease of use/compatibility) versus Linux sqlite3-dev package
|
||||||
add_subdirectory(sqlite3)
|
add_subdirectory(sqlite3)
|
||||||
target_link_libraries(SQLiteCpp PUBLIC sqlite3)
|
target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3)
|
||||||
else (SQLITECPP_INTERNAL_SQLITE)
|
else (SQLITECPP_INTERNAL_SQLITE)
|
||||||
# When using the SQLite codec, we need to link against the sqlcipher lib & include <sqlcipher/sqlite3.h>
|
# When using the SQLite codec, we need to link against the sqlcipher lib & include <sqlcipher/sqlite3.h>
|
||||||
# So this gets the lib & header, and links/includes everything
|
# So this gets the lib & header, and links/includes everything
|
||||||
@ -304,8 +304,6 @@ endif (UNIX)
|
|||||||
# Set includes for target and transitive downstream targets
|
# Set includes for target and transitive downstream targets
|
||||||
|
|
||||||
target_include_directories(SQLiteCpp
|
target_include_directories(SQLiteCpp
|
||||||
PRIVATE
|
|
||||||
$<$<BOOL:${SQLITECPP_INTERNAL_SQLITE}>:${CMAKE_CURRENT_SOURCE_DIR}/sqlite3>
|
|
||||||
PUBLIC
|
PUBLIC
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
$<INSTALL_INTERFACE:include/>)
|
$<INSTALL_INTERFACE:include/>)
|
||||||
@ -390,9 +388,6 @@ if (SQLITECPP_BUILD_EXAMPLES)
|
|||||||
# add the basic example executable
|
# add the basic example executable
|
||||||
add_executable(SQLiteCpp_example1 ${SQLITECPP_EXAMPLES})
|
add_executable(SQLiteCpp_example1 ${SQLITECPP_EXAMPLES})
|
||||||
target_link_libraries(SQLiteCpp_example1 SQLiteCpp)
|
target_link_libraries(SQLiteCpp_example1 SQLiteCpp)
|
||||||
target_include_directories(SQLiteCpp_example1 PRIVATE
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
||||||
$<$<BOOL:${SQLITECPP_INTERNAL_SQLITE}>:${CMAKE_CURRENT_SOURCE_DIR}/sqlite3>)
|
|
||||||
if (MSYS OR MINGW)
|
if (MSYS OR MINGW)
|
||||||
target_link_libraries(SQLiteCpp_example1 ssp)
|
target_link_libraries(SQLiteCpp_example1 ssp)
|
||||||
endif ()
|
endif ()
|
||||||
@ -404,9 +399,6 @@ if (SQLITECPP_BUILD_TESTS)
|
|||||||
# add the unit test executable
|
# add the unit test executable
|
||||||
add_executable(SQLiteCpp_tests ${SQLITECPP_TESTS})
|
add_executable(SQLiteCpp_tests ${SQLITECPP_TESTS})
|
||||||
target_link_libraries(SQLiteCpp_tests SQLiteCpp)
|
target_link_libraries(SQLiteCpp_tests SQLiteCpp)
|
||||||
target_include_directories(SQLiteCpp_tests PRIVATE
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
||||||
$<$<BOOL:${SQLITECPP_INTERNAL_SQLITE}>:${CMAKE_CURRENT_SOURCE_DIR}/sqlite3>)
|
|
||||||
|
|
||||||
find_package(GTest)
|
find_package(GTest)
|
||||||
if (GTEST_FOUND)
|
if (GTEST_FOUND)
|
||||||
|
@ -11,9 +11,12 @@ add_library(sqlite3
|
|||||||
sqlite3.h
|
sqlite3.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_library(SQLite::SQLite3 ALIAS sqlite3)
|
||||||
|
|
||||||
target_include_directories(sqlite3
|
target_include_directories(sqlite3
|
||||||
PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
PUBLIC
|
||||||
PUBLIC $<INSTALL_INTERFACE:include/>)
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
|
$<INSTALL_INTERFACE:include/>)
|
||||||
|
|
||||||
if (SQLITE_ENABLE_COLUMN_METADATA)
|
if (SQLITE_ENABLE_COLUMN_METADATA)
|
||||||
# Enable the use of SQLite column metadata method
|
# Enable the use of SQLite column metadata method
|
||||||
|
Loading…
x
Reference in New Issue
Block a user