Skip to content

Commit

Permalink
We still need to respect SQLite3_ROOT
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Mar 7, 2024
1 parent ab34dd4 commit 488f15d
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions proj/proj.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,89 @@
diff -Naur PROJ/cmake/FindSQLite3.cmake PROJ_BLD/cmake/FindSQLite3.cmake
--- PROJ/cmake/FindSQLite3.cmake 1969-12-31 19:00:00.000000000 -0500
+++ PROJ_BLD/cmake/FindSQLite3.cmake 2024-03-06 19:42:52.432871462 -0500
@@ -0,0 +1,82 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindSQLite3
+-----------
+
+.. versionadded:: 3.14
+
+Find the SQLite libraries, v3
+
+IMPORTED targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` target:
+
+``SQLite::SQLite3``
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables if found:
+
+``SQLite3_INCLUDE_DIRS``
+ where to find sqlite3.h, etc.
+``SQLite3_LIBRARIES``
+ the libraries to link against to use SQLite3.
+``SQLite3_EXECNAME``
+ the sqlite3 program name.
+``SQLite3_VERSION``
+ version of the SQLite3 library found
+``SQLite3_FOUND``
+ TRUE if found
+
+#]=======================================================================]
+
+set(_SQLite3_SEARCHES)
+
+# Search SQLite3_ROOT first if it is set.
+if(SQLite3_ROOT)
+ set(_SQLite3_SEARCH_ROOT PATHS ${SQLite3_ROOT} NO_DEFAULT_PATH)
+ list(APPEND _SQLite3_SEARCHES _SQLite3_SEARCH_ROOT)
+endif()
+
+set(SQLite3_NAMES sqlite3 sqlite libsqlite3 libsqlite)
+
+# Try each search configuration.
+foreach(search ${_SQLite3_SEARCHES})
+ find_path(SQLite3_INCLUDE_DIR NAMES sqlite3.h ${${search}} PATH_SUFFIXES include)
+ find_library(SQLite3_LIBRARY NAMES ${SQLite3_NAMES} ${${search}} PATH_SUFFIXES lib)
+ find_program(SQLite3_EXECNAME NAMES sqlite3 sqlite ${${search}} PATH_SUFFIXES bin)
+endforeach()
+
+mark_as_advanced(SQLite3_LIBRARY SQLite3_INCLUDE_DIR)
+
+# 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()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SQLite3
+ REQUIRED_VARS SQLite3_INCLUDE_DIR SQLite3_LIBRARY
+ VERSION_VAR SQLite3_VERSION)
+
+# Create the imported target
+if(SQLite3_FOUND)
+ set(SQLite3_INCLUDE_DIRS ${SQLite3_INCLUDE_DIR})
+ set(SQLite3_LIBRARIES ${SQLite3_LIBRARY})
+ 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()
+endif()
+
diff -Naur PROJ/CMakeLists.txt PROJ_BLD/CMakeLists.txt
--- PROJ/CMakeLists.txt 2024-03-06 12:18:36.881778166 -0500
+++ PROJ_BLD/CMakeLists.txt 2024-03-06 12:18:22.678018313 -0500
Expand Down

0 comments on commit 488f15d

Please sign in to comment.