cpp_client_telemetry icon indicating copy to clipboard operation
cpp_client_telemetry copied to clipboard

use `find_packages` in cmake files to for shared lib build

Open yulin-li opened this issue 3 years ago • 9 comments

yulin-li avatar Jan 13 '23 09:01 yulin-li

@yulin-li The build script already supports building shared library for 1ds as here.

So, something like this should work:

$ export CMAKE_OPTS='-DBUILD_SHARED_LIBS=ON'
$ ./build-tests.sh release

lalitb avatar Jan 20 '23 23:01 lalitb

@yulin-li The build script already supports building shared library for 1ds as here.

So, something like this should work:

$ export CMAKE_OPTS='-DBUILD_SHARED_LIBS=ON'
$ ./build-tests.sh release

oh thanks, let me revert the changes in build-test.sh. I think it's still worth to keep the find_package updates.

yulin-li avatar Jan 21 '23 08:01 yulin-li

oh thanks, let me revert the changes in build-test.sh. I think it's still worth to keep the find_package updates.

This would be a problem if we install sqlite3 from (say) apt package manager. As "sqlite3" or "sqlite3-dev" package installed through it doesn't seem to include a CMake package config file. Do you see issue without find_package, as the build will eventually fail anyway if sqlite3 is not installed ?

# dpkg-query -L  libsqlite3-dev:amd64
/.
/usr
/usr/include
/usr/include/sqlite3.h
/usr/include/sqlite3ext.h
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libsqlite3.a
/usr/lib/x86_64-linux-gnu/libsqlite3.la
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/sqlite3.pc
/usr/share
/usr/share/doc
/usr/share/doc/libsqlite3-dev
/usr/share/doc/libsqlite3-dev/copyright
/usr/lib/x86_64-linux-gnu/libsqlite3.so
/usr/share/doc/libsqlite3-dev/changelog.Debian.gz

# dpkg-query -L   libsqlite3-0:amd64
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
/usr/share
/usr/share/doc
/usr/share/doc/libsqlite3-0
/usr/share/doc/libsqlite3-0/README.Debian
/usr/share/doc/libsqlite3-0/changelog.Debian.gz
/usr/share/doc/libsqlite3-0/copyright
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0

# dpkg-query -L sqlite3
/.
/usr
/usr/bin
/usr/bin/sqldiff
/usr/bin/sqlite3
/usr/share
/usr/share/doc
/usr/share/doc/sqlite3
/usr/share/doc/sqlite3/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/sqldiff.1.gz
/usr/share/man/man1/sqlite3.1.gz
/usr/share/doc/sqlite3/changelog.Debian.gz

lalitb avatar Jan 23 '23 19:01 lalitb

@yulin-li - let us know if the PR is still valid ?

lalitb avatar Jan 31 '23 07:01 lalitb

CMAKE_OPTS='-DBUILD_SHARED_LIBS=ON'

sorry for this very late reply. The camke configurations is actually provided by cmake (https://github.com/Kitware/CMake/blob/master/Modules/FindSQLite3.cmake), not sqlite3 package.

The problem without find_packages is, we cannot use sqlite3 installed by package managers, we need to install a duplicated one in /usr/local/lib/

yulin-li avatar Mar 03 '24 05:03 yulin-li

**lalitb ** c

@lalitb this PR is still valid, which allows us to use sqlite3 libs installed by package managers.

yulin-li avatar Mar 03 '24 05:03 yulin-li