-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
56 lines (45 loc) · 1.65 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
cmake_minimum_required(VERSION 3.16)
project("AOGTaskController")
set(BUILD_EXAMPLES OFF)
set(BUILD_TESTING OFF)
if(WIN32)
set(CAN_DRIVER "WindowsPCANBasic")
list(APPEND CAN_DRIVER "TouCAN")
list(APPEND CAN_DRIVER "WindowsInnoMakerUSB2CAN")
list(APPEND CAN_DRIVER "SYS_TEC")
elseif(APPLE)
set(CAN_DRIVER "MacCANPCAN")
else()
set(CAN_DRIVER "SocketCAN")
endif()
list(APPEND CAN_DRIVER "NTCAN")
include(FetchContent)
set(BOOST_INCLUDE_LIBRARIES asio)
set(BOOST_ENABLE_CMAKE ON)
FetchContent_Declare(
Boost
URL https://github.com/boostorg/boost/releases/download/boost-1.86.0/boost-1.86.0-cmake.7z
DOWNLOAD_NO_EXTRACT FALSE
USES_TERMINAL_DOWNLOAD TRUE DOWNLOAD_EXTRACT_TIMESTAMP TRUE)
FetchContent_MakeAvailable(Boost)
FetchContent_Declare(
isobus
GIT_REPOSITORY https://github.com/Open-Agriculture/AgIsoStack-plus-plus.git
GIT_TAG 58686f401282d34b8f15a704a82798222083ca3f
DOWNLOAD_EXTRACT_TIMESTAMP TRUE)
FetchContent_MakeAvailable(isobus)
FetchContent_Declare(
json
URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
FetchContent_MakeAvailable(json)
find_package(Threads REQUIRED)
file(GLOB_RECURSE SRC_FILES ${CMAKE_CURRENT_LIST_DIR}/src/*.cpp)
add_executable(AOGTaskController ${SRC_FILES})
target_compile_features(AOGTaskController PUBLIC cxx_std_20)
set_target_properties(AOGTaskController PROPERTIES CXX_EXTENSIONS OFF)
target_include_directories(AOGTaskController
PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include)
target_link_libraries(
AOGTaskController
PRIVATE isobus::Isobus isobus::HardwareIntegration Threads::Threads
isobus::Utility Boost::asio nlohmann_json::nlohmann_json)