Hi all,
I'm trying to include OCE as a subproject into a larger cmake-based project (with other subprojects that depend on OCE), so that the whole thing can be built via cmake in one go. I'm wondering whether this is expected to work and if someone has done it yet (and if yes, how).
In theory it could be as simply as doing
add_subdirectory(oce)
in the top-level cmake file. This does seem to work insofar as OCE is being built, but then the other subprojects do not find the OCE include files. To overcome this I tried
include_directories(oce/inc)
but this does not seem to catch all headers, since some of them seem to be found only in subdirs of oce/src. When installing OCE, all the headers are properly put into the installation directory, but I want to do an integrated build of OCE together with other libraries without having to install it first.
Another thing that might be supposed to work is:
find_package(OCE PATHS ${CMAKE_CURRENT_BINARY_DIR}/oce)
The problem with this is that the build directory contains only OCEconfig.cmake, but not OCE-libraries.cmake (which is referenced in the former), so that I get errors like:
CMake Error at build/oce/OCEConfig.cmake:23 (include):
include could not find load file:
~/myproject/build/oce/OCE-libraries.cmake
Any ideas how to solve these problems are highly appreciated.
Note: I also found an older post in this mailing list on the same topic (
https://groups.google.com/forum/#!topic/oce-dev/TM_xlePKFmo), which sounds like what I'm trying to do is supposed to work, but it does not give any details on how to accomplish it.
Best regards,
Janus