42 lines
1.0 KiB
CMake
42 lines
1.0 KiB
CMake
cmake_minimum_required(VERSION 3.28)
|
|
project(sdrpi-fpv-control)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
option(ENABLE_GROUND_BUILD "Enable build ground station" OFF)
|
|
option(ENABLE_AIR_BUILD "Enable build air" ON)
|
|
|
|
if (ENABLE_GROUND_BUILD)
|
|
message("Enabled ground build!")
|
|
# Настройки для Windows
|
|
if(WIN32)
|
|
add_definitions(-DWIN32_LEAN_AND_MEAN)
|
|
set(EXTRA_LIBS ws2_32)
|
|
if (MSVC)
|
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
|
endif()
|
|
endif()
|
|
|
|
find_package(SDL2 REQUIRED)
|
|
include_directories(${SDL2_INCLUDE_DIRS})
|
|
|
|
add_executable(${PROJECT_NAME}-ground
|
|
ground/joystick-reader.cpp
|
|
ground/joystick-reader.h
|
|
ground/main.cpp
|
|
ground/udp-driver.cpp
|
|
ground/udp-driver.h
|
|
)
|
|
|
|
target_link_libraries(${PROJECT_NAME}-ground ${SDL2_LIBRARIES} ${EXTRA_LIBS})
|
|
endif()
|
|
|
|
if (ENABLE_AIR_BUILD)
|
|
message("Enabled air build!")
|
|
|
|
add_executable(${PROJECT_NAME}-air
|
|
air/main.cpp
|
|
)
|
|
endif()
|
|
|