1
0
mirror of https://github.com/wjwwood/serial.git synced 2026-01-23 04:04:54 +08:00

Remove catkin dependency

This commit is contained in:
Richard Hozák 2021-03-10 15:38:02 +01:00
parent cbcca7c837
commit 1fc8df707a

View File

@ -1,9 +1,6 @@
cmake_minimum_required(VERSION 2.8.3) cmake_minimum_required(VERSION 2.8.3)
project(serial) project(serial)
# Find catkin
find_package(catkin REQUIRED)
if(APPLE) if(APPLE)
find_library(IOKIT_LIBRARY IOKit) find_library(IOKIT_LIBRARY IOKit)
find_library(FOUNDATION_LIBRARY Foundation) find_library(FOUNDATION_LIBRARY Foundation)
@ -13,17 +10,6 @@ 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)
catkin_package(
LIBRARIES ${PROJECT_NAME}
INCLUDE_DIRS include
DEPENDS rt pthread
)
else()
# Otherwise normal call
catkin_package(
LIBRARIES ${PROJECT_NAME}
INCLUDE_DIRS include
)
endif() endif()
## Sources ## Sources
@ -56,26 +42,4 @@ else()
target_link_libraries(${PROJECT_NAME} setupapi) target_link_libraries(${PROJECT_NAME} setupapi)
endif() endif()
## Uncomment for example target_include_directories(${PROJECT_NAME} PUBLIC include)
add_executable(serial_example examples/serial_example.cc)
add_dependencies(serial_example ${PROJECT_NAME})
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}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_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()