diff --git a/CMakeLists.txt b/CMakeLists.txt index ff65050..2cfc6e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,7 +245,7 @@ if (SQLITECPP_INTERNAL_SQLITE) 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 add_subdirectory(sqlite3) - target_link_libraries(SQLiteCpp PUBLIC sqlite3) + target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3) else (SQLITECPP_INTERNAL_SQLITE) # When using the SQLite codec, we need to link against the sqlcipher lib & include # So this gets the lib & header, and links/includes everything @@ -304,8 +304,6 @@ endif (UNIX) # Set includes for target and transitive downstream targets target_include_directories(SQLiteCpp - PRIVATE - $<$:${CMAKE_CURRENT_SOURCE_DIR}/sqlite3> PUBLIC $ $) @@ -390,9 +388,6 @@ if (SQLITECPP_BUILD_EXAMPLES) # add the basic example executable add_executable(SQLiteCpp_example1 ${SQLITECPP_EXAMPLES}) target_link_libraries(SQLiteCpp_example1 SQLiteCpp) - target_include_directories(SQLiteCpp_example1 PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/include - $<$:${CMAKE_CURRENT_SOURCE_DIR}/sqlite3>) if (MSYS OR MINGW) target_link_libraries(SQLiteCpp_example1 ssp) endif () @@ -404,9 +399,6 @@ if (SQLITECPP_BUILD_TESTS) # add the unit test executable add_executable(SQLiteCpp_tests ${SQLITECPP_TESTS}) target_link_libraries(SQLiteCpp_tests SQLiteCpp) - target_include_directories(SQLiteCpp_tests PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/include - $<$:${CMAKE_CURRENT_SOURCE_DIR}/sqlite3>) find_package(GTest) if (GTEST_FOUND) diff --git a/sqlite3/CMakeLists.txt b/sqlite3/CMakeLists.txt index 3dd1400..0efc3ee 100644 --- a/sqlite3/CMakeLists.txt +++ b/sqlite3/CMakeLists.txt @@ -11,9 +11,12 @@ add_library(sqlite3 sqlite3.h ) +add_library(SQLite::SQLite3 ALIAS sqlite3) + target_include_directories(sqlite3 - PRIVATE $ - PUBLIC $) + PUBLIC + $ + $) if (SQLITE_ENABLE_COLUMN_METADATA) # Enable the use of SQLite column metadata method