mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 19:54:57 +08:00
Merge 50f4f2bc6eca1194df6c21f39fd31837064f3cca into 827c4a784dd4fdd35dc391f37ef152eab7c9c9b2
This commit is contained in:
commit
742f879a4b
@ -1,29 +1,13 @@
|
||||
cmake_minimum_required(VERSION 2.8.3)
|
||||
project(serial)
|
||||
|
||||
# Find catkin
|
||||
find_package(catkin REQUIRED)
|
||||
option(USE_CATKIN "Use Catkin for packaging" ON)
|
||||
|
||||
if(APPLE)
|
||||
find_library(IOKIT_LIBRARY IOKit)
|
||||
find_library(FOUNDATION_LIBRARY Foundation)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
# If Linux, add rt and pthread
|
||||
catkin_package(
|
||||
LIBRARIES ${PROJECT_NAME}
|
||||
INCLUDE_DIRS include
|
||||
DEPENDS rt pthread
|
||||
)
|
||||
else()
|
||||
# Otherwise normal call
|
||||
catkin_package(
|
||||
LIBRARIES ${PROJECT_NAME}
|
||||
INCLUDE_DIRS include
|
||||
)
|
||||
endif()
|
||||
|
||||
## Sources
|
||||
set(serial_SRCS
|
||||
src/serial.cc
|
||||
@ -62,17 +46,47 @@ target_link_libraries(serial_example ${PROJECT_NAME})
|
||||
## Include headers
|
||||
include_directories(include)
|
||||
|
||||
## Install executable
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||
)
|
||||
if(USE_CATKIN)
|
||||
# Find catkin
|
||||
find_package(catkin REQUIRED)
|
||||
|
||||
## Install headers
|
||||
install(FILES include/serial/serial.h include/serial/v8stdint.h
|
||||
DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}/serial)
|
||||
if(UNIX AND NOT APPLE)
|
||||
# If Linux, add rt and pthread
|
||||
catkin_package(
|
||||
LIBRARIES ${PROJECT_NAME}
|
||||
INCLUDE_DIRS include
|
||||
DEPENDS rt pthread
|
||||
)
|
||||
else()
|
||||
# Otherwise normal call
|
||||
catkin_package(
|
||||
LIBRARIES ${PROJECT_NAME}
|
||||
INCLUDE_DIRS include
|
||||
)
|
||||
endif()
|
||||
|
||||
## Tests
|
||||
if(CATKIN_ENABLE_TESTING)
|
||||
add_subdirectory(tests)
|
||||
## Install executable
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||
)
|
||||
|
||||
## Install headers
|
||||
install(FILES include/serial/serial.h include/serial/v8stdint.h
|
||||
DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}/serial)
|
||||
|
||||
## Tests
|
||||
if(CATKIN_ENABLE_TESTING)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
else()
|
||||
## Install executable
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
)
|
||||
|
||||
## Install headers
|
||||
install(FILES include/serial/serial.h include/serial/v8stdint.h
|
||||
DESTINATION include/serial)
|
||||
endif()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user