[odb-users] CMake FindModule for ODB
timo at rothenpieler.org
Thu Aug 28 12:29:59 EDT 2014
I was in need of a CMake module for ODB, but didn't find the existing
ones sufficient, as they completely lack any functionality to locate the
odb libraries and headers.
So i wrote one, loosely based on the existing one from the wiki.
As this might be usefull for other people, i uploaded it, together with
an example, to my Github:
A short documentation on the variables the find module defines is in the
header of the Find module:
To use it, all that needs to be done is:
OPTIONAL_COMPONENTS mysql sqlite)
After that it sets OSB_QT_FOUND, ODB_MYSQL_FOUND and ODB_SQLITE_FOUND to
true, if it found the said components.
ODB_LIBRARIES contains all neccessary libs for the requested and found
components, ODB_INCLUDE_DIRS the include directories.
Those are also defined for each requested component and for the libodb
core library in individual variables.
The UseODB file defines the odb_compile function, which takes headers as
input and calls the odb cli util on them to create the odb code.
It appends the list of generated sources that need compiling to the
variable it got as its fist argument.
See the example CMakeLists.txt for an example on how to use it:
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 473 bytes
Desc: OpenPGP digital signature
Url : http://codesynthesis.com/pipermail/odb-users/attachments/20140828/8cc998cc/signature.pgp
More information about the odb-users