Make SQLite includes private

This commit is contained in:
Peter Bell 2020-05-08 12:32:57 +01:00
parent 7cfe26ee9f
commit fd569f58a6

View File

@ -225,11 +225,11 @@ if (SQLITECPP_INTERNAL_SQLITE)
message(STATUS "Compile sqlite3 from source in subdirectory")
# build the SQLite3 C library (for ease of use/compatibility) versus Linux sqlite3-dev package
add_subdirectory(sqlite3)
target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3)
target_link_libraries(SQLiteCpp PRIVATE SQLite::SQLite3)
else (SQLITECPP_INTERNAL_SQLITE)
find_package (SQLite3 REQUIRED)
message(STATUS "Link to sqlite3 system library")
target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3)
target_link_libraries(SQLiteCpp PRIVATE SQLite::SQLite3)
if(SQLite3_VERSION VERSION_LESS "3.19")
set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT")
endif()
@ -339,7 +339,7 @@ option(SQLITECPP_BUILD_TESTS "Build and run tests." OFF)
if (SQLITECPP_BUILD_TESTS)
# add the unit test executable
add_executable(SQLiteCpp_tests ${SQLITECPP_TESTS})
target_link_libraries(SQLiteCpp_tests SQLiteCpp)
target_link_libraries(SQLiteCpp_tests SQLiteCpp SQLite::SQLite3)
find_package(GTest)
if (GTEST_FOUND)