utelle / SQLite3MultipleCiphers

SQLite3 encryption extension with support for multiple ciphers
https://utelle.github.io/SQLite3MultipleCiphers/
MIT License
390 stars 73 forks source link

CMakeLists.txt - add support for INSTALL command #109

Closed jammerxd closed 10 months ago

jammerxd commented 1 year ago

CMakeLists needs to be updated to include support for the install command. The install command will copy all relevant sources into the bin, lib, include folders respectively.

utelle commented 1 year ago

Since I I have only limited experience with CMake, I will have to find out, how to do that. This will take some time.

On Linux like platforms you can use the autoconf/automake toolchain for which the install target is supported.

jammerxd commented 1 year ago

I'll try to make a PR that contains a prototype - it's actually really easy.

utelle commented 1 year ago

Great. TIA.

taozuhong commented 1 year ago

https://github.com/msys2/MINGW-packages/pull/18442

Maybe the PR could fix this build issue too. @jammerxd @utelle

jammerxd commented 1 year ago

@taozuhong I don't think so since that uses make, not cmake. make uses makefiles. CMake uses CMakeLists

taozuhong commented 1 year ago

The make script failed, so it must change the right method.

utelle commented 1 year ago

msys2/MINGW-packages#18442

Maybe the PR could fix this build issue too. @jammerxd @utelle

It is unclear in which respect this PR should fix anything for CMake support in SQLite3 Multiple Ciphers. It's certainly nice for MinGW users if a pre-compiled package is availabe. However, the package is built using the autoconf/automake toolchain. This has nothing to do with CMake.

@taozuhong I don't think so since that uses make, not cmake. make uses makefiles. CMake uses CMakeLists

The task here is to enhance CMakeLists.txt so that installing the compiled component is supported. We are not talking about providing pre-compiled packages.

The make script failed, so it must change the right method.

Well, the CI runs of your PR all fail, because you use the undefined configure option --disable-shell. The autoconf/automake build files coming with SQLite3 Multiple Ciphers currently do not support such an option, they always build the shell executable, but do not install it.

taozuhong commented 1 year ago
 configure: creating ./config.status
  config.status: creating Makefile
  config.status: creating sqlite3mc.pc
  config.status: executing depfiles commands
  config.status: executing libtool commands
  make: *** No rule to make target 'src/sqlite3shell.rc', needed by 'src/sqlite3shell.res_o'.  Stop.
  make: *** Waiting for unfinished jobs....
  ==> ERROR: A failure occurred in build().
      Aborting...
  ==> Removing installed dependencies...
  checking dependencies...

Update build script with your suggestion, failed again. @utelle

utelle commented 1 year ago
 configure: creating ./config.status
  config.status: creating Makefile
  config.status: creating sqlite3mc.pc
  config.status: executing depfiles commands
  config.status: executing libtool commands
  make: *** No rule to make target 'src/sqlite3shell.rc', needed by 'src/sqlite3shell.res_o'.  Stop.
  make: *** Waiting for unfinished jobs....
  ==> ERROR: A failure occurred in build().
      Aborting...
  ==> Removing installed dependencies...
  checking dependencies...

Update build script with your suggestion, failed again. @utelle

It seems you have discovered a glitch in the autoconf/automake build files of SQLite3 Multiple Ciphers. At first glance I thought that the symbol USE_MSW is not defined, but actually it is defined in your case. The resource compiler is also found, as can be seen from the configure output

checking for x86_64-w64-mingw32-windres... no checking for windres... windres

However, the resource file (used on Windows platforms) has a different name than given in Makefile.am - namely sqlite3mc_shell.rc instead of sqlite3shell.rc.

I will have to fix this. Personally, I never used the autoconf/automake build files under Windows. Therefore this glitch went undetected for such a long time.

If USE_MSW is defined (as is the case for you) It could be that it is also necessary to add sqlite3mc.rc to the source files of the library itself. And probably it is also necessary to remove the additional link libraries (-ldl -lm).

All the above needs to be tested and confirmed, before I can make a new release including the fixes.

taozuhong commented 1 year ago

I'll be happy to test the new release, thank you awfully for your great work.

utelle commented 1 year ago

Commit f612997889916b89becfbfaf41f0101ca6a0736b includes - hopefully - all necessary changes.

taozuhong commented 1 year ago

I've tried the build process, it could produce the sqlite3shell.exe, yet the sqlite3mc library

../configure    ## produce sqlite3shell.exe
../configure --enable-static --enable-shared   ## produce sqlite3shell.exe, yet the library

image

utelle commented 12 months ago

I've tried the build process, it could produce the sqlite3shell.exe, yet the sqlite3mc library

Actually, the shell and the library were built - as can be seen from the existence of the file libsqlite3mc.la in your directory listing. At first glance this seems to be a bit confusing, but the build process uses libtool. The file libsqlite3mc.la contains all necessary information for libtool about the associated libraries and shared objects. Actually, the files are located in subdirectory .libs. That is, you can see them by entering the command ls .libs in the build directory.

taozuhong commented 12 months ago

I found them in the .libs, maybe the output directory should be libs or current directory: image

utelle commented 12 months ago

I found them in the .libs, maybe the output directory should be libs or current directory:

No. This is how libtool works.

taozuhong commented 12 months ago

please release a new version, then I'll update and submit the mingw package, thanks.

utelle commented 12 months ago

please release a new version, then I'll update and submit the mingw package, thanks.

I will try to make a new release within a couple of days.

utelle commented 12 months ago

Version 1.7.1 is now available.

utelle commented 10 months ago

Commit https://github.com/utelle/SQLite3MultipleCiphers/commit/2c7a517cb48750d6530dd2af359824460ae1d4e2 adds CMake install support thanks to @Myroendan.