samedi 21 février 2015

Use SQLite with biicode

So far I have been able to succesfully use boost, cereal and gtest using biicode but I am having troubles with sqlite. I am trying to use it doing the following:



#include <sqlite3.h>


So I edited my biicode.conf to include those lines, including the alising for the header:



[requirements]
sqlite/sqlite:9
[includes]
sqlite.h: sqlite/sqlite/sqlite3/sqlite3.h


But when I try to call bii cpp:build it does the following



WARN: Removing unused reference to "sqlite/sqlite: 9" from myuser/test "requirements"


Then I ended up with the expected:



database_impl.cpp:(.text+0x516): undefined reference to `sqlite3_exec'


Surprisingly, the compilation succedd even though sqlite3.h is obviously not included but that's maybe because the call to sqlite is from a template function.


I have looked at the example but CMakeList.txt does not seem to add any additional includes directories. For example for boost I had to add:



SET(Boost_USE_STATIC_LIBS OFF)
bii_find_boost(COMPONENTS chrono system filesystem log thread REQUIRED)

target_include_directories(${BII_BLOCK_TARGET} INTERFACE ${Boost_INCLUDE_DIRS})
target_link_libraries(${BII_BLOCK_TARGET} INTERFACE ${Boost_LIBRARIES})


But the two examples I found here and here don't seem to add anything to the includes directories, not even a link folder. I suppose sqlite has to be compiled with your sources so how do I make biicode add those files to my projects automatically ?


Aucun commentaire:

Enregistrer un commentaire