Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to explicit SQLite3 target #3987

Merged
merged 4 commits into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmake/FindSqlite3.cmake
Original file line number Diff line number Diff line change
@@ -66,6 +66,14 @@ endif()


if(SQLITE3_FOUND)

if(NOT TARGET SQLite::SQLite3)
add_library(SQLite::SQLite3 UNKNOWN IMPORTED)
set_target_properties(SQLite::SQLite3 PROPERTIES
IMPORTED_LOCATION "${SQLITE3_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${SQLITE3_INCLUDE_DIR}")
endif()

if(NOT SQLITE3_FIND_QUIETLY)
message(STATUS "Found Sqlite3: ${SQLITE3_LIBRARY}")
message(STATUS "Sqlite3 version: ${SQLITE3_VERSION}")
2 changes: 2 additions & 0 deletions cmake/project-config.cmake.in
Original file line number Diff line number Diff line change
@@ -27,6 +27,8 @@ if("@CURL_ENABLED@")
endif()
cmake_policy(POP)

find_package(SQLite3 REQUIRED)

if(DEFINED PROJ_CONFIG_FIND_TIFF_DEP)
find_dependency(TIFF)
endif()
3 changes: 1 addition & 2 deletions src/lib_proj.cmake
Original file line number Diff line number Diff line change
@@ -462,8 +462,7 @@ if(Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
target_link_libraries(proj PRIVATE ${CMAKE_THREAD_LIBS_INIT})
endif()

target_include_directories(proj PRIVATE ${SQLITE3_INCLUDE_DIR})
target_link_libraries(proj PRIVATE ${SQLITE3_LIBRARY})
target_link_libraries(proj PRIVATE SQLite::SQLite3)

if(NLOHMANN_JSON STREQUAL "external")
target_compile_definitions(proj PRIVATE EXTERNAL_NLOHMANN_JSON)