Skip to content

Conversation

@longnguyen2004
Copy link
Contributor

I've tested this with:

  • Distro libs: sqlite3, sqlcipher, qscintilla, qcustomplot
  • Local libs: sqlite3, qscintilla, qhexedit, qcustomplot

All builds checked with ldd to ensure the correct libraries are linked against.
Only thing left is to test it on Windows...

@longnguyen2004
Copy link
Contributor Author

I forgot to test packaging...will do tonight

@longnguyen2004
Copy link
Contributor Author

Friendly bump :)

@mgrojo mgrojo requested a review from MKleusberg June 28, 2022 20:26
@mgrojo
Copy link
Member

mgrojo commented Jun 28, 2022

I'm lost with cmake files, I haven't got the knowledge to review this. Let's wait some days for a possible review by @MKleusberg. Otherwise, I suppose it can be merged, if nobody opposes it.

@longnguyen2004
Copy link
Contributor Author

longnguyen2004 commented Jul 21, 2022

How's the progress on this?

@mgrojo
Copy link
Member

mgrojo commented Jul 21, 2022

Ok, nobody opposed after a long time. Thanks for your contribution.

@mgrojo mgrojo merged commit b01a201 into sqlitebrowser:master Jul 21, 2022
@mgrojo
Copy link
Member

mgrojo commented Jul 21, 2022

By the way, have you checked if this affect documentation? Wiki and BUILDING.md

@longnguyen2004
Copy link
Contributor Author

Everything should stay the same as before, I'm just rewriting some parts to utilize targets.

@mgrojo
Copy link
Member

mgrojo commented Jul 22, 2022

Perfect, thanks.

@rayures
Copy link

rayures commented Jul 25, 2022

Everything should stay the same as before, I'm just rewriting some parts to utilize targets.

at least this isn't working anymore: https://github.com/sqlitebrowser/sqlitebrowser/wiki/Compiling-DB4S-on-Ubuntu-To-Use-A-Pre-Installed-Version-of-SQLite

i am unable to compile with a current sqlite version. It stays at 3.15.2
locally installed is 3.34.1

@longnguyen2004
Copy link
Contributor Author

Oh I should have noticed that. But did you install SQLite to a non-standard prefix? I'm pretty sure CMake also looks up /usr/local by default.

@rayures
Copy link

rayures commented Jul 26, 2022

just installed it with apt install sqlite3

which sqlite3 says:
/usr/bin/sqlite3

(kubuntu 21.04)

//running the latest .appimage it does show the included sqlite 3.38.5 in about and with SELECT sqlite_version();

@longnguyen2004
Copy link
Contributor Author

Hmm okay. During configuration, there should be a "Found SQLite3: ..." somewhere in the log. Does it point to the correct library file? There might be a leftover SQLite3 installation somewhere.
As a workaround, you can try adding -DCMAKE_SYSTEM_PREFIX_PATH=/usr, to force CMake to look only at the /usr prefix for libraries.

@rayures
Copy link

rayures commented Jul 26, 2022

i was unable to find anything in the log with found sqlite3.

i added the -DCMAKE_SYSTEM_PREFIX_PATH=/usr to cmake and ran it. immediately it showed -- Found SQLite3: /usr/include (found version "3.34.1")
build it further and db4s is also reporting 3.34.1 :-)

for future reference. this was working for me:
apt install sqlite3
git clone https://github.com/sqlitebrowser/sqlitebrowser.git
cd sqlitebrowser
cmake --DCMAKE_SYSTEM_PREFIX_PATH=/usr .
make
make install
profit.

@longnguyen2004
Copy link
Contributor Author

I'll add this to the wiki. Glad it helped!

@justinclift
Copy link
Member

justinclift commented Jul 29, 2022

Been trying to get our Windows nightly builds working again today, as they broke when this was merged. 😉

The problem seems to be it's just not finding the SQLCipher directory, regardless of what value I pass it. 😦

-- Could NOT find SQLCipher (missing: SQLCIPHER_INCLUDE_DIR)
-- Configuring done
CMake Error in CMakeLists.txt:
  Imported target "SQLCipher::SQLCipher" includes non-existent path

    "SQLCIPHER_INCLUDE_DIR-NOTFOUND"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

We used to point to the SQLCipher directory using a SQLCIPHER_DIR environment variable, which seems to now be SQLCIPHER_ROOT_DIR. Updating the build script to use that though, makes no difference. Same error as above. 😦

Also setting SQLCIPHER_INCLUDE_DIR doesn't seem to help, though I'm not 100% sure I've got the value right:

SET SQLCIPHER_ROOT_DIR=C:\\git_repos\\SQLCipher-Win64
SET SQLCIPHER_INCLUDE_DIR=C:\\git_repos\\SQLCipher-Win64\\src

Note that it's pointing to the src subdirectory of the SQLCipher dir, as we don't actually install SQLCipher anywhere. We just compile it in place:

nmake /f Makefile.msc sqlcipher.dll USE_AMALGAMATION=1 NO_TCL=1 SQLITE3DLL=sqlcipher.dll SQLITE3LIB=sqlcipher.lib SQLITE3EXE=sqlcipher.exe LTLINKOPTS="C:\dev\OpenSSL-Win64\lib\libcrypto.lib" OPT_FEATURE_FLAGS="-DSQLITE_TEMP_STORE=2 -DSQLITE_HAS_CODEC=1 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_FTS5=1 -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 -DSQLITE_ENABLE_STAT4=1 -DSQLITE_SOUNDEX=1 -DSQLITE_ENABLE_JSON1=1 -DSQLITE_ENABLE_GEOPOLY=1 -DSQLITE_ENABLE_RTREE=1 -DSQLCIPHER_CRYPTO_OPENSSL=1 -DSQLITE_MAX_ATTACHED=125 -IC:\dev\OpenSSL-Win64\include"

Anyone have ideas how to get this working again?

@justinclift
Copy link
Member

As a data point, our macOS nightly builds are broken too. Not sure why, but it seems to be picking up the SQLite library included in macOS (that doesn't have sqlite3_enable_load_extension()), rather than our customised version of it.

Kind of need sleep atm, so I'll take a look at this again tomorrow. 😄

@longnguyen2004
Copy link
Contributor Author

longnguyen2004 commented Jul 30, 2022

Hmm I'll have to look at the Makefile to see how it works. I rarely work with hand written Makefiles nowadays.
It's strange that the Makefile doesn't provide an install target. Anyway, the FindSQLCipher.cmake file expects to find the include file in ${SQLCIPHER_ROOT_DIR}/sqlcipher/sqlite3.h, and the library file in ${SQLCIPHER_ROOT_DIR}/sqlcipher.lib. Try setting up the correct directory structure and try again.

For the macOS problem, did you add -DCMAKE_SYSTEM_PREFIX_PATH=<sqlite3 prefix> to the CMake command line?

mgrojo added a commit that referenced this pull request Sep 12, 2022
justinclift added a commit that referenced this pull request Sep 13, 2022
mgrojo added a commit that referenced this pull request Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants