diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 2e137c19..1e397998 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -2,13 +2,16 @@ if(OPENVR_LIBRARIES AND NOT USE_SINGLE_PRECISION) add_subdirectory(openvr_driver) endif() -find_package(catkin QUIET COMPONENTS - roscpp - geometry_msgs) +get_property(survive_in_catkin_make GLOBAL PROPERTY SURVIVE_IN_CATKIN_MAKE) -IF(catkin_DIR) - add_subdirectory(ros_publisher) -ENDIF() +if(NOT survive_in_catkin_make) + find_package(catkin QUIET COMPONENTS + roscpp + geometry_msgs) + IF(catkin_DIR) + add_subdirectory(ros_publisher) + ENDIF() +endif() find_library(XDO_LIB xdo) if(XDO_LIB) diff --git a/tools/ros_publisher/CMakeLists.txt b/tools/ros_publisher/CMakeLists.txt index c35237d3..c293bd8e 100644 --- a/tools/ros_publisher/CMakeLists.txt +++ b/tools/ros_publisher/CMakeLists.txt @@ -1,6 +1,8 @@ project(survive_publisher) +cmake_minimum_required(VERSION 3.12) -add_compile_options(-std=c++14) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) if(NOT TARGET survive) message("Adding base cmake...") @@ -8,7 +10,7 @@ if(NOT TARGET survive) add_subdirectory(../../ survive_build) endif() -find_package(catkin REQUIRED COMPONENTS +find_package(catkin REQUIRED COMPONENTS roscpp geometry_msgs tf ) @@ -16,6 +18,22 @@ find_package(catkin REQUIRED COMPONENTS ## System dependencies are found with CMake's conventions # find_package(Boost REQUIRED COMPONENTS system) +################################### +## catkin specific configuration ## +################################### +## The catkin_package macro generates cmake config files for your package +## Declare things to be passed to dependent projects +## INCLUDE_DIRS: uncomment this if your package contains header files +## LIBRARIES: libraries you create in this project that dependent projects also need +## CATKIN_DEPENDS: catkin_packages dependent projects also need +## DEPENDS: system dependencies of this project that dependent projects also need +catkin_package( +# INCLUDE_DIRS include +# LIBRARIES survive_publisher +# CATKIN_DEPENDS other_catkin_pkg +# DEPENDS system_lib +) + ########### ## Build ## ########### @@ -26,7 +44,7 @@ message( ${catkin_INCLUDE_DIRS} ) include_directories( ${catkin_INCLUDE_DIRS} ../../include - ../../redist + ../../redist ) link_directories(../../lib) @@ -52,22 +70,6 @@ target_link_libraries(${PROJECT_NAME}_node survive ) -################################### -## catkin specific configuration ## -################################### -## The catkin_package macro generates cmake config files for your package -## Declare things to be passed to dependent projects -## INCLUDE_DIRS: uncomment this if your package contains header files -## LIBRARIES: libraries you create in this project that dependent projects also need -## CATKIN_DEPENDS: catkin_packages dependent projects also need -## DEPENDS: system dependencies of this project that dependent projects also need -catkin_package( -# INCLUDE_DIRS include -# LIBRARIES survive_publisher -# CATKIN_DEPENDS other_catkin_pkg -# DEPENDS system_lib -) - ## Mark executables and/or libraries for installation install(TARGETS ${PROJECT_NAME}_node ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}