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

Build without catkin with BUILD_WITH_CATKIN=OFF

see also 7cd3de4742
This commit is contained in:
Tomaz Solc 2015-01-06 14:35:01 +01:00 committed by Doug Johnston
parent c57285f30a
commit daa675f463
2 changed files with 24 additions and 13 deletions

View File

@ -2,26 +2,34 @@ cmake_minimum_required(VERSION 2.8.3)
project(serial)
# Find catkin
find_package(catkin REQUIRED)
option(BUILD_WITH_CATKIN "Build using catkin" ON)
if(BUILD_WITH_CATKIN)
find_package(catkin REQUIRED)
endif()
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
)
if(catkin_FOUND)
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()
else()
# Otherwise normal call
catkin_package(
LIBRARIES ${PROJECT_NAME}
INCLUDE_DIRS include
)
set(CATKIN_PACKAGE_LIB_DESTINATION lib)
set(CATKIN_GLOBAL_INCLUDE_DESTINATION include)
endif()
## Sources

View File

@ -22,6 +22,9 @@ API Documentation: http://wjwwood.github.com/serial/doc/1.1.0/index.html
* [empy](http://www.alcyone.com/pyos/empy/) - Python templating library
* [catkin_pkg](http://pypi.python.org/pypi/catkin_pkg/) - Runtime Python library for catkin
Basic build and install without catkin is possible by appending
`CMAKE_FLAGS=-DBUILD_WITH_CATKIN=OFF` to `make` commands below.
### Install
Get the code: