Skip to content

Commit

Permalink
Merge pull request ros#41 from ros/osx_fix
Browse files Browse the repository at this point in the history
Pass along LOG4CXX include dirs and libraries
  • Loading branch information
dirk-thomas committed Dec 30, 2012
2 parents 5dcb2aa + 34a2cfd commit 903a105
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions tools/rosconsole/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
cmake_minimum_required(VERSION 2.8.3)
project(rosconsole)

find_package(catkin REQUIRED COMPONENTS cpp_common rostime rosunit)

find_package(Log4cxx QUIET)
if(NOT LOG4CXX_LIBRARIES)
# backup plan, hope it is in the system path
find_library(LOG4CXX_LIBRARIES log4cxx)
endif()
if(NOT LOG4CXX_LIBRARIES)
message(FATAL_ERROR "Couldn't find log4cxx library")
endif()

find_package(Boost COMPONENTS regex thread)

include(cmake/rosconsole-extras.cmake)

catkin_package(
INCLUDE_DIRS include
LIBRARIES rosconsole
INCLUDE_DIRS include ${Boost_INCLUDE_DIRS} ${LOG4CXX_INCLUDE_DIRS}
LIBRARIES rosconsole ${Boost_LIBRARIES} ${LOG4CXX_LIBRARIES}
CATKIN_DEPENDS cpp_common rostime
CFG_EXTRAS rosconsole-extras.cmake
)

include(cmake/rosconsole-extras.cmake)

# See ticket: https://code.ros.org/trac/ros/ticket/3626
# On mac use g++-4.2
IF(${CMAKE_SYSTEM} MATCHES "Darwin-11.*")
Expand All @@ -23,21 +36,10 @@ ENDIF(${CMAKE_SYSTEM} MATCHES "Darwin-11.*")

include_directories(${catkin_INCLUDE_DIRS})

find_package(Boost COMPONENTS regex thread)

include_directories(include ${Boost_INCLUDE_DIR})
include_directories(include ${Boost_INCLUDE_DIRS} ${LOG4CXX_INCLUDE_DIRS})

add_library(rosconsole src/rosconsole/rosconsole.cpp)

find_package(Log4cxx QUIET)
if(NOT LOG4CXX_LIBRARIES)
# backup plan, hope it is in the system path
find_library(LOG4CXX_LIBRARIES log4cxx)
endif()
if(NOT LOG4CXX_LIBRARIES)
message(FATAL_ERROR "Couldn't find log4cxx library")
endif()

target_link_libraries(rosconsole ${catkin_LIBRARIES} ${LOG4CXX_LIBRARIES} ${Boost_LIBRARIES})

if(CMAKE_HOST_UNIX)
Expand Down

0 comments on commit 903a105

Please sign in to comment.