Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CMakeLists to support UTMSP CMake build #8

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ if (MOBILE)
)
endif ()

#######################################################
# UTMSP FLAG
#######################################################
if(CONFIG_UTM_ADAPTER)
add_definitions(-DCONFIG_UTM_ADAPTER)
endif()

#######################################################
# Test Setup
#######################################################
Expand Down
3 changes: 3 additions & 0 deletions src/MissionManager/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
if(CONFIG_UTM_ADAPTER)
add_definitions(-DCONFIG_UTM_ADAPTER)
endif()

set(EXTRA_SRC)
if(BUILD_TESTING)
Expand Down
3 changes: 3 additions & 0 deletions src/PlanView/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
if(CONFIG_UTM_ADAPTER)
add_definitions(-DCONFIG_UTM_ADAPTER)
endif()
add_custom_target(PlanViewQml
SOURCES
CameraCalcCamera.qml
Expand Down
4 changes: 4 additions & 0 deletions src/QmlControls/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if(CONFIG_UTM_ADAPTER)
add_definitions(-DCONFIG_UTM_ADAPTER)
endif()

add_library(QmlControls
AppMessages.cc
AppMessages.h
Expand Down
File renamed without changes.
97 changes: 72 additions & 25 deletions src/UTMSP/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,76 @@
find_package(Threads REQUIRED)
find_package(Boost REQUIRED COMPONENTS system thread)
find_package(OpenSSL REQUIRED)

if(CONFIG_UTM_ADAPTER)
message(STATUS "UTMSP is Initialized")

add_definitions(-DCONFIG_UTM_ADAPTER)
add_definitions(-DQT_DEBUG)

set(CMAKE_BUILD_TYPE Debug)
set(QGC_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../)
set(NLOHMANN_JSON_SOURCE_DIR "${QGC_ROOT_DIR}/libs/libevents/libevents/libs/cpp/parse/nlohmann_json")
set(NLOHMANN_JSON_BINARY_DIR "${CMAKE_BINARY_DIR}/nlohmann_json")

add_subdirectory(${NLOHMANN_JSON_SOURCE_DIR} ${NLOHMANN_JSON_BINARY_DIR})

message(STATUS "UTMSP: UTMSP is Initialized")

add_library(UTMSP
UTMSPRestInterface.cpp
UTMSPBlenderRestInterface.cpp
UTMSPAuthorization.cpp
UTMSPNetworkRemoteIDManager.cpp
UTMSPAircraft.cpp
UTMSPOperator.cpp
UTMSPFlightPlanManager.cpp
UTMSPServiceController.cpp
UTMSPVehicle.cpp
UTMSPManager.cpp
)
UTMSPRestInterface.h
UTMSPBlenderRestInterface.h
UTMSPAuthorization.h
UTMSPNetworkRemoteIDManager.h
UTMSPAircraft.h
UTMSPOperator.h
UTMSPFlightPlanManager.h
UTMSPServiceController.h
UTMSPVehicle.h
UTMSPManager.h
UTMSPFlightDetails.h
UTMSPRestInterface.cpp
UTMSPBlenderRestInterface.cpp
UTMSPAuthorization.cpp
UTMSPNetworkRemoteIDManager.cpp
UTMSPAircraft.cpp
UTMSPOperator.cpp
UTMSPFlightPlanManager.cpp
UTMSPServiceController.cpp
UTMSPVehicle.cpp
UTMSPManager.cpp
UTMSPFlightDetails.cpp
)

add_custom_target(UTMSPQml
SOURCES
UTMSPAdapterEditor.qml
UTMSPMapVisuals.qml
UTMSPActivationStatusBar.qml
UTMSPStateStorage.qml
)

target_include_directories(UTMSP PUBLIC
services
${QGC_ROOT_DIR}/libs/libevents/libevents/libs/cpp/parse/nlohmann_json/include
)

target_link_libraries(UTMSP

PRIVATE
libevents_parser
PUBLIC
Boost::system
Boost::thread
OpenSSL::SSL
OpenSSL::Crypto
nlohmann_json::nlohmann_json
Qt6::Core
Qt6::Location
Qt6::Widgets
Threads::Threads
qgc
)

else()
# If CONFIG_UTM_ADAPTER is not set, use utmsp_dummy.qrc
message(STATUS "UTMSP: Dummy is Initialized")
Expand All @@ -32,20 +81,18 @@ else()

target_include_directories(UTMSP PUBLIC dummy)

endif()
target_link_libraries(UTMSP

target_include_directories(UTMSP PUBLIC services )

target_link_libraries(UTMSP
PRIVATE
libevents_parser
PUBLIC
Qt6::Core
Qt6::Location
Qt6::Widgets
Threads::Threads
qgc
)

PRIVATE
libevents_parser
PUBLIC
Qt6::Core
Qt6::Location
Qt6::Widgets
Threads::Threads
qgc
)
endif()

target_include_directories(UTMSP INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
File renamed without changes.
2 changes: 1 addition & 1 deletion src/UTMSP/dummy/utmsp_dummy.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<qresource prefix="/qml">
<file alias="QGroundControl/UTMSP/UTMSPMapVisuals.qml">UTMSPMapVisuals.qml</file>
<file alias="QGroundControl/UTMSP/UTMSPAdapterEditor.qml">UTMSPAdapterEditor.qml</file>
<file alias="QGroundControl/UTMSP/qmldir">qmldir</file>
<file alias="QGroundControl/UTMSP/qmldir">QGroundControl.UTMSP.qmldir</file>
<file alias="QGroundControl/UTMSP/UTMSPActivationStatusBar.qml">UTMSPActivationStatusBar.qml</file>
<file alias="QGroundControl/UTMSP/UTMSPMapPolygonVisuals.qml">UTMSPMapPolygonVisuals.qml</file>
</qresource>
Expand Down
2 changes: 1 addition & 1 deletion src/UTMSP/utmsp.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<qresource prefix="/qml">
<file alias="QGroundControl/UTMSP/UTMSPAdapterEditor.qml">UTMSPAdapterEditor.qml</file>
<file alias="QGroundControl/UTMSP/UTMSPMapVisuals.qml">UTMSPMapVisuals.qml</file>
<file alias="QGroundControl/UTMSP/qmldir">qmldir</file>
<file alias="QGroundControl/UTMSP/qmldir">../QmlControls/QGroundControl/UTMSP/qmldir</file>
<file alias="QGroundControl/UTMSP/UTMSPMapPolygonVisuals.qml">UTMSPMapPolygonVisuals.qml</file>
<file alias="QGroundControl/UTMSP/UTMSPActivationStatusBar.qml">UTMSPActivationStatusBar.qml</file>
<file alias="QGroundControl/UTMSP/UTMSPStateStorage.qml">UTMSPStateStorage.qml</file>
Expand Down
4 changes: 3 additions & 1 deletion src/Vehicle/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

# if(CONFIG_UTM_ADAPTER)
# add_definitions(-DCONFIG_UTM_ADAPTER)
# endif()
add_subdirectory(Actuators)

set(EXTRA_SRC)
Expand Down
Loading