diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ea1c80..ea61fc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,13 +11,13 @@ if(UNIX AND NOT APPLE) INCLUDE_DIRS include DEPENDS rt pthread ) -else () +else() # Otherwise normal call catkin_package( LIBRARIES ${PROJECT_NAME} INCLUDE_DIRS include ) -endif () +endif() ## Sources set(serial_SRCS @@ -25,7 +25,7 @@ set(serial_SRCS # include/serial/serial.h # include/serial/v8stdint.h ) -if (UNIX) +if(UNIX) # If unix list (APPEND serial_SRCS src/impl/unix.cc) else() @@ -34,10 +34,8 @@ else() endif() ## Add serial library -add_library(${PROJECT_NAME} - ${serial_SRCS} -) -if (UNIX) +add_library(${PROJECT_NAME} ${serial_SRCS}) +if(UNIX AND NOT APPLE) target_link_libraries(${PROJECT_NAME} rt) endif()