Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a more reliable method to select buildtool #67

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ cmake_minimum_required(VERSION 3.5)

PROJECT(plotjuggler_ros)

# http://answers.ros.org/question/230877/optionally-build-a-package-with-catkin/
if( CATKIN_DEVEL_PREFIX OR catkin_FOUND OR CATKIN_BUILD_BINARY_PACKAGE)
find_package(ament_cmake QUIET)
find_package(catkin QUIET)

if(catkin_FOUND)
set(COMPILING_WITH_CATKIN 1)

message(STATUS "---------------------------------------------------------------------")
Expand All @@ -28,9 +30,9 @@ if( CATKIN_DEVEL_PREFIX OR catkin_FOUND OR CATKIN_BUILD_BINARY_PACKAGE)
catkin_package(
CATKIN_DEPENDS ${ROS_DEPENDENCIES} )

elseif( DEFINED ENV{AMENT_PREFIX_PATH})
elseif(ament_cmake_FOUND)
set(COMPILING_WITH_AMENT 1)

message(STATUS "---------------------------------------------------------------------")
message(STATUS "PlotJuggler is being built using AMENT. ROS2 plugins will be compiled")
message(STATUS "---------------------------------------------------------------------")
Expand All @@ -53,7 +55,7 @@ elseif( DEFINED ENV{AMENT_PREFIX_PATH})
# find_package(pal_statistics_msgs REQUIRED)

else()
message(FATAL_ERROR "PlotJuggler is being WITHOUT any ROS support")
message(FATAL_ERROR "Cannot determine appropriate ROS build system")
endif()

cmake_policy (SET CMP0020 NEW)
Expand Down Expand Up @@ -135,7 +137,7 @@ elseif(COMPILING_WITH_AMENT)

install(DIRECTORY launch
DESTINATION share/${PROJECT_NAME})

else()
set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
Expand All @@ -149,4 +151,3 @@ add_subdirectory( plugins )
if(COMPILING_WITH_AMENT)
ament_package()
endif()