Skip to content

Commit

Permalink
added WITH_ROS patch to default CMakeLists
Browse files Browse the repository at this point in the history
  • Loading branch information
Armin Hornung committed Jul 22, 2011
1 parent 8e6781a commit 69bf2f6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT( OctoMap )
PROJECT( octomap )

# version (e.g. for packaging)
set(OCTOMAP_MAJOR_VERSION 1)
Expand All @@ -14,6 +14,17 @@ endif(COMMAND cmake_policy)
# COMPILER SETTINGS (default: Release) and flags
INCLUDE(CMakeModules/CompilerSettings.cmake)

#If we are compiling with ROS support, we need to get the appropriate includes and link flags and such
if(WITH_ROS)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
set(ROSBUILD_DONT_REDEFINE_PROJECT true)
set(PROJECT_SOURCE_DIR_BACKUP ${PROJECT_SOURCE_DIR})
set(PROJECT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../..")
rosbuild_init()
set(PROJECT_SOURCE_DIR ${PROJECT_SOURCE_DIR_BACKUP})
add_definitions(-DOCTOMAP_ROS)
endif(WITH_ROS)

# Set output directories for libraries and executables
SET( BASE_DIR ${CMAKE_SOURCE_DIR} )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BASE_DIR}/lib )
Expand Down

0 comments on commit 69bf2f6

Please sign in to comment.