2020-08-15 00:55:10 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2020-12-02 05:59:39 +08:00
|
|
|
index 7d736d129..2be8f8be9 100644
|
2020-08-15 00:55:10 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2020-12-02 05:59:39 +08:00
|
|
|
@@ -129,7 +129,22 @@ if(NOT EXE_SQLITE3)
|
2020-08-15 00:55:10 +08:00
|
|
|
message(SEND_ERROR "sqlite3 binary not found!")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
-find_package(Sqlite3 REQUIRED)
|
|
|
|
+find_package(unofficial-sqlite3 CONFIG REQUIRED)
|
|
|
|
+if(unofficial-sqlite3_FOUND)
|
|
|
|
+ set(SQLITE3_FOUND true)
|
|
|
|
+ get_target_property(SQLITE3_INCLUDE_DIR unofficial::sqlite3::sqlite3 INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
+ set(SQLITE3_LIBRARY unofficial::sqlite3::sqlite3)
|
|
|
|
+ # Extract version information from the header file
|
|
|
|
+ if(SQLITE3_INCLUDE_DIR)
|
|
|
|
+ file(STRINGS ${SQLITE3_INCLUDE_DIR}/sqlite3.h _ver_line
|
|
|
|
+ REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\""
|
|
|
|
+ LIMIT_COUNT 1)
|
|
|
|
+ string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
|
|
|
|
+ SQLITE3_VERSION "${_ver_line}")
|
|
|
|
+ unset(_ver_line)
|
|
|
|
+ endif()
|
|
|
|
+endif()
|
|
|
|
+
|
|
|
|
if(NOT SQLITE3_FOUND)
|
|
|
|
message(SEND_ERROR "sqlite3 dependency not found!")
|
|
|
|
endif()
|
2021-12-10 10:18:18 +08:00
|
|
|
@@ -151,6 +165,7 @@ if(ENABLE_TIFF)
|
|
|
|
find_package(TIFF REQUIRED)
|
|
|
|
if(TIFF_FOUND)
|
|
|
|
set(TIFF_ENABLED TRUE)
|
|
|
|
+ set(TIFF_LIBRARY TIFF::TIFF)
|
|
|
|
else()
|
|
|
|
message(SEND_ERROR
|
|
|
|
"libtiff dependency not found! Use ENABLE_TIFF=OFF to force it off")
|
2020-08-15 00:55:10 +08:00
|
|
|
diff --git a/cmake/project-config.cmake.in b/cmake/project-config.cmake.in
|
2022-09-07 03:50:48 +08:00
|
|
|
index 7d5579ae..0cf96252 100644
|
2020-08-15 00:55:10 +08:00
|
|
|
--- a/cmake/project-config.cmake.in
|
|
|
|
+++ b/cmake/project-config.cmake.in
|
2023-03-07 03:55:28 +08:00
|
|
|
@@ -15,6 +15,7 @@ if(@PROJECT_VARIANT_NAME@ STREQUAL "PROJ4")
|
|
|
|
|
|
|
|
cmake_policy(PUSH)
|
|
|
|
cmake_policy(SET CMP0012 NEW)
|
2021-12-10 10:18:18 +08:00
|
|
|
+find_dependency(unofficial-sqlite3 CONFIG)
|
2023-03-07 03:55:28 +08:00
|
|
|
if("@ENABLE_TIFF@")
|
|
|
|
find_dependency(TIFF)
|
|
|
|
endif()
|