1 cmake_minimum_required(VERSION 2.8.3)
5 find_package(catkin REQUIRED)
8 find_library(IOKIT_LIBRARY IOKit)
9 find_library(FOUNDATION_LIBRARY Foundation)
12 if(UNIX AND NOT APPLE)
13 # If Linux, add rt and pthread
15 LIBRARIES ${PROJECT_NAME}
20 # Otherwise normal call
22 LIBRARIES ${PROJECT_NAME}
30 include/serial/serial.h
31 include/serial/v8stdint.h
35 list(APPEND serial_SRCS src/impl/unix.cc)
36 list(APPEND serial_SRCS src/impl/list_ports/list_ports_osx.cc)
39 list(APPEND serial_SRCS src/impl/unix.cc)
40 list(APPEND serial_SRCS src/impl/list_ports/list_ports_linux.cc)
43 list(APPEND serial_SRCS src/impl/win.cc)
47 add_library(${PROJECT_NAME} ${serial_SRCS})
49 target_link_libraries(${PROJECT_NAME} ${FOUNDATION_LIBRARY} ${IOKIT_LIBRARY})
51 target_link_libraries(${PROJECT_NAME} rt pthread)
54 ## Uncomment for example
55 add_executable(serial_example examples/serial_example.cc)
56 add_dependencies(serial_example ${PROJECT_NAME})
57 target_link_libraries(serial_example ${PROJECT_NAME})
60 include_directories(include)
63 install(TARGETS ${PROJECT_NAME}
64 ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
65 LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
69 install(FILES include/serial/serial.h include/serial/v8stdint.h
70 DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}/serial)
73 if(CATKIN_ENABLE_TESTING)
74 add_subdirectory(tests)