summarylogtreecommitdiffstats
path: root/CMakeLists.txt
blob: d7d70cb1f417f1b8b322ffbd8e81054fdaf758f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# taken from https://github.com/wjwwood/serial/issues/52#issuecomment-28848337
cmake_minimum_required(VERSION 2.8.3)
project(my_project)

include_directories(include)

set(serial_SRCS src/serial.cc include/serial/serial.h include/serial/v8stdint.h)
if(UNIX)
    list(APPEND serial_SRCS src/impl/unix.cc)
else()
    list(APPEND serial_SRCS src/impl/win.cc)
endif()

## Add serial library
add_library(serial SHARED ${serial_SRCS})
if(UNIX AND NOT APPLE)
    target_link_libraries(serial rt)
endif()

## Build your executable
#add_executable(my_program src/my_program.cpp)
## Link your executable against the library
#target_link_libraries(my_program serial)

install(TARGETS serial DESTINATION lib)
install(FILES include/serial/serial.h DESTINATION include/serial)
install(FILES include/serial/v8stdint.h DESTINATION include/serial)