0
$\begingroup$

Rosanswers logo

Hi. I've a c++ project where I'm using CMakeList with the structure similar to:

Project (inside my ros sandbox)
|
|_Folder1
|___some code
|___CMakeLists.txt
|
|_Folder2
|___some code
|___CMakeLists.txt
|
|_ROS package folder
|___some code
|___CMakeLists.txt
|
|_CMakeLists.txt

Inside de main CMakeLists.txt I've something similar to:

add_subdirectory(recruiter)

add_library(something_static STATIC ${RECRUITER_SOURCES})

Where inside "recruiter" directory is the ROS package, created using "roscreate-pkg".

And I'm getting the following error:

[rosbuild] Error from directory check: /opt/ros/groovy/share/ros/core/rosbuild/bin/check_same_directories.py /opt/ros/groovy/stacks/test/noderecruiter 1 Traceback (most recent call last): File "/opt/ros/groovy/share/ros/core/rosbuild/bin/check_same_directories.py", line 46, in raise Exception Exception CMake Error at /opt/ros/groovy/share/ros/core/rosbuild/private.cmake:102 (message): [rosbuild] rospack found package "test" at "", but the current directory is "/opt/ros/groovy/stacks/test/noderecruiter". You should double-check your ROS_PACKAGE_PATH to ensure that packages are found in the correct precedence order. Call Stack (most recent call first): /opt/ros/groovy/share/ros/core/rosbuild/public.cmake:177 (_rosbuild_check_package_location) server/noderecruiter/CMakeLists.txt:12 (rosbuild_init)

-- Configuring incomplete, errors occurred!

What's happening? THanks.


Originally posted by Verane on ROS Answers with karma: 25 on 2013-06-24

Post score: 0


Original comments

Comment by dornhege on 2013-06-24:
Are you building with catkin? I think ROS/catkin needs the toplevel.cmake to work.

Comment by Verane on 2013-06-24:
No, I would like to build like a normal project.

Comment by allenh1 on 2013-06-24:
Could you please post your CMakeLists.txt file in full? It would be good to see the context of your build output.

Comment by Verane on 2013-06-25:
What CMakeLists do you want? The file inside the main project or the ros one?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

ROS packages are not designed to simply be included inside CMake packages. This is not a supported use case.


Originally posted by tfoote with karma: 58457 on 2013-08-12

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.