Advertisement
130s

ROS_OSX_ros_comm_CMakeLists.txt_11Dec31

Dec 31st, 2011
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. cmake_minimum_required(VERSION 2.4.6)
  2. include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
  3.  
  4. # Append to CPACK_SOURCE_IGNORE_FILES a semicolon-separated list of
  5. # directories (or patterns, but directories should suffice) that should
  6. # be excluded from the distro. This is not the place to put things that
  7. # should be ignored everywhere, like "build" directories; that happens in
  8. # rosbuild/rosbuild.cmake. Here should be listed packages that aren't
  9. # ready for inclusion in a distro.
  10. #
  11. # This list is combined with the list in rosbuild/rosbuild.cmake. Note
  12. # that CMake 2.6 may be required to ensure that the two lists are combined
  13. # properly. CMake 2.4 seems to have unpredictable scoping rules for such
  14. # variables.
  15. #list(APPEND CPACK_SOURCE_IGNORE_FILES /core/experimental)
  16.  
  17. #rosbuild_make_distribution(1.6.6)
  18.  
  19. if(ROSBUILD)
  20. include(rosbuild.cmake)
  21. return()
  22. endif()
  23.  
  24. cmake_minimum_required(VERSION 2.4.6)
  25. include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
  26. set(ROS_BUILD_TYPE RelWithDebInfo)
  27.  
  28. #set(ROS_BUILD_TYPE Debug)
  29.  
  30. rosbuild_init()
  31.  
  32. # See ticket: https://code.ros.org/trac/ros/ticket/3626
  33. # On mac use g++-4.2
  34. IF(${CMAKE_SYSTEM} MATCHES "Darwin-11.*")
  35. IF(EXISTS "/usr/bin/g++-4.2")
  36. set(CMAKE_CXX_COMPILER /usr/bin/g++-4.2)
  37. ELSE(EXISTS "/usr/bin/g++-4.2")
  38. # If there is no g++-4.2 use clang++
  39. set(CMAKE_CXX_COMPILER /usr/bin/clang++)
  40. ENDIF(EXISTS "/usr/bin/g++-4.2")
  41. ENDIF(${CMAKE_SYSTEM} MATCHES "Darwin-11.*")
  42.  
  43. include_directories(include/rosconsole)
  44. set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
  45.  
  46. rosbuild_add_boost_directories()
  47.  
  48. rosbuild_add_library(${PROJECT_NAME} src/rosconsole/rosconsole.cpp)
  49. target_link_libraries(${PROJECT_NAME} log4cxx)
  50. rosbuild_link_boost(${PROJECT_NAME} thread regex)
  51.  
  52. rosbuild_add_executable(example examples/example.cpp)
  53. target_link_libraries(example ${PROJECT_NAME})
  54. # static libraries all need to be called for mingw.
  55. if(MINGW)
  56. rosbuild_link_boost(example thread regex)
  57. target_link_libraries(example log4cxx aprutil-1 expat apr-1 rpcrt4 shell32 ws2_32 advapi32 kernel32 msvcrt)
  58. endif()
  59. set_target_properties(example PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/examples)
  60.  
  61. rosbuild_add_gtest(test/utest test/utest.cpp)
  62. target_link_libraries(test/utest ${PROJECT_NAME})
  63.  
  64. if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
  65. rosbuild_add_gtest(test/assertion_test test/assertion_test.cpp)
  66. target_link_libraries(test/assertion_test ${PROJECT_NAME})
  67. endif(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
  68.  
  69. rosbuild_add_gtest(test/thread_test test/thread_test.cpp)
  70. target_link_libraries(test/thread_test ${PROJECT_NAME})
  71.  
  72. #rosbuild_add_executable(speed_test test/speed_test.cpp)
  73. #target_link_libraries(speed_test ${PROJECT_NAME})
  74. #set_target_properties(speed_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/test)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement