From a25ffb56ab1bae0f416ac5dfbddd4188ea3c1a9c Mon Sep 17 00:00:00 2001 From: Peter Bell Date: Fri, 8 May 2020 02:27:52 +0100 Subject: [PATCH 1/2] Fix sqlite3 target includes for build interface --- sqlite3/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sqlite3/CMakeLists.txt b/sqlite3/CMakeLists.txt index 9cfcdd0..3cc5101 100644 --- a/sqlite3/CMakeLists.txt +++ b/sqlite3/CMakeLists.txt @@ -11,9 +11,9 @@ add_library(sqlite3 sqlite3.h ) -target_include_directories(sqlite3 - PRIVATE $ - PUBLIC $) +target_include_directories(sqlite3 PUBLIC + $ + $) if (SQLITE_ENABLE_COLUMN_METADATA) # Enable the use of SQLite column metadata method From b1f67393fdac05d7d05b7f1232de688e82a7e98f Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 24 Jun 2021 20:52:28 +0100 Subject: [PATCH 2/2] It's the sqlite3 library that needs threads --- CMakeLists.txt | 7 ------- sqlite3/CMakeLists.txt | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 85c1061..ee23417 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -279,13 +279,6 @@ else (SQLITECPP_INTERNAL_SQLITE) endif() endif (SQLITECPP_INTERNAL_SQLITE) -# Link target with pthread and dl for Unix -if (UNIX) - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads REQUIRED) - target_link_libraries(SQLiteCpp PUBLIC Threads::Threads ${CMAKE_DL_LIBS}) -endif (UNIX) - # Set includes for target and transitive downstream targets target_include_directories(SQLiteCpp diff --git a/sqlite3/CMakeLists.txt b/sqlite3/CMakeLists.txt index 3cc5101..11fc871 100644 --- a/sqlite3/CMakeLists.txt +++ b/sqlite3/CMakeLists.txt @@ -11,6 +11,13 @@ add_library(sqlite3 sqlite3.h ) +# Link target with pthread and dl for Unix +if (UNIX) + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) + target_link_libraries(sqlite3 PUBLIC Threads::Threads ${CMAKE_DL_LIBS}) +endif (UNIX) + target_include_directories(sqlite3 PUBLIC $ $)