Ask Your Question
0

Cmake Project to Catkin

asked 2015-09-15 04:57:54 -0600

JanOr gravatar image

updated 2015-09-15 04:58:21 -0600

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-09-15 11:25:48 -0600

ahendrix gravatar image

Have a look at CMake's add_subdirectory command: http://www.cmake.org/cmake/help/v3.0/... ; it should allow you to write a top-level CMakeLists that invokes the existing cmake files.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2015-09-15 04:57:54 -0600

Seen: 287 times

Last updated: Sep 15 '15