]> Git Repo - serial.git/blobdiff - CMakeLists.txt
Make Release|Win32 configuration compile
[serial.git] / CMakeLists.txt
index 8f4f1670934f7427c1fc2013381da64f464f5b95..696aac06d24b141ea414724c1a7be42b8fa65883 100644 (file)
@@ -4,6 +4,11 @@ project(serial)
 # Find catkin
 find_package(catkin REQUIRED)
 
+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(
@@ -25,19 +30,25 @@ set(serial_SRCS
     include/serial/serial.h
     include/serial/v8stdint.h
 )
-if(UNIX)
+if(APPLE)
+       # If OSX
+       list(APPEND serial_SRCS src/impl/unix.cc)
+       list(APPEND serial_SRCS src/impl/list_ports/list_ports_osx.cc)
+elseif(UNIX)
     # If unix
     list(APPEND serial_SRCS src/impl/unix.cc)
     list(APPEND serial_SRCS src/impl/list_ports/list_ports_linux.cc)
-else()
+elseif()
     # If windows
     list(APPEND serial_SRCS src/impl/win.cc)
 endif()
 
 ## Add serial library
 add_library(${PROJECT_NAME} ${serial_SRCS})
-if(UNIX AND NOT APPLE)
-    target_link_libraries(${PROJECT_NAME} rt)
+if(APPLE)
+       target_link_libraries(${PROJECT_NAME} ${FOUNDATION_LIBRARY} ${IOKIT_LIBRARY})
+elseif(UNIX)
+       target_link_libraries(${PROJECT_NAME} rt pthread)
 endif()
 
 ## Uncomment for example
This page took 0.021018 seconds and 4 git commands to generate.