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

Panayiotis Georgiou ps.georgiou at gmail.com
Mon Apr 24 10:57:36 EDT 2017


Hello,

I was able to detect the correct paths with CMake for ODB and it's
components by including the following in my CMakeLists.txt

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
#includes FindODB.cmake and UseODB.cmake
list(APPEND CMAKE_PREFIX_PATH "${ODB_ROOT}")
list(APPEND CMAKE_PREFIX_PATH "${ODB_ROOT}/libodb-2.4.0")
list(APPEND CMAKE_PREFIX_PATH "${ODB_ROOT}/libodb-sqlite-2.4.0")
list(APPEND CMAKE_PREFIX_PATH "${ODB_ROOT}/libodb-boost-2.4.0")
list(APPEND CMAKE_PREFIX_PATH "${ODB_ROOT}/libodb-pgsql-2.4.0")
list(APPEND CMAKE_PREFIX_PATH "${ODB_ROOT}/libodb-qt-2.4.0")

Note that I am using windows with MSVC 2015 so from what I understand
PkgConfig does not exist on windows.

I have also included at the beginning of FindODB.cmake the following:

set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)

so that CMake can automatically detect the correct paths for 64bit
libraries. This automatically appends the "64" suffix to paths, so that
 lib, bin become lib64 and bin64 in the detected paths.

The problem that I am currently facing is that when I switch from Release
to Debug within MSVC, Visual Studio is unable to link the correct debug
libraries. How can I change the cmake files so that the correct debug
libraries are selected when switching to debug build?

Thanks a lot.



On Mon, Apr 10, 2017 at 5:54 PM, Boris Kolpackov <boris at codesynthesis.com>
wrote:

> Hi Mikhail,
>
> Mikhail Komarov <s02130359 at stud.cs.msu.ru> writes:
>
> > Boris, what do you think of creating a branch with CMake-based build
> > system in every Codesynthesis ODB-related repository?
>
> I am, personally, not a big fan of CMake (to put it mildly) and am
> working on a build toolchain, build2[1], that will hopefully end this
> nightmare.
>
> Having said that, I realize that there are quite a few people who like
> CMake and who would prefer it over build2, potentially for a long
> time/forever.
>
> So my position regarding adding CMake support to ODB is this (which,
> I think, is "strict but fair" ;-)):
>
> 1. Someone needs to explicitly and seriously commit to not only implement
>    complete CMake support, but to also maintain it for the foreseeable
>    future.
>
> 2. The support must be complete, including all the tests (odb-tests) for
>    all the supported databases and major platform/compiler combinations.
>
> 3. As soon as there is a slight hint that CMake support is being neglected,
>    it will be removed.
>
> I realize that I am asking a lot and this is not very "contributor
> friendly", but I don't really have any bandwidth (nor desire) to
> end up maintain CMake support in ODB.
>
> [1] https://build2.org
>
> Boris
>
>


More information about the odb-users mailing list