-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
89 lines (76 loc) · 2.71 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
cmake_minimum_required(VERSION 2.8...3.16)
project(Test_devices)
option(_DEBUG "_DEBUG" OFF)
option(_DEBUG_DISPLAY "_DEBUG_DISPLAY" OFF)
option(_DEBUG_MESSAGES "_DEBUG_MESSAGES" OFF)
option(_DEBUG_WARNINGS "_DEBUG_WARNINGS" OFF)
if(APPLE)
option(USE_OLD_CHRONO "USE_OLD_CHRONO" ON)
option(ENABLE_COMPUTERI2CBUS_SUPPORT "ENABLE_COMPUTERI2CBUS_SUPPORT" OFF)
else()
option(USE_OLD_CHRONO "USE_OLD_CHRONO" OFF)
option(ENABLE_COMPUTERI2CBUS_SUPPORT "ENABLE_COMPUTERI2CBUS_SUPPORT" ON)
endif()
mark_as_advanced(_DEBUG _DEBUG_DISPLAY _DEBUG_MESSAGES _DEBUG_WARNINGS ENABLE_COMPUTERI2CBUS_SUPPORT)
if(_DEBUG)
add_definitions(-D _DEBUG)
endif()
if(_DEBUG_DISPLAY)
add_definitions(-D _DEBUG_DISPLAY)
endif()
if(_DEBUG_MESSAGES)
add_definitions(-D _DEBUG_MESSAGES)
endif()
if(_DEBUG_WARNINGS)
add_definitions(-D _DEBUG_WARNINGS)
endif()
if(USE_OLD_CHRONO)
add_definitions(-D USE_OLD_CHRONO)
endif()
add_definitions(-D DISABLE_THREADS_OSNET)
add_definitions(-D SIMULATED_INTERNET_SWARMONDEVICE)
add_definitions(-D DISABLE_AIS_SUPPORT)
add_definitions(-D ENABLE_DEFAULT_SAVE_RAW_DATA_MDM)
add_definitions(-D DISABLE_HOKUYOTHREAD)
add_definitions(-D DISABLE_IM483ITHREAD)
add_definitions(-D DISABLE_MDMTHREAD)
add_definitions(-D DISABLE_MESTHREAD)
add_definitions(-D DISABLE_MINISSCTHREAD)
add_definitions(-D DISABLE_MS5837THREAD)
add_definitions(-D DISABLE_MTTHREAD)
add_definitions(-D DISABLE_NMEADEVICETHREAD)
add_definitions(-D DISABLE_P33XTHREAD)
add_definitions(-D DISABLE_PATHFINDERDVLTHREAD)
add_definitions(-D DISABLE_POLOLUTHREAD)
add_definitions(-D DISABLE_RAZORAHRSTHREAD)
add_definitions(-D DISABLE_ROBOTEQTHREAD)
add_definitions(-D DISABLE_RPLIDARTHREAD)
add_definitions(-D DISABLE_SBGTHREAD)
add_definitions(-D DISABLE_SEANETTHREAD)
add_definitions(-D DISABLE_SSC32THREAD)
add_definitions(-D DISABLE_SWARMONDEVICETHREAD)
add_definitions(-D DISABLE_UBLOXTHREAD)
add_definitions(-D DISABLE_VELODYNETHREAD)
if(ENABLE_COMPUTERI2CBUS_SUPPORT)
add_definitions(-D ENABLE_COMPUTERI2CBUS_SUPPORT)
endif()
add_executable(Test_devices Main.cpp OSTime.c OSNet.c OSMisc.c OSCore.c)
if(WIN32)
if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
target_link_libraries(Test_devices WS2_32)
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unknown-pragmas -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unknown-pragmas -Wextra -fpermissive")
target_link_libraries(Test_devices WS2_32 m)
endif()
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unknown-pragmas -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unknown-pragmas -Wextra -fpermissive")
if(APPLE)
target_link_libraries(Test_devices m)
else()
target_link_libraries(Test_devices rt m)
endif()
endif()