mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 11:44:53 +08:00
added an option 'DISABLE_CATKIN'
This commit is contained in:
parent
69e0372cf0
commit
bd95ae952b
@ -1,8 +1,13 @@
|
|||||||
cmake_minimum_required(VERSION 2.8.3)
|
cmake_minimum_required(VERSION 2.8.3)
|
||||||
project(serial)
|
project(serial)
|
||||||
|
|
||||||
|
option(DISABLE_CATKIN OFF "disables catkin")
|
||||||
|
|
||||||
# Find catkin
|
# Find catkin
|
||||||
|
if(NOT DISABLE_CATKIN)
|
||||||
find_package(catkin REQUIRED)
|
find_package(catkin REQUIRED)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
find_library(IOKIT_LIBRARY IOKit)
|
find_library(IOKIT_LIBRARY IOKit)
|
||||||
@ -13,17 +18,21 @@ if(UNIX AND NOT APPLE)
|
|||||||
# If Linux, add rt and pthread
|
# If Linux, add rt and pthread
|
||||||
set(rt_LIBRARIES rt)
|
set(rt_LIBRARIES rt)
|
||||||
set(pthread_LIBRARIES pthread)
|
set(pthread_LIBRARIES pthread)
|
||||||
|
if(NOT DISABLE_CATKIN)
|
||||||
catkin_package(
|
catkin_package(
|
||||||
LIBRARIES ${PROJECT_NAME}
|
LIBRARIES ${PROJECT_NAME}
|
||||||
INCLUDE_DIRS include
|
INCLUDE_DIRS include
|
||||||
DEPENDS rt pthread
|
DEPENDS rt pthread
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
# Otherwise normal call
|
# Otherwise normal call
|
||||||
|
if(NOT DISABLE_CATKIN)
|
||||||
catkin_package(
|
catkin_package(
|
||||||
LIBRARIES ${PROJECT_NAME}
|
LIBRARIES ${PROJECT_NAME}
|
||||||
INCLUDE_DIRS include
|
INCLUDE_DIRS include
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
## Sources
|
## Sources
|
||||||
@ -63,7 +72,7 @@ target_link_libraries(serial_example ${PROJECT_NAME})
|
|||||||
|
|
||||||
## Include headers
|
## Include headers
|
||||||
include_directories(include)
|
include_directories(include)
|
||||||
|
if(NOT DISABLE_CATKIN)
|
||||||
## Install executable
|
## Install executable
|
||||||
install(TARGETS ${PROJECT_NAME}
|
install(TARGETS ${PROJECT_NAME}
|
||||||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||||
@ -74,6 +83,7 @@ install(TARGETS ${PROJECT_NAME}
|
|||||||
## Install headers
|
## Install headers
|
||||||
install(FILES include/serial/serial.h include/serial/v8stdint.h
|
install(FILES include/serial/serial.h include/serial/v8stdint.h
|
||||||
DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}/serial)
|
DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}/serial)
|
||||||
|
endif()
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
if(CATKIN_ENABLE_TESTING)
|
if(CATKIN_ENABLE_TESTING)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user