Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ben Boeckel
VTK
Commits
78f7de3a
Commit
78f7de3a
authored
6 years ago
by
Ben Boeckel
Browse files
Options
Downloads
Patches
Plain Diff
FindSQLite3: backport from CMake 3.14
parent
e9c01f7e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMake/FindSQLite3.cmake
+0
-22
0 additions, 22 deletions
CMake/FindSQLite3.cmake
CMake/patches/99/FindSQLite3.cmake
+66
-0
66 additions, 0 deletions
CMake/patches/99/FindSQLite3.cmake
with
66 additions
and
22 deletions
CMake/FindSQLite3.cmake
deleted
100644 → 0
+
0
−
22
View file @
e9c01f7e
find_path
(
SQLite3_INCLUDE_DIR NAMES sqlite3.h
)
get_filename_component
(
POSSIBLE_SQLite_ROOT
"
${
SQLite3_INCLUDE_DIR
}
"
DIRECTORY
)
find_library
(
SQLite3_LIBRARY
NAMES sqlite3
HINTS
${
POSSIBLE_SQLite_ROOT
}
/lib
${
POSSIBLE_SQLite_ROOT
}
/lib64
)
set
(
SQLite3_LIBRARIES
${
SQLite3_LIBRARY
}
)
add_library
(
sqlite3::sqlite3 UNKNOWN IMPORTED
)
set_target_properties
(
sqlite3::sqlite3
PROPERTIES
IMPORTED_LOCATION
${
SQLite3_LIBRARY
}
INTERFACE_INCLUDE_DIRECTORIES
${
SQLite3_INCLUDE_DIR
}
)
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
SQLite3 DEFAULT_MSG SQLite3_LIBRARY SQLite3_INCLUDE_DIR
)
mark_as_advanced
(
SQLite3_INCLUDE_DIR SQLite3_LIBRARY
)
This diff is collapsed.
Click to expand it.
CMake/patches/99/FindSQLite3.cmake
0 → 100644
+
66
−
0
View file @
78f7de3a
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindSQLite3
-----------
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_VERSION``
version of the SQLite3 library found
``SQLite3_FOUND``
TRUE if found
#]=======================================================================]
# Look for the necessary header
find_path
(
SQLite3_INCLUDE_DIR NAMES sqlite3.h
)
mark_as_advanced
(
SQLite3_INCLUDE_DIR
)
# Look for the necessary library
find_library
(
SQLite3_LIBRARY NAMES sqlite3 sqlite
)
mark_as_advanced
(
SQLite3_LIBRARY
)
# 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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment