Skip to content

Commit

Permalink
find TinyXML using cmake_modules (fix #24)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Apr 14, 2014
1 parent 6c68078 commit 2e813f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
18 changes: 6 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
cmake_minimum_required(VERSION 2.8.3)
project(rospack)

find_package(catkin REQUIRED)
find_package(catkin REQUIRED COMPONENTS cmake_modules)
find_package(Boost REQUIRED COMPONENTS filesystem program_options system)
set(PythonLibs_FIND_VERSION "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
find_package(PythonLibs REQUIRED)
find_package(tinyxml QUIET)
if(NOT tinyxml_FOUND)
# Just assume it's located in the system directories
# though you could try and detect stuff via the pkgconfig file
# it provides
set(tinyxml_LIBRARIES tinyxml)
endif()
find_package(TinyXML REQUIRED)

catkin_package(
INCLUDE_DIRS include
LIBRARIES rospack tinyxml ${PYTHON_LIBRARIES}
DEPENDS Boost
LIBRARIES rospack ${PYTHON_LIBRARIES}
DEPENDS Boost TinyXML
)

#add_definitions(-Wall)
Expand All @@ -27,15 +21,15 @@ if(API_BACKCOMPAT_V1)
set(backcompat_source src/rospack_backcompat.cpp)
endif()

include_directories(include ${tinyxml_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})
include_directories(include ${TinyXML_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})

add_library(rospack
src/rospack.cpp
${backcompat_source}
src/rospack_cmdline.cpp
src/utils.cpp
)
target_link_libraries(rospack ${tinyxml_LIBRARIES} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
target_link_libraries(rospack ${TinyXML_LIBRARIES} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})

add_executable(rospackexe src/rospack_main.cpp)
# Set the name, and make it a "global" executable
Expand Down
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<buildtool_depend version_gte="0.5.68">catkin</buildtool_depend>

<build_depend>boost</build_depend>
<build_depend>cmake_modules</build_depend>
<build_depend>gtest</build_depend>
<build_depend>pkg-config</build_depend>
<build_depend>python</build_depend>
Expand Down

0 comments on commit 2e813f2

Please # to comment.