Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Cmake Project to Catkin

I have the following folder structure of a pure cmake project:

 projectfolder/
 -  code/
          ...
 -  build/
          ...
 -  cmake/
          CompilerOptions.cmake 
          ...
 -  other/
          ...

which can be compiled by the following commands without problem:

$ cd build 
$ cmake ..
$ make

I would like to catkinize this package without interfering with its complex dependency structure. Basically build the package normally from the same root "/build" and than link the created libraries to the catkin libraries. Unfortunately when I use catkin_make the root of the cmake is changing. This can be seen as I get an cmake error for not finding CompilerOptions.cmake (which is in build). I tried to Set(CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/projectfolder), but without the desired behavior. How can I change the catkin_make path accordingly, if I have the structure:

catkinws/
-    build
-    devel
-    src/
             projectfolder/
             -  code/
                            ...
             -  build/
                            ...
             -  cmake/
                           CompilerOptions.cmake 
                           ...
             -  other/
                           ...

Thank you very much for your help.

Cmake Project to Catkin

Hey every one, I have the following folder structure of a pure cmake project:

 projectfolder/
 -  code/
          ...
 -  build/
          ...
 -  cmake/
          CompilerOptions.cmake 
          ...
 -  other/
          ...

which can be compiled by the following commands without problem:

$ cd build 
$ cmake ..
$ make

I would like to catkinize this package without interfering with its complex dependency structure. Basically build the package normally from the same root "/build" and than link the created libraries to the catkin libraries. Unfortunately when I use catkin_make the root of the cmake is changing. This can be seen as I get an cmake error for not finding CompilerOptions.cmake (which is in build). I tried to Set(CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/projectfolder), but without the desired behavior. How can I change the catkin_make path accordingly, if I have the structure:

catkinws/
-    build
-    devel
-    src/
             projectfolder/
             -  code/
                            ...
             -  build/
                            ...
             -  cmake/
                           CompilerOptions.cmake 
                           ...
             -  other/
                           ...

Thank you very much for your help.