-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (36 loc) · 1.06 KB
/
CMakeLists.txt
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
cmake_minimum_required(VERSION 2.6)
project(pilot-base)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC -pthread")
add_compile_options(-DNOGDI)
file(GLOB GENERATED_SOURCE_FILES generated/src/*.cpp)
if(WIN32)
list(APPEND PLATFORM_SOURCE_FILES
src/win32/SerialPort.cpp
src/win32/CAN_PeakUSB.cpp
)
else()
list(APPEND PLATFORM_SOURCE_FILES
src/linux/SerialPort.cpp
src/linux/CAN_Socket.cpp
)
endif()
add_library(pilot_base SHARED
${GENERATED_SOURCE_FILES}
${PLATFORM_SOURCE_FILES}
src/SerialPort.cpp
src/CAN_Frame.cpp
src/CAN_Proxy.cpp
src/UDP_Socket.cpp
src/NetworkStream.cpp
)
target_include_directories(pilot_base PUBLIC include generated/include)
target_link_libraries(pilot_base vnx_base)
if(WIN32)
target_link_libraries(pilot_base ws2_32)
endif()
install(DIRECTORY include/ DESTINATION include)
install(DIRECTORY generated/include/ DESTINATION include)
install(DIRECTORY modules/ DESTINATION interface/pilot/base)
install(DIRECTORY interface/ DESTINATION interface/pilot/base)
install(TARGETS pilot_base DESTINATION lib)
add_subdirectory(canopen)