Unverified Commit 956bfabf authored by Guilhem Saurel's avatar Guilhem Saurel Committed by GitHub
Browse files

Merge pull request #13 from nim65s/devel

[CMake] assume ROS 1 by default
parents 33ae8c78 0d117c6c
Pipeline #16968 passed with stage
in 24 seconds
include: http://rainboard.laas.fr/project/dynamic-graph-bridge-msgs/.gitlab-ci.yml
include: http://rainboard.laas.fr/project/dynamic_graph_bridge_msgs/.gitlab-ci.yml
......@@ -5,17 +5,16 @@ set(PROJECT_NAME dynamic_graph_bridge_msgs)
set(PROJECT_DESCRIPTION "Dynamic graph bridge msgs ")
set(PROJECT_URL "https://github.com/${PROJECT_ORG}/${PROJECT_NAME}")
if(DEFINED ENV{ROS_VERSION} )
if(DEFINED ENV{ROS_VERSION})
set(ROS_VERSION $ENV{ROS_VERSION})
else()
set(ROS_VERSION 1)
endif()
if ($ENV{ROS_VERSION} EQUAL 1) # if ROS1
if(ROS_VERSION EQUAL 1) # if ROS1
# Here we use the jrl-cmakemodules to package things properly.
set(CUSTOM_HEADER_DIR dynamic_graph_bridge_msgs)
if(DEFINED ENV{ROS_VERSION} )
# ROS-1
if ($ENV{ROS_VERSION} EQUAL 1)
set(PROJECT_USE_CMAKE_EXPORT TRUE)
endif()
endif()
include(cmake/base.cmake)
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX C)
......@@ -39,9 +38,8 @@ if(DEFINED ENV{ROS_VERSION} )
add_library(${PROJECT_NAME} INTERFACE)
install(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
install(FILES package.xml DESTINATION share/${PROJECT_NAME})
else() # if ROS2
else() # if ROS2
# Here ament is doing things ok.
project(${PROJECT_NAME})
......@@ -55,13 +53,14 @@ if(DEFINED ENV{ROS_VERSION} )
"srv/RunPythonCommand.srv"
"srv/RunPythonFile.srv"
)
install(FILES package.xml DESTINATION share/${PROJECT_NAME})
ament_export_dependencies(rosidl_default_runtime)
ament_package()
endif()
endif()
install(FILES package.xml DESTINATION share/${PROJECT_NAME})
if(BUILD_TESTING)
if ($ENV{ROS_VERSION} EQUAL 1) # if ROS-1
if(BUILD_TESTING)
if(ROS_VERSION EQUAL 1) # if ROS1
find_package(rostest REQUIRED)
add_rostest(tests/ros1/unit_test_ros.test)
else() # if ROS-2
......@@ -79,6 +78,4 @@ if(DEFINED ENV{ROS_VERSION} )
"PYTHONPATH=${CMAKE_BINARY_DIR}/rosidl_generator_py/:${CMAKE_BINARY_DIR}:$ENV{PYTHONPATH}"
)
endif()
endif() # BUILD_TESTING
endif()
endif() # BUILD_TESTING
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment