Repository navigation
Description
Using Ubuntu 19 (on arm64), I have no trouble compiling SQLiteCpp, but my own CMake configuration fails with the following error:
CMake Error at /usr/share/cmake-3.13/Modules/CMakeFindDependencyMacro.cmake:48 (find_package):
By not providing "FindSQLite3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "SQLite3", but
CMake did not find one.
Could not find a package configuration file provided by "SQLite3" with any
of the following names:
SQLite3Config.cmake
sqlite3-config.cmake
Add the installation prefix of "SQLite3" to CMAKE_PREFIX_PATH or set
"SQLite3_DIR" to a directory containing one of the above files. If
"SQLite3" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
/usr/local/lib/cmake/SQLiteCpp/SQLiteCppConfig.cmake:2 (find_dependency)
CMakeLists.txt:50 (find_package)
I'm guessing that since SQLiteCppConfig.cmake contains the line find_dependency(SQLite3) that it is telling CMake that either SQLite3Config.cmake or sqlite3-config.cmake exist on system. However, it looks like this Ubuntu issue is stating that these files are not currently installed:
I had thought that when cmake -DSQLITECPP_INTERNAL_SQLITE=ON .. is used, that it might make everything work for me, so perhaps this config option could be checked for in https://github.com/SRombauts/SQLiteCpp/blob/master/cmake/SQLiteCppConfig.cmake.in to stop the execution of find_dependency(SQLite3).
Activity
travishaagen commentedon Apr 5, 2020
On another note, I have been compiling on Mac and Alpine Linux prior to trying Ubuntu and ran into other CMake issues with SQLite3. I found the following that seemed to work:
then
Reference: https://visualgdb.com/tutorials/linux/cmake/target_link_libraries/
SRombauts commentedon Apr 5, 2020
Oh yes I see, I think that SQLiteCppConfig doesn't work with/has not been thought for use with the Internal SQLite3
Out of curiosity, Have you checked if I am using/testing it in https://github.com/SRombauts/SQLiteCpp Example ?
Sorry I am not in front of a computer
Are you able to patch it for your needs ?
Edit: actually, I thought that I had put aFindSQLite3.cmake in the cmake subdir
Cheers !
travishaagen commentedon Apr 11, 2020
I can make it work by commenting out the second line in the installed file:
I think the problem is that
find_dependency(SQLite3)tells CMake to look for eitherSQLite3Config.cmakeorsqlite3-config.cmake, but since they do not exist, then it fails.Is the call to
find_dependency(SQLite3)in SQLiteCppConfig.cmake.in just a sanity check to make sure the dependency of SQLite3 is installed?I am not a CMake expert, but the following might work and still preserve the existing behavior:
sum01 commentedon May 16, 2020
The call to
find_dependency(SQLite3)is necessary if there is public linkage to SQLite3 to the library. This is how you propagate public dependencies automatically for anyone using your library.
What's going wrong is that the FindSQLite3 (official) module isn't in Cmake until version 3.14, while you're on Cmake version 3.13, but the
find_dependencycall is trying to use an official module.A potential solution here would be to install the project's unofficial FindSQLite3 module so it can be added to the module path before calling
find_dependency(SQLite3).All that being said, I don't believe SQLite3 is actually a public dependency, no? All the installed headers have zero
#include <sqlite3.h>anywhere to be found.If that's actually the case, then the call to
find_dependency(SQLite3)could be removed, and all calls totarget_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3)should be madePRIVATE.nidefawl commentedon Feb 22, 2022
SQLiteCpp/cmake/SQLiteCppConfig.cmake.in
Line 2 in ce6dd9b
Should be updated to
joenano commentedon Sep 20, 2022
This seems like a great library, shame its an absolute nightmare trying to use it.
Instructions say
"you can comment out the following line in src/Column.h:
#define SQLITE_ENABLE_COLUMN_METADATA"
but the line doesnt exist
Update README on how to compile without SQLITE_ENABLE_COLUMN_METADATA…
SRombauts commentedon Sep 30, 2022
@joenano I updated the README to say to
turn off the option(SQLITE_ENABLE_COLUMN_METADATA "Enable Column::getColumnOriginName(). Require support from sqlite3 library." ON) in [CMakeFiles.txt](https://github.com/SRombauts/SQLiteCpp/blob/master/CMakeFiles.txt)Make find_dependency(SQLite3 REQUIRED) conditional as mentioned in #276
SRombauts commentedon Sep 30, 2022
Hello, this should be finally fixed by the merge of #277