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()
|
2020-12-02 05:59:39 +08:00
|
|
|
@@ -171,6 +186,7 @@ if(ENABLE_CURL)
|
|
|
|
find_package(CURL REQUIRED)
|
|
|
|
if(CURL_FOUND)
|
|
|
|
set(CURL_ENABLED TRUE)
|
|
|
|
+ set(CURL_LIBRARY CURL::libcurl)
|
|
|
|
else()
|
|
|
|
message(SEND_ERROR "curl dependency not found!")
|
|
|
|
endif()
|
|
|
|
|
2020-08-15 00:55:10 +08:00
|
|
|
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
|
2020-12-02 05:59:39 +08:00
|
|
|
index c790fa4a8..6653a28b9 100644
|
2020-08-15 00:55:10 +08:00
|
|
|
--- a/cmake/CMakeLists.txt
|
|
|
|
+++ b/cmake/CMakeLists.txt
|
2020-12-02 05:59:39 +08:00
|
|
|
@@ -95,6 +95,10 @@ endif ()
|
2020-08-15 00:55:10 +08:00
|
|
|
|
2020-12-02 05:59:39 +08:00
|
|
|
foreach (PROJECT_VARIANT_NAME ${PROJECT_NAME} ${PROJECT_LEGACY_NAME})
|
|
|
|
string (TOLOWER "${PROJECT_VARIANT_NAME}" PROJECT_VARIANT_LOWER)
|
|
|
|
+ set(FIND_DEPENDENCY_SQLITE3 "find_dependency(unofficial-sqlite3 CONFIG)")
|
|
|
|
+ if(CURL_ENABLED)
|
|
|
|
+ set(FIND_DEPENDENCY_CURL "find_dependency(CURL CONFIG)")
|
|
|
|
+ endif()
|
|
|
|
set (CMAKECONFIGSUBDIR "${CMAKECONFIGDIR}/${PROJECT_VARIANT_LOWER}")
|
|
|
|
# proj-config.cmake for the install tree. It's installed in
|
|
|
|
# ${CMAKECONFIGSUBDIR} and @PROJECT_ROOT_DIR@ is the relative
|
|
|
|
|
2020-08-15 00:55:10 +08:00
|
|
|
diff --git a/cmake/project-config.cmake.in b/cmake/project-config.cmake.in
|
2020-12-02 05:59:39 +08:00
|
|
|
index 23f997abd..8baef00f0 100644
|
2020-08-15 00:55:10 +08:00
|
|
|
--- a/cmake/project-config.cmake.in
|
|
|
|
+++ b/cmake/project-config.cmake.in
|
2020-12-02 05:59:39 +08:00
|
|
|
@@ -7,6 +7,10 @@
|
|
|
|
# @PROJECT_VARIANT_NAME@_LIBRARY_DIRS = /usr/local/lib
|
|
|
|
# @PROJECT_VARIANT_NAME@_BINARY_DIRS = /usr/local/bin
|
|
|
|
# @PROJECT_VARIANT_NAME@_VERSION = 4.9.1 (for example)
|
|
|
|
+include(CMakeFindDependencyMacro)
|
2020-08-15 00:55:10 +08:00
|
|
|
+
|
2020-12-02 05:59:39 +08:00
|
|
|
+@FIND_DEPENDENCY_SQLITE3@
|
|
|
|
+@FIND_DEPENDENCY_CURL@
|
|
|
|
|
2020-08-15 00:55:10 +08:00
|
|
|
# Tell the user project where to find our headers and libraries
|
|
|
|
get_filename_component (_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
|