SQLiteCpp icon indicating copy to clipboard operation
SQLiteCpp copied to clipboard

Using as part of another project

Open poldi171254 opened this issue 6 years ago • 5 comments

CMakeLists.txt Still trying to get this to 'work' with embedding the source code; maybe I'm barking up the wrong tree.

I have built SQLiteCpp and have SQLiteCpp include directory under "kdedev/include" and libSQLiteCpp.a under "kdedev/lib/x86_64-linux-gnu".

I don't want/extect to (re)build the library from the other project. I just need the headers and the library.

My CMakeList.txt is attached.

cmake works, but when I try the make, the include files aren't found. What am I missing. Thanks

poldi171254 avatar Jan 07 '20 02:01 poldi171254

Mm, I never try to use libs in this way, always using either the installed lib or full source.

So I am not sure of what would be wrong with your usage of find_path & target_include_directories Perhaps could you try with the simplest form (just to be sure)

include_directories("${SQLITEINC}")

Also, are you using latest version of the master branch?

SRombauts avatar Jan 12 '20 21:01 SRombauts

Let me know if you have tried with latest update on master, I have a user using the SQLiteCpp has an installed lib successfully now

SRombauts avatar Jan 13 '20 21:01 SRombauts

The attached CMakeLists.txt file does what I needed. I tested it with your SQLiteCpp_Exmplle

CMakeLists.txt

This assumes the staic library is in /usr/local/lib and the incldes are in /usr/include

Thanks for your help Leo

poldi171254 avatar Jan 13 '20 23:01 poldi171254

Thanks for providing the CMakeLists.txt. I'll leave this open for a while, in the hope I'll get to use this in a testing script.

SRombauts avatar Jan 14 '20 12:01 SRombauts

The easiest way to test this (in Ubuntu) is to

Build SQLiteCpp Install in a standard directory (/usr/include /usr/lib) Clone https://github.com/SRombauts/SQLiteCpp_Example.git Replace the CMakeLists.txt with mine Modify the exe target to match the test Build and Test

Should all work. Cheers, Leo

poldi171254 avatar Jan 14 '20 23:01 poldi171254