diff --git a/cmake/FetchMaxLibQt.cmake b/cmake/FetchMaxLibQt.cmake new file mode 100644 index 00000000000..4a787b4e543 --- /dev/null +++ b/cmake/FetchMaxLibQt.cmake @@ -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} +) diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 7a3082bb643..0ec8c797be9 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -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 ) @@ -184,6 +182,8 @@ set(CPN_COMMON_LIB common) ############# Supporting libraries ############### +include(FetchMaxLibQt) + add_subdirectory(datamodels) add_subdirectory(firmwares) add_subdirectory(shared) @@ -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) diff --git a/companion/src/generaledit/CMakeLists.txt b/companion/src/generaledit/CMakeLists.txt index 6821321dcd9..fe8660dc314 100644 --- a/companion/src/generaledit/CMakeLists.txt +++ b/companion/src/generaledit/CMakeLists.txt @@ -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 diff --git a/companion/src/modeledit/CMakeLists.txt b/companion/src/modeledit/CMakeLists.txt index 9d85dc6717f..0a792e8f6df 100644 --- a/companion/src/modeledit/CMakeLists.txt +++ b/companion/src/modeledit/CMakeLists.txt @@ -2,6 +2,7 @@ include_directories( ${CMAKE_SOURCE_DIR} ${COMPANION_SRC_DIRECTORY} ${CMAKE_CURRENT_BINARY_DIR} + ${maxLibQt_SOURCE_DIR}/widgets ) set(modeledit_NAMES diff --git a/companion/src/shared/CMakeLists.txt b/companion/src/shared/CMakeLists.txt index 5f9c47ee23f..20829486f4e 100644 --- a/companion/src/shared/CMakeLists.txt +++ b/companion/src/shared/CMakeLists.txt @@ -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