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:
parent
e220a32713
commit
36c4e9d170
@ -1,29 +1,11 @@
|
|||||||
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)
|
||||||
endif()
|
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
|
## Sources
|
||||||
set(serial_SRCS
|
set(serial_SRCS
|
||||||
src/serial.cc
|
src/serial.cc
|
||||||
@ -54,7 +36,7 @@ else()
|
|||||||
target_link_libraries(${PROJECT_NAME} setupapi)
|
target_link_libraries(${PROJECT_NAME} setupapi)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
## Uncomment for example
|
## Add example project
|
||||||
add_executable(serial_example examples/serial_example.cc)
|
add_executable(serial_example examples/serial_example.cc)
|
||||||
add_dependencies(serial_example ${PROJECT_NAME})
|
add_dependencies(serial_example ${PROJECT_NAME})
|
||||||
target_link_libraries(serial_example ${PROJECT_NAME})
|
target_link_libraries(serial_example ${PROJECT_NAME})
|
||||||
@ -62,17 +44,34 @@ target_link_libraries(serial_example ${PROJECT_NAME})
|
|||||||
## Include headers
|
## Include headers
|
||||||
include_directories(include)
|
include_directories(include)
|
||||||
|
|
||||||
|
## Install
|
||||||
|
set(INSTALL_LIB_DIR lib)
|
||||||
|
set(INSTALL_INCLUDE_DIR include)
|
||||||
|
set(INSTALL_CMAKE_DIR share/serial/cmake)
|
||||||
|
|
||||||
## Install executable
|
## Install executable
|
||||||
install(TARGETS ${PROJECT_NAME}
|
install(TARGETS ${PROJECT_NAME}
|
||||||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
DESTINATION ${INSTALL_LIB_DIR}
|
||||||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
EXPORT ${PROJECT_NAME}-targets
|
||||||
)
|
)
|
||||||
|
|
||||||
## 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 ${INSTALL_INCLUDE_DIR}/serial)
|
||||||
|
|
||||||
|
## Install CMake files
|
||||||
|
install(EXPORT ${PROJECT_NAME}-targets DESTINATION ${INSTALL_CMAKE_DIR})
|
||||||
|
|
||||||
|
include(CMakePackageConfigHelpers)
|
||||||
|
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Version.cmake
|
||||||
|
VERSION 1.2.1
|
||||||
|
COMPATIBILITY AnyNewerVersion)
|
||||||
|
|
||||||
|
install(FILES ${CMAKE_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Version.cmake
|
||||||
|
DESTINATION ${INSTALL_CMAKE_DIR})
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
if(CATKIN_ENABLE_TESTING)
|
# FIXME
|
||||||
add_subdirectory(tests)
|
#if(CATKIN_ENABLE_TESTING)
|
||||||
endif()
|
# add_subdirectory(tests)
|
||||||
|
#endif()
|
||||||
|
|||||||
14
cmake/serialConfig.cmake
Normal file
14
cmake/serialConfig.cmake
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# Usage:
|
||||||
|
#
|
||||||
|
# find_package(serial REQUIRED)
|
||||||
|
# include_directories(${serial_INCLUDE_DIRS})
|
||||||
|
# target_link_libraries(<target> serial)
|
||||||
|
|
||||||
|
if(serial_CONFIG_INCLUDED)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
set(serial_CONFIG_INCLUDED TRUE)
|
||||||
|
|
||||||
|
get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
|
include(${SELF_DIR}/serial-targets.cmake)
|
||||||
|
get_filename_component(serial_INCLUDE_DIRS "${SELF_DIR}/../../../include" ABSOLUTE)
|
||||||
24
package.xml
24
package.xml
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<package>
|
|
||||||
<name>serial</name>
|
|
||||||
<version>1.2.1</version>
|
|
||||||
<description>
|
|
||||||
Serial is a cross-platform, simple to use library for using serial ports on computers. This library provides a C++, object oriented interface for interacting with RS-232 like devices on Linux and Windows.
|
|
||||||
</description>
|
|
||||||
|
|
||||||
<maintainer email="william@osrfoundation.org">William Woodall</maintainer>
|
|
||||||
|
|
||||||
<license>MIT</license>
|
|
||||||
|
|
||||||
<url type="website">http://wjwwood.github.com/serial/</url>
|
|
||||||
<url type="repository">https://github.com/wjwwood/serial</url>
|
|
||||||
<url type="bugtracker">https://github.com/wjwwood/serial/issues</url>
|
|
||||||
|
|
||||||
<author email="wjwwood@gmail.com">William Woodall</author>
|
|
||||||
<author email="ash.gti@gmail.com">John Harrison</author>
|
|
||||||
|
|
||||||
<buildtool_depend>catkin</buildtool_depend>
|
|
||||||
|
|
||||||
<test_depend>boost</test_depend>
|
|
||||||
|
|
||||||
</package>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user