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

Ability to build survive_publisher using catkin #309

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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: 9 additions & 6 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
40 changes: 21 additions & 19 deletions tools/ros_publisher/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
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...")
set_property(GLOBAL PROPERTY SURVIVE_IN_CATKIN_MAKE On)
add_subdirectory(../../ survive_build)
endif()

find_package(catkin REQUIRED COMPONENTS
find_package(catkin REQUIRED COMPONENTS
roscpp
geometry_msgs tf
)

## 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 ##
###########
Expand All @@ -26,7 +44,7 @@ message( ${catkin_INCLUDE_DIRS} )
include_directories(
${catkin_INCLUDE_DIRS}
../../include
../../redist
../../redist
)

link_directories(../../lib)
Expand All @@ -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}
Expand Down