diff options
Diffstat (limited to 'project/cmake/modules/FindSqlite3.cmake')
| -rw-r--r-- | project/cmake/modules/FindSqlite3.cmake | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/project/cmake/modules/FindSqlite3.cmake b/project/cmake/modules/FindSqlite3.cmake index a47944e..abde0cf 100644 --- a/project/cmake/modules/FindSqlite3.cmake +++ b/project/cmake/modules/FindSqlite3.cmake | |||
| @@ -1,19 +1,44 @@ | |||
| 1 | # - Try to find SQLITE3 | 1 | #.rst: |
| 2 | # Once done this will define | 2 | # FindSqlite3 |
| 3 | # ----------- | ||
| 4 | # Finds the SQLite3 library | ||
| 3 | # | 5 | # |
| 4 | # SQLITE3_FOUND - system has sqlite3 | 6 | # This will will define the following variables:: |
| 5 | # SQLITE3_INCLUDE_DIRS - the sqlite3 include directory | 7 | # |
| 6 | # SQLITE3_LIBRARIES - The sqlite3 libraries | 8 | # SQLITE3_FOUND - system has SQLite3 |
| 9 | # SQLITE3_INCLUDE_DIRS - the SQLite3 include directory | ||
| 10 | # SQLITE3_LIBRARIES - the SQLite3 libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # SQLite3::SQLite3 - The SQLite3 library | ||
| 7 | 15 | ||
| 8 | if(PKG_CONFIG_FOUND) | 16 | if(PKG_CONFIG_FOUND) |
| 9 | pkg_check_modules (SQLITE3 sqlite3) | 17 | pkg_check_modules(PC_SQLITE3 sqlite3 QUIET) |
| 10 | list(APPEND SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDEDIR}) | ||
| 11 | else() | ||
| 12 | find_path(SQLITE3_INCLUDE_DIRS sqlite3.h) | ||
| 13 | find_library(SQLITE3_LIBRARIES sqlite3) | ||
| 14 | endif() | 18 | endif() |
| 15 | 19 | ||
| 20 | find_path(SQLITE3_INCLUDE_DIR NAMES sqlite3.h | ||
| 21 | PATHS ${PC_SQLITE3_INCLUDEDIR}) | ||
| 22 | find_library(SQLITE3_LIBRARY NAMES sqlite3 | ||
| 23 | PATHS ${PC_SQLITE3_LIBDIR}) | ||
| 24 | |||
| 25 | set(SQLITE3_VERSION ${PC_SQLITE3_VERSION}) | ||
| 26 | |||
| 16 | include(FindPackageHandleStandardArgs) | 27 | include(FindPackageHandleStandardArgs) |
| 17 | find_package_handle_standard_args(Sqlite3 DEFAULT_MSG SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES) | 28 | find_package_handle_standard_args(Sqlite3 |
| 29 | REQUIRED_VARS SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR | ||
| 30 | VERSION_VAR SQLITE3_VERSION) | ||
| 31 | |||
| 32 | if(SQLITE3_FOUND) | ||
| 33 | set(SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDE_DIR}) | ||
| 34 | set(SQLITE3_LIBRARIES ${SQLITE3_LIBRARY}) | ||
| 35 | |||
| 36 | if(NOT TARGET SQLite3::SQLite3) | ||
| 37 | add_library(SQLite3::SQLite3 UNKNOWN IMPORTED) | ||
| 38 | set_target_properties(SQLite3::SQLite3 PROPERTIES | ||
| 39 | IMPORTED_LOCATION "${SQLITE3_LIBRARY}" | ||
| 40 | INTERFACE_INCLUDE_DIRECTORIES "${SQLITE3_INCLUDE_DIR}") | ||
| 41 | endif() | ||
| 42 | endif() | ||
| 18 | 43 | ||
| 19 | mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES) | 44 | mark_as_advanced(SQLITE3_INCLUDE_DIR SQLITE3_LIBRARY) |
