From 359aae4cbe654ed60c09c8ad333c0faad2f5cefc Mon Sep 17 00:00:00 2001 From: David Feurle Date: Sun, 25 Jul 2021 12:13:40 +0200 Subject: [PATCH] We only need to link the cipher version of sqlite in case of HAS_CODEC --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b651f472..7123a570 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -240,13 +240,6 @@ if (SQLITECPP_INTERNAL_SQLITE) add_subdirectory(sqlite3) target_link_libraries(SQLiteCpp PUBLIC sqlite3) else (SQLITECPP_INTERNAL_SQLITE) - find_package (SQLite3 REQUIRED) - message(STATUS "Link to sqlite3 system library") - target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3) - if(SQLite3_VERSION VERSION_LESS "3.19") - set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT") - endif() - # When using the SQLite codec, we need to link against the sqlcipher lib & include # So this gets the lib & header, and links/includes everything if(SQLITE_HAS_CODEC) @@ -284,6 +277,13 @@ else (SQLITECPP_INTERNAL_SQLITE) target_include_directories(SQLiteCpp PRIVATE "${sqlcipher_INCLUDE_DIR}/sqlcipher") target_link_libraries(SQLiteCpp PRIVATE ${sqlcipher_LIBRARY}) endif() + else() + find_package (SQLite3 REQUIRED) + message(STATUS "Link to sqlite3 system library") + target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3) + if(SQLite3_VERSION VERSION_LESS "3.19") + set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT") + endif() endif() endif (SQLITECPP_INTERNAL_SQLITE)