Skip to content

Commit

Permalink
cmake: use of imported SQLite target, drop custom FindSQLite (OSGeo#5311
Browse files Browse the repository at this point in the history
)
  • Loading branch information
nilason authored Mar 6, 2025
1 parent 2bc0150 commit 61fc4d1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 22 deletions.
9 changes: 0 additions & 9 deletions cmake/find_scripts/FindSQLite.cmake

This file was deleted.

12 changes: 3 additions & 9 deletions cmake/modules/CheckDependentLibraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,7 @@ endif()
# Data storage options

if(WITH_SQLITE)
find_package(SQLite REQUIRED)
if(SQLITE_FOUND)
add_library(SQLITE INTERFACE IMPORTED GLOBAL)
set_property(TARGET SQLITE PROPERTY INTERFACE_LINK_LIBRARIES
${SQLITE_LIBRARY})
set_property(TARGET SQLITE PROPERTY INTERFACE_INCLUDE_DIRECTORIES
${SQLITE_INCLUDE_DIR})
endif()
find_package(SQLite3 REQUIRED)
endif()

if(WITH_POSTGRES)
Expand Down Expand Up @@ -328,7 +321,8 @@ check_target(ZLIB::ZLIB HAVE_ZLIB_H)
check_target(Iconv::Iconv HAVE_ICONV_H)
check_target(PNG::PNG HAVE_PNG_H)
check_target(LIBJPEG HAVE_JPEGLIB_H)
check_target(SQLITE HAVE_SQLITE)
check_target(SQLite::SQLite3 HAVE_SQLITE)
check_target(SQLite::SQLite3 HAVE_SQLITE3_H)
check_target(PostgreSQL::PostgreSQL HAVE_POSTGRES)
check_target(PostgreSQL::PostgreSQL HAVE_LIBPQ_FE_H)
check_target(MYSQL HAVE_MYSQL_H)
Expand Down
4 changes: 2 additions & 2 deletions db/drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ build_program_in_subdir(
DEFS
"${grass_dbstubs_DEFS}"
PRIMARY_DEPENDS
SQLITE
SQLite::SQLite3
HTML_FILE_NAME
grass-sqlite
RUNTIME_OUTPUT_DIR
"${GRASS_INSTALL_DRIVERDIR}/db")

if(TARGET SQLITE)
if(TARGET SQLite::SQLite3)
list(APPEND db_drivers sqlite)
endif()

Expand Down
2 changes: 1 addition & 1 deletion general/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ build_program_in_subdir(
GDAL::GDAL
GEOS::geos_c
PROJ
SQLITE
SQLite::SQLite3
DEFS
"-DGRASS_VERSION_NUMBER=\"${GRASS_VERSION_NUMBER}\""
"-DGRASS_VERSION_GIT=\"${GRASS_VERSION_GIT}\""
Expand Down
2 changes: 1 addition & 1 deletion include/config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
#cmakedefine HAVE_SQLITE3_H ${HAVE_SQLITE3_H}

/* Define to 1 if you have the <sql.h> header file. */
#cmakedefine HAVE_SQL_H ${HAVE_SQLITE3_H}
#cmakedefine HAVE_SQL_H ${HAVE_SQL_H}

/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H}
Expand Down

0 comments on commit 61fc4d1

Please sign in to comment.