[odb-users] Using CMake for ODB (libraries forlder structre)

Timo Rothenpieler timo at rothenpieler.org
Mon Apr 10 12:23:04 EDT 2017


See the provided example in that very repository.
You need to add the directory that contains the two .cmake files to your 
CMAKE_MODULE_PATH.

In case of the example:
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")

There is no requirement for that path, it can be whatever you like.
For finding the library, it needs to be in

The module uses pkg-config to find odb itself. So if your pkg config 
path is properly set up, there is nothing special you need to do.


Am 10.04.2017 um 18:10 schrieb Panayiotis Georgiou:
> Hello,
> 
> I am trying to generate an MSVC project using ODB, with the help of the
> cmake scripts provided by Timo Rothenpieler at:
>     https://github.com/BtbN/OdbCmake
> 
> The issue I am having is that I cannot understand from the cmake scripts
> provide what is the expected folder structure, and as a result, cmake is
> unable to locate the necessary paths.
> 
> The folder structure that I am currently using is as follows:
> 
> ../ExternalLibraries/ODB/cmake/Modules (includes FindODB.cmake,
> UseODB.cmake)
> ../ExternalLibraries/ODB/libodb-2.4.0   (subfolders: bin, bin64, config,
> lib, lib64, m4, odb )
> ../ExternalLibraries/ODB/libodb-boost-2.4.0 (subfolders: bin, bin64,
> config, lib, lib64, m4, odb )
> ../ExternalLibraries/ODB/libodb-pgsql-2.4.0  (subfolders: bin, bin64,
> config, lib, lib64, m4, odb )
> ../ExternalLibraries/ODB/libodb-qt-2.4.0   (subfolders: bin, bin64, config,
> lib, lib64, m4, odb )
> ../ExternalLibraries/ODB/libodb-sqlite-2.4.0  (subfolders: bin, bin64,
> config, etc, lib, lib64, m4, odb )
> ../ExternalLibraries/ODB/odb-2.4.0-i686-windows (subfolders: bin, doc, etc,
> man, mingw)
> 
> Using the above folder structure cmake is unable to configure ODB. I have
> tried adding the path "../ExternalLibraries/ODB/libodb-2.4.0" in the
> variables CMAKE_PREFIX_PATH and ODB_LIBRARY_PATH but did not help.
> 
> Can someone please help me in setting up the appropriate folder structure
> so that ODB is detected, or let me know if I am doing something else wrong?
> 
> Thanks a lot.
> PG
> 



More information about the odb-users mailing list