ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
![]() | 1 | initial version |
Standard CMake
cmake_minimum_required(VERSION 2.4.6) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) rosbuild_init() #set the default path for built executables to the "bin" directory set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) #set the default path for built libraries to the "lib" directory set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) #uncomment if you have defined messages rosbuild_genmsg() #uncomment if you have defined services #rosbuild_gensrv() rosbuild_add_executable(RaveServer src/RaveServer.cpp) rosbuild_add_executable(GenerateGoal src/generate_goal.cpp) rosbuild_add_library(MoveBase src/moveBase.cpp) rosbuild_add_library(LiveFeed src/live_feed.cpp)
Non standard CMake
cmake_minimum_required(VERSION 2.4.6) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) rosbuild_init() #set the default path for built executables to the "bin" directory set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) #set the default path for built libraries to the "lib" directory set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) #uncomment if you have defined messages rosbuild_genmsg() #uncomment if you have defined services #rosbuild_gensrv() execute_process(COMMAND openrave-config --cflags OUTPUT_VARIABLE OPENRAVE_CXX_FLAGS) execute_process(COMMAND openrave-config --libs-core OUTPUT_VARIABLE OPENRAVE_LINK_FLAGS) execute_process(COMMAND openrave-config --libs OUTPUT_VARIABLE OPENRAVE_LIB_FLAGS) execute_process(COMMAND openrave-config --prefix OUTPUT_VARIABLE OPENRAVE_PREFIX) #Set up - replace newlines ... faiiil!!! string(REGEX REPLACE "[\r\n]" "" OPENRAVE_CXX_FLAGS ${OPENRAVE_CXX_FLAGS}) string(REGEX REPLACE "[\r\n]" "" OPENRAVE_LINK_FLAGS ${OPENRAVE_LINK_FLAGS}) string(REGEX REPLACE "[\r\n]" "" OPENRAVE_LIB_FLAGS ${OPENRAVE_LIB_FLAGS}) string(REGEX REPLACE "[\r\n]" "" OPENRAVE_LIB_DIR "${OPENRAVE_PREFIX}/lib") rosbuild_add_executable(RaveServer src/RaveServer.cpp) rosbuild_add_executable(GenerateGoal src/generate_goal.cpp) rosbuild_add_library(MoveBase src/moveBase.cpp) rosbuild_add_library(LiveFeed src/live_feed.cpp) set_target_properties(RaveServer PROPERTIES COMPILE_FLAGS "${OPENRAVE_CXX_FLAGS}" LINK_FLAGS "${OPENRAVE_LINK_FLAGS}" INSTALL_RPATH "${OPENRAVE_LIB_DIR}") set_target_properties(MoveBase PROPERTIES COMPILE_FLAGS "${OPENRAVE_CXX_FLAGS}" LINK_FLAGS "${OPENRAVE_LIB_FLAGS}")
![]() | 2 | No.2 Revision |
I reduced my problem to differing CMakes. A standard CMakeLists.txt throws no segfault, while the non standard throws a segfault. (The non standard is used when openrave is not part of ros, but installed as a seperate library).
I am assuming that the only reason the standard CMake removes the segfault is because it compiles with debug flags, and I have a hunch the segfault is still there.
Standard CMake
cmake_minimum_required(VERSION 2.4.6) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) rosbuild_init() #set the default path for built executables to the "bin" directory set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) #set the default path for built libraries to the "lib" directory set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) #uncomment if you have defined messages rosbuild_genmsg() #uncomment if you have defined services #rosbuild_gensrv() rosbuild_add_executable(RaveServer src/RaveServer.cpp) rosbuild_add_executable(GenerateGoal src/generate_goal.cpp) rosbuild_add_library(MoveBase src/moveBase.cpp) rosbuild_add_library(LiveFeed src/live_feed.cpp)
Non standard CMake
cmake_minimum_required(VERSION 2.4.6) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) rosbuild_init() #set the default path for built executables to the "bin" directory set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) #set the default path for built libraries to the "lib" directory set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) #uncomment if you have defined messages rosbuild_genmsg() #uncomment if you have defined services #rosbuild_gensrv() execute_process(COMMAND openrave-config --cflags OUTPUT_VARIABLE OPENRAVE_CXX_FLAGS) execute_process(COMMAND openrave-config --libs-core OUTPUT_VARIABLE OPENRAVE_LINK_FLAGS) execute_process(COMMAND openrave-config --libs OUTPUT_VARIABLE OPENRAVE_LIB_FLAGS) execute_process(COMMAND openrave-config --prefix OUTPUT_VARIABLE OPENRAVE_PREFIX) #Set up - replace newlines ... faiiil!!! string(REGEX REPLACE "[\r\n]" "" OPENRAVE_CXX_FLAGS ${OPENRAVE_CXX_FLAGS}) string(REGEX REPLACE "[\r\n]" "" OPENRAVE_LINK_FLAGS ${OPENRAVE_LINK_FLAGS}) string(REGEX REPLACE "[\r\n]" "" OPENRAVE_LIB_FLAGS ${OPENRAVE_LIB_FLAGS}) string(REGEX REPLACE "[\r\n]" "" OPENRAVE_LIB_DIR "${OPENRAVE_PREFIX}/lib") rosbuild_add_executable(RaveServer src/RaveServer.cpp) rosbuild_add_executable(GenerateGoal src/generate_goal.cpp) rosbuild_add_library(MoveBase src/moveBase.cpp) rosbuild_add_library(LiveFeed src/live_feed.cpp) set_target_properties(RaveServer PROPERTIES COMPILE_FLAGS "${OPENRAVE_CXX_FLAGS}" LINK_FLAGS "${OPENRAVE_LINK_FLAGS}" INSTALL_RPATH "${OPENRAVE_LIB_DIR}") set_target_properties(MoveBase PROPERTIES COMPILE_FLAGS "${OPENRAVE_CXX_FLAGS}" LINK_FLAGS "${OPENRAVE_LIB_FLAGS}")