-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use CMake's SQLite targets #58726
Use CMake's SQLite targets #58726
Conversation
tests/bench/CMakeLists.txt
Outdated
@@ -20,12 +20,12 @@ include_directories( | |||
${CMAKE_BINARY_DIR} | |||
) | |||
include_directories(SYSTEM | |||
${SQLITE3_INCLUDE_DIR} | |||
${SQLite3_INCLUDE_DIRS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include_directories() should not longer be needed because the below target_link_libraries() now uses the SQLite::SQLite3 target name, which declares INTERFACE_INCLUDE_DIRECTORIES per your above changes (cf https://schneide.blog/2016/04/08/modern-cmake-with-target_link_libraries/)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I'll make the changes. Thanks.
tests/bench/CMakeLists.txt
Outdated
) | ||
|
||
target_link_libraries(qgis_bench | ||
qgis_core | ||
${SQLITE3_LIBRARY} | ||
SQLite::SQLite3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also inherited from qgis_core, you can remove this line too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedbacks.
Should be ok now.
CMakeLists.txt
Outdated
# This bypasses the FindSQLite3 module introduced in CMake 3.14 | ||
# On case insensitive platforms (e.g. Windows) this is because | ||
# ./cmake/FindSqlite3.cmake comes first on the CMAKE_MODULE_PATH | ||
# (otherwise it is because of the case: *Sqlite3* vs. *SQLite3*) | ||
find_package(Sqlite3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should just make it REQUIRED
here and kill the checks below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine for me I just kept it like it was before. :-)
This uses the same targets and variables introduced in the FindSQLite3 module in CMake starting with version 3.14. The other CMakeFiles.txt are modified accordingly.
Thanks for this! |
The ./cmake/FindSqlite3.cmake is modified to use the same targets and variables introduced in the FindSQLite3 module in CMake starting with version 3.14.
The other CMakeFiles.txt are modified accordingly.
Fixes #56885