Gazebo | Ignition | Community
Ask Your Question

'CMAKE_SOURCE_DIR’ was not declared in this scope

asked 2016-05-13 06:55:33 -0600

Rodrigo gravatar image

Hi, I'm trying to compile gazebo but I get the following error:

[ 85%] Building CXX object test/integration/CMakeFiles/INTEGRATION_model_editor_undo.dir/
/home/user/source/gazebo/test/integration/ In member function ‘void ModelEditorUndoTest::NestedModelInsertionByMouse()’:
/home/user/source/gazebo/test/integration/ error: ‘CMAKE_SOURCE_DIR’ was not declared in this scope
   CMAKE_SOURCE_DIR "/test/models/testdb");
/home/user/source/gazebo/test/integration/ In member function ‘void ModelEditorUndoTest::JointInsertionByDialog()’:
/home/user/source/gazebo/test/integration/ error: ‘CMAKE_SOURCE_DIR’ was not declared in this scope
   CMAKE_SOURCE_DIR "/test/models/testdb");
test/integration/CMakeFiles/INTEGRATION_model_editor_undo.dir/build.make:120: recipe for target 'test/integration/CMakeFiles/INTEGRATION_model_editor_undo.dir/' failed
make[2]: *** [test/integration/CMakeFiles/INTEGRATION_model_editor_undo.dir/] Error 1
CMakeFiles/Makefile2:10323: recipe for target 'test/integration/CMakeFiles/INTEGRATION_model_editor_undo.dir/all' failed
make[1]: *** [test/integration/CMakeFiles/INTEGRATION_model_editor_undo.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

Any idea what may be causing it?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2016-05-13 11:03:21 -0600

chapulina gravatar image

It looks like the problem was introduced in this pull request. Some possible ways to fix it:

  • Clean your build directory and build again from scratch

  • Disable tests compilation, with cmake ../ -DENABLE_TESTS_COMPILATION:BOOL=False

  • Build the latest stable release branch, gazebo7 (do hg up gazebo7)

edit flag offensive delete link more


I can successfully build it without tests, still I was wondering what was wrong with the default compilations. Thank you for your input on the issue.

Rodrigo gravatar imageRodrigo ( 2016-05-13 12:37:50 -0600 )edit

This shouldn't be happening, disabling the tests is just a temporary workaround. What platform are you in?

chapulina gravatar imagechapulina ( 2016-05-13 12:44:04 -0600 )edit

I'm on archlinux x64, gcc 6.1.1. That gcc version gave me a lot of trouble, so it may be related (e.g, I had to recompile boost with that version in order for it to link with sdformat).

Rodrigo gravatar imageRodrigo ( 2016-05-13 13:02:26 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-05-13 06:55:33 -0600

Seen: 710 times

Last updated: May 13 '16