mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 19:54:57 +08:00
Updating ROS make system.
This commit is contained in:
parent
f81268fdf0
commit
760784e730
@ -209,7 +209,7 @@ class SerialListenerException : public std::exception {
|
|||||||
const std::string e_what_;
|
const std::string e_what_;
|
||||||
public:
|
public:
|
||||||
SerialListenerException(const std::string e_what) : e_what_(e_what) {}
|
SerialListenerException(const std::string e_what) : e_what_(e_what) {}
|
||||||
~SerialListenerException() throw() {std::exception::~exception();}
|
~SerialListenerException() throw() {}
|
||||||
|
|
||||||
virtual const char* what() const throw() {
|
virtual const char* what() const throw() {
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
|
|||||||
@ -17,20 +17,29 @@ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
|
|||||||
#set the default path for built libraries to the "lib" directory
|
#set the default path for built libraries to the "lib" directory
|
||||||
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
|
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
|
||||||
|
|
||||||
# Check for OS X and if so disable kqueue support in asio
|
include_directories(include)
|
||||||
IF(CMAKE_SYSTEM_NAME MATCHES Darwin)
|
|
||||||
add_definitions(-DBOOST_ASIO_DISABLE_KQUEUE)
|
set(SERIAL_SRCS src/serial.cc)
|
||||||
ENDIF(CMAKE_SYSTEM_NAME MATCHES Darwin)
|
if(UNIX)
|
||||||
|
list(APPEND SERIAL_SRCS src/impl/unix.cc)
|
||||||
|
else(UNIX)
|
||||||
|
list(APPEND SERIAL_SRCS src/impl/windows.cc)
|
||||||
|
endif(UNIX)
|
||||||
|
list(APPEND SERIAL_SRCS src/serial_listener.cc)
|
||||||
|
|
||||||
# Build the serial library
|
# Build the serial library
|
||||||
rosbuild_add_library(${PROJECT_NAME} src/serial.cpp include/serial/serial.h)
|
rosbuild_add_library(${PROJECT_NAME} ${SERIAL_SRCS})
|
||||||
|
|
||||||
# Add boost dependencies
|
# Add boost dependencies
|
||||||
rosbuild_add_boost_directories()
|
rosbuild_add_boost_directories()
|
||||||
rosbuild_link_boost(${PROJECT_NAME} system filesystem thread)
|
rosbuild_link_boost(${PROJECT_NAME} system filesystem thread)
|
||||||
|
|
||||||
# Build example
|
# Build example
|
||||||
rosbuild_add_executable(serial_example examples/serial_example.cpp)
|
rosbuild_add_executable(serial_example examples/serial_example.cc)
|
||||||
target_link_libraries(serial_example ${PROJECT_NAME})
|
target_link_libraries(serial_example ${PROJECT_NAME})
|
||||||
|
|
||||||
|
rosbuild_add_executable(serial_listener_example
|
||||||
|
examples/serial_listener_example.cc)
|
||||||
|
target_link_libraries(serial_listener_example ${PROJECT_NAME})
|
||||||
|
|
||||||
endmacro(build_serial)
|
endmacro(build_serial)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user