Skip to content

Commit

Permalink
Use cmake Fetch to retrieve maxLibQt repo and modify CMakeLists.txt a…
Browse files Browse the repository at this point in the history
…s required
  • Loading branch information
elecpower committed Oct 26, 2023
1 parent 9a4b654 commit 8aec94b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
17 changes: 17 additions & 0 deletions cmake/FetchMaxLibQt.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Fetch maxLibQt source code from Github

include(FetchContent)

FetchContent_Declare(
maxLibQt
GIT_REPOSITORY https://github.com/edgetx/maxLibQt
GIT_TAG 61ef4edd # PR#2
)

FetchContent_MakeAvailable(maxLibQt)

message("Fetched maxLibQt source code from Github: ${maxLibQt_SOURCE_DIR}")
include_directories(
${maxLibQt_SOURCE_DIR}
${maxLibQt_BINARY_DIR}
)
5 changes: 2 additions & 3 deletions companion/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ include_directories(
${SIMU_SRC_DIRECTORY}
${COMPANION_SRC_DIRECTORY}/thirdparty/qcustomplot
${COMPANION_SRC_DIRECTORY}/thirdparty/miniz
${COMPANION_SRC_DIRECTORY}/thirdparty/maxlibqt/src/core
${COMPANION_SRC_DIRECTORY}/thirdparty/maxlibqt/src/widgets
${COMPANION_SRC_DIRECTORY}/storage
)

Expand Down Expand Up @@ -184,6 +182,8 @@ set(CPN_COMMON_LIB common)

############# Supporting libraries ###############

include(FetchMaxLibQt)

add_subdirectory(datamodels)
add_subdirectory(firmwares)
add_subdirectory(shared)
Expand All @@ -192,7 +192,6 @@ add_subdirectory(generaledit)
add_subdirectory(simulation)
add_subdirectory(storage)
add_subdirectory(thirdparty/qcustomplot)
add_subdirectory(thirdparty/maxlibqt/src)
add_subdirectory(thirdparty/miniz)
add_subdirectory(updates)

Expand Down
2 changes: 1 addition & 1 deletion companion/src/generaledit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${maxLibQt_SOURCE_DIR}/widgets)

set(generaledit_NAMES
generaledit
Expand Down
1 change: 1 addition & 0 deletions companion/src/modeledit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include_directories(
${CMAKE_SOURCE_DIR}
${COMPANION_SRC_DIRECTORY}
${CMAKE_CURRENT_BINARY_DIR}
${maxLibQt_SOURCE_DIR}/widgets
)

set(modeledit_NAMES
Expand Down
2 changes: 1 addition & 1 deletion companion/src/shared/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${maxLibQt_SOURCE_DIR}/widgets)

set(shared_NAMES
genericpanel
Expand Down

0 comments on commit 8aec94b

Please sign in to comment.