From f0744d70ad57961b1fd7096d3fb8aa1105cc5338 Mon Sep 17 00:00:00 2001 From: Stephan Kantelberg Date: Wed, 21 Feb 2024 18:03:57 +0100 Subject: [PATCH 1/8] added QT6 --- CMakePresets.json | 3 +++ conanfile.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 029d29f..fd21932 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -12,6 +12,9 @@ "hidden": true, "binaryDir": "${sourceDir}/out/build/${presetName}", "installDir": "${sourceDir}/out/install/${presetName}", + "environment": { + "NOT_ON_C3I": "1" + }, "cacheVariables": { "CPP_STARTER_USE_SML": "ON", "CPP_STARTER_USE_BOOST_BEAST": "ON", diff --git a/conanfile.py b/conanfile.py index ec1b0db..3d3bea2 100644 --- a/conanfile.py +++ b/conanfile.py @@ -6,7 +6,7 @@ class HelloConan(ConanFile): settings = 'os', 'compiler', 'build_type', 'arch' generators = 'CMakeDeps', 'CMakeToolchain' - default_options = {'fmt/*:header_only': True, 'spdlog/*:header_only': True} + default_options = {'fmt/*:header_only': True, 'spdlog/*:header_only': True, 'qt/*:with_fontconfig': False} def configure(self): cmake = CMakeToolchain(self) @@ -17,7 +17,7 @@ def configure(self): self.requires = conans.model.requires.Requirements(['catch2/3.4.0', 'gtest/1.14.0', 'docopt.cpp/0.6.3', 'spdlog/1.12.0', 'sml/1.1.8', 'nlohmann_json/3.11.2', 'boost/1.83.0', 'crowcpp-crow/1.0+5', 'cppzmq/4.9.0', - 'protobuf/3.21.12']) + 'protobuf/3.21.12', 'qt/6.6.1']) def build(self): cmake = CMakeToolchain(self) From 46e79984e31a3f168f971a1faf76bd079e1e0254 Mon Sep 17 00:00:00 2001 From: Stephan Kantelberg Date: Thu, 22 Feb 2024 11:51:40 +0100 Subject: [PATCH 2/8] added QT6, extended infrastructure QT is moved to a separate CMakePreset, because first time configuring will take a lot of time and only one job is enough to check that. --- .github/workflows/build_cmake.yml | 54 +++++++++++++++++++++++++++++++ CMakePresets.json | 30 ++++++++++++++++- cmake/Options.cmake | 1 + conanfile.py | 16 ++++++--- src/CMakeLists.txt | 6 ++++ 5 files changed, 102 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 14237d1..bd90ba2 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -235,3 +235,57 @@ jobs: - name: Build shell: bash run: cmake --build --preset build-unixlike-${{ matrix.compiler.preset }}-${{ matrix.buildtype }} + + linux-qt: + name: ${{ matrix.os }}, ${{ matrix.compiler.name }}, C++${{ matrix.cxx }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false # 'false' means Don't stop matrix workflows even if some matrix entry fails. + matrix: + os: [ubuntu-22.04] + compiler: [ {name: 'Clang 15', preset: clang-15, pkgs: 'clang-15 llvm-15'} ] + cxx: [20] + + steps: + - uses: actions/checkout@v3 + + - name: Cache + uses: actions/cache@v3 + env: + cache-name: cache-conan-modules + with: + path: | + ${{ env.CONAN_USER_HOME }} + ~/.cache/pip + key: ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Conan.cmake') }} + + - name: Install conan + shell: bash + run: | + python3 -m pip install --upgrade pip setuptools conan + source ~/.profile + + - name: Install dependencies + run: | + sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" + sudo apt update + sudo apt install ninja-build ${{ matrix.compiler.pkgs }} libx11-xcb-dev libfontenc-dev libice-dev libsm-dev + libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxext-dev libxfixes-dev libxi-dev + libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev + libxss-dev libxt-dev libxtst-dev libxv-dev libxxf86vm-dev libxcb-render0-dev libxcb-render-util0-dev + libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev + libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-dri3-dev uuid-dev libxcb-cursor-dev + libxcb-util-dev libxcb-util0-dev libx11-xcb1 libx11-xcb libx11-dev libgl-dev libgl1-mesa-dev + shell: bash + + - name: Configure via CMake + shell: bash + run: cmake --preset ${{ matrix.compiler.preset }}-qt -DCXX_STANDARD=${{ matrix.cxx }} + + - name: Build + shell: bash + run: cmake --build --preset build-${{ matrix.compiler.preset }}-qt + + - name: Test + shell: bash + run: ctest --preset test-${{ matrix.compiler.preset }}-qt diff --git a/CMakePresets.json b/CMakePresets.json index fd21932..1dde49c 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -13,7 +13,7 @@ "binaryDir": "${sourceDir}/out/build/${presetName}", "installDir": "${sourceDir}/out/install/${presetName}", "environment": { - "NOT_ON_C3I": "1" + "DONT_CONFIGURE_QT": "1" }, "cacheVariables": { "CPP_STARTER_USE_SML": "ON", @@ -407,6 +407,23 @@ "CMAKE_C_COMPILER": "clang-15", "CMAKE_CXX_COMPILER": "clang++-15" } + }, + { + "name": "clang-15-qt", + "displayName": "Clang 15 QT", + "inherits": "conf-unixlike-common", + "cacheVariables": { + "CMAKE_C_COMPILER": "clang-15", + "CMAKE_CXX_COMPILER": "clang++-15", + "CPP_STARTER_USE_SML": "OFF", + "CPP_STARTER_USE_BOOST_BEAST": "OFF", + "CPP_STARTER_USE_CROW": "OFF", + "CPP_STARTER_USE_CPPZMQ_PROTO": "OFF", + "CPP_STARTER_USE_QT": "ON" + }, + "environment": { + "NOT_ON_C3I": "1" + } } ], "buildPresets": [ @@ -544,6 +561,11 @@ "name": "build-clang-15-fuzzing", "displayName": "Linux Clang 15 Fuzzing", "configurePreset": "clang-15-fuzzing" + }, + { + "name": "build-clang-15-qt", + "displayName": "Linux Clang 15 QT", + "configurePreset": "clang-15-qt" } ], "testPresets": [ @@ -716,6 +738,12 @@ "displayName": "Linux Clang 15 Fuzzing", "inherits": "test-common", "configurePreset": "clang-15-fuzzing" + }, + { + "name": "test-clang-15-qt", + "displayName": "Linux Clang 15 QT", + "inherits": "test-common", + "configurePreset": "clang-15-qt" } ] } diff --git a/cmake/Options.cmake b/cmake/Options.cmake index b950e72..ef44bbc 100644 --- a/cmake/Options.cmake +++ b/cmake/Options.cmake @@ -35,3 +35,4 @@ OPTION(CPP_STARTER_USE_BOOST_BEAST "Enable compilation of boost beast sample" OF OPTION(CPP_STARTER_USE_CROW "Enable compilation of crow sample" OFF) OPTION(CPP_STARTER_USE_CPPZMQ_PROTO "Enable compilation of protobuf and cppzmq sample" OFF) OPTION(CPP_STARTER_USE_EMBEDDED_TOOLCHAIN "Enable compilation of an example cortex m4 project" OFF) +OPTION(CPP_STARTER_USE_QT "Enable compilation of an example QT project" OFF) diff --git a/conanfile.py b/conanfile.py index 3d3bea2..17fc403 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,3 +1,5 @@ +import os + import conans.model.requires from conan import ConanFile from conan.tools.cmake import CMakeToolchain @@ -13,11 +15,17 @@ def configure(self): cmake.user_presets_path = None if self.settings.get_safe('arch') == 'armv7': self.requires = conans.model.requires.Requirements(['fmt/10.0.0', 'sml/1.1.6']) + return + + if os.getenv("DONT_CONFIGURE_QT"): + requirement = ['catch2/3.4.0', 'gtest/1.14.0', 'docopt.cpp/0.6.3', + 'spdlog/1.12.0', 'sml/1.1.8', 'nlohmann_json/3.11.2', + 'boost/1.83.0', 'crowcpp-crow/1.0+5', 'cppzmq/4.9.0', + 'protobuf/3.21.12'] + self.requires = conans.model.requires.Requirements(requirement) else: - self.requires = conans.model.requires.Requirements(['catch2/3.4.0', 'gtest/1.14.0', 'docopt.cpp/0.6.3', - 'spdlog/1.12.0', 'sml/1.1.8', 'nlohmann_json/3.11.2', - 'boost/1.83.0', 'crowcpp-crow/1.0+5', 'cppzmq/4.9.0', - 'protobuf/3.21.12', 'qt/6.6.1']) + self.requires = conans.model.requires.Requirements(['catch2/3.4.0', 'docopt.cpp/0.6.3', 'gtest/1.14.0', + 'qt/6.6.1', 'spdlog/1.12.0']) def build(self): cmake = CMakeToolchain(self) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f6e19b0..8d85756 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,6 +30,12 @@ IF(CPP_STARTER_USE_CPPZMQ_PROTO) ADD_SUBDIRECTORY(protobuf.cppzmq) ENDIF() +# QT example +IF(CPP_STARTER_USE_QT) + MESSAGE("Using QT") + ADD_SUBDIRECTORY(qt) +ENDIF() + FIND_PACKAGE(docopt REQUIRED) FIND_PACKAGE(spdlog REQUIRED) From b0fbaebf6614d56ef6eaac049f527d63f7bff352 Mon Sep 17 00:00:00 2001 From: Stephan Kantelberg Date: Thu, 22 Feb 2024 12:48:27 +0100 Subject: [PATCH 3/8] changed workflow, introduced fix for github action --- .github/workflows/build_cmake.yml | 14 +++++++------- CMakeLists.txt | 5 +++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index bd90ba2..b2ea706 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -269,13 +269,13 @@ jobs: run: | sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" sudo apt update - sudo apt install ninja-build ${{ matrix.compiler.pkgs }} libx11-xcb-dev libfontenc-dev libice-dev libsm-dev - libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxext-dev libxfixes-dev libxi-dev - libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev - libxss-dev libxt-dev libxtst-dev libxv-dev libxxf86vm-dev libxcb-render0-dev libxcb-render-util0-dev - libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev - libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-dri3-dev uuid-dev libxcb-cursor-dev - libxcb-util-dev libxcb-util0-dev libx11-xcb1 libx11-xcb libx11-dev libgl-dev libgl1-mesa-dev + sudo apt install ninja-build ${{ matrix.compiler.pkgs }} libx11-xcb-dev libfontenc-dev libice-dev | + libsm-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxext-dev libxfixes-dev libxi-dev | + libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev | + libxss-dev libxt-dev libxtst-dev libxv-dev libxxf86vm-dev libxcb-render0-dev libxcb-render-util0-dev | + libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev | + libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-dri3-dev uuid-dev libxcb-cursor-dev | + libxcb-util-dev libxcb-util0-dev libx11-xcb1 libx11-xcb libx11-dev libgl-dev libgl1-mesa-dev | shell: bash - name: Configure via CMake diff --git a/CMakeLists.txt b/CMakeLists.txt index c0d3180..42891b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,11 @@ INCLUDE(cmake/Conan.cmake) # when compiling with PCH enabled SET(CMAKE_CXX_EXTENSIONS OFF) +# temporarily Workaround due to problems in github actions +IF(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +ENDIF() + INCLUDE(cmake/Options.cmake) # Set the project name to your project name, my project isn't very descriptive From c61767b2c8ca08c36150b0627c6e1e15f09afcbe Mon Sep 17 00:00:00 2001 From: Stephan Kantelberg Date: Thu, 22 Feb 2024 13:15:15 +0100 Subject: [PATCH 4/8] removed clang12,13,14 for only C++17 --- .github/workflows/build_cmake.yml | 79 ++++++++++++++++++++++++------- CMakeLists.txt | 5 -- 2 files changed, 63 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index b2ea706..dd7d4ff 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -37,9 +37,6 @@ jobs: compiler: [ {name: 'GCC 10', preset: gcc-10, pkgs: 'gcc-10 g++-10 lib32gcc-10-dev gcc-multilib'}, {name: 'GCC 11', preset: gcc-11, pkgs: 'gcc-11 g++-11 lib32gcc-11-dev gcc-multilib'}, {name: 'GCC 12', preset: gcc-12, pkgs: 'gcc-12 g++-12 lib32gcc-12-dev gcc-multilib'}, - {name: 'Clang 12', preset: clang-12, pkgs: 'clang-12 llvm-12'}, - {name: 'Clang 13', preset: clang-13, pkgs: 'clang-13 llvm-13'}, - {name: 'Clang 14', preset: clang-14, pkgs: 'clang-14 llvm-14'}, {name: 'Clang 15', preset: clang-15, pkgs: 'clang-15 llvm-15'} ] cxx: [17, 20] @@ -82,6 +79,60 @@ jobs: shell: bash run: ctest --preset test-unixlike-${{ matrix.compiler.preset }}-${{ matrix.buildtype }} + # because of an bug in github actions: https://github.com/actions/runner-images/issues/8659 + # we use clang 12, clang 13, clang 14 only in C++17 mode + linux-clang-smaller-15: + name: ${{ matrix.os }}, ${{ matrix.compiler.name }}, C++${{ matrix.cxx }}, ${{ matrix.buildtype }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false # 'false' means Don't stop matrix workflows even if some matrix entry fails. + matrix: + os: [ubuntu-22.04] + buildtype: [debug] + compiler: [ {name: 'Clang 12', preset: clang-12, pkgs: 'clang-12 llvm-12'}, + {name: 'Clang 13', preset: clang-13, pkgs: 'clang-13 llvm-13'}, + {name: 'Clang 14', preset: clang-14, pkgs: 'clang-14 llvm-14'} + ] + cxx: [17] + + steps: + - uses: actions/checkout@v3 + + - name: Cache + uses: actions/cache@v3 + env: + cache-name: cache-conan-modules + with: + path: | + ${{ env.CONAN_USER_HOME }} + ~/.cache/pip + key: ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Conan.cmake') }} + + - name: Install conan + shell: bash + run: | + python3 -m pip install --upgrade pip setuptools conan + source ~/.profile + + - name: Install dependencies + run: | + sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" + sudo apt update + sudo apt install ninja-build ${{ matrix.compiler.pkgs }} + shell: bash + + - name: Configure via CMake + shell: bash + run: cmake --preset unixlike-${{ matrix.compiler.preset }}-${{ matrix.buildtype }} -DCXX_STANDARD=${{ matrix.cxx }} + + - name: Build + shell: bash + run: cmake --build --preset build-unixlike-${{ matrix.compiler.preset }}-${{ matrix.buildtype }} + + - name: Test + shell: bash + run: ctest --preset test-unixlike-${{ matrix.compiler.preset }}-${{ matrix.buildtype }} + linux-static_analysis: name: Static Analysis, ${{ matrix.os }}, ${{ matrix.compiler.name }}, ${{ matrix.buildtype }} runs-on: ${{ matrix.os }} @@ -196,11 +247,7 @@ jobs: matrix: os: [ubuntu-22.04] buildtype: [debug] - compiler: [ {name: 'Clang 12', preset: clang-12, pkgs: 'clang-12 llvm-12'}, - {name: 'Clang 13', preset: clang-13, pkgs: 'clang-13 llvm-13'}, - {name: 'Clang 14', preset: clang-14, pkgs: 'clang-14 llvm-14'}, - {name: 'Clang 15', preset: clang-15, pkgs: 'clang-15 llvm-15'} - ] + compiler: [ {name: 'Clang 15', preset: clang-15, pkgs: 'clang-15 llvm-15'} ] steps: - uses: actions/checkout@v3 @@ -237,7 +284,7 @@ jobs: run: cmake --build --preset build-unixlike-${{ matrix.compiler.preset }}-${{ matrix.buildtype }} linux-qt: - name: ${{ matrix.os }}, ${{ matrix.compiler.name }}, C++${{ matrix.cxx }} + name: ${{ matrix.os }}, QT ${{ matrix.compiler.name }}, C++${{ matrix.cxx }} runs-on: ${{ matrix.os }} strategy: fail-fast: false # 'false' means Don't stop matrix workflows even if some matrix entry fails. @@ -269,13 +316,13 @@ jobs: run: | sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" sudo apt update - sudo apt install ninja-build ${{ matrix.compiler.pkgs }} libx11-xcb-dev libfontenc-dev libice-dev | - libsm-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxext-dev libxfixes-dev libxi-dev | - libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev | - libxss-dev libxt-dev libxtst-dev libxv-dev libxxf86vm-dev libxcb-render0-dev libxcb-render-util0-dev | - libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev | - libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-dri3-dev uuid-dev libxcb-cursor-dev | - libxcb-util-dev libxcb-util0-dev libx11-xcb1 libx11-xcb libx11-dev libgl-dev libgl1-mesa-dev | + sudo apt install ninja-build ${{ matrix.compiler.pkgs }} libx11-xcb-dev libfontenc-dev libice-dev \ + libsm-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxext-dev libxfixes-dev libxi-dev \ + libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev \ + libxss-dev libxt-dev libxtst-dev libxv-dev libxxf86vm-dev libxcb-render0-dev libxcb-render-util0-dev \ + libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev \ + libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-dri3-dev uuid-dev libxcb-cursor-dev \ + libxcb-util-dev libxcb-util0-dev libx11-xcb1 libx11-dev libgl-dev libgl1-mesa-dev shell: bash - name: Configure via CMake diff --git a/CMakeLists.txt b/CMakeLists.txt index 42891b9..c0d3180 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,11 +7,6 @@ INCLUDE(cmake/Conan.cmake) # when compiling with PCH enabled SET(CMAKE_CXX_EXTENSIONS OFF) -# temporarily Workaround due to problems in github actions -IF(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -ENDIF() - INCLUDE(cmake/Options.cmake) # Set the project name to your project name, my project isn't very descriptive From b5e600448d10399ae29226076741ef1416cc3902 Mon Sep 17 00:00:00 2001 From: Stephan Kantelberg Date: Thu, 22 Feb 2024 13:49:55 +0100 Subject: [PATCH 5/8] fixed logic for environment variable --- CMakePresets.json | 3 ++- conanfile.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 1dde49c..f80a192 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -422,7 +422,8 @@ "CPP_STARTER_USE_QT": "ON" }, "environment": { - "NOT_ON_C3I": "1" + "NOT_ON_C3I": "1", + "DONT_CONFIGURE_QT": "0" } } ], diff --git a/conanfile.py b/conanfile.py index 17fc403..ce7980c 100644 --- a/conanfile.py +++ b/conanfile.py @@ -17,7 +17,7 @@ def configure(self): self.requires = conans.model.requires.Requirements(['fmt/10.0.0', 'sml/1.1.6']) return - if os.getenv("DONT_CONFIGURE_QT"): + if os.getenv("DONT_CONFIGURE_QT") == '1': requirement = ['catch2/3.4.0', 'gtest/1.14.0', 'docopt.cpp/0.6.3', 'spdlog/1.12.0', 'sml/1.1.8', 'nlohmann_json/3.11.2', 'boost/1.83.0', 'crowcpp-crow/1.0+5', 'cppzmq/4.9.0', From 5ac1d9315ba27ec204376f22baaf4a205583a75d Mon Sep 17 00:00:00 2001 From: Stephan Kantelberg Date: Thu, 22 Feb 2024 15:24:06 +0100 Subject: [PATCH 6/8] added missing subdirectory for qt --- src/qt/CMakeLists.txt | 4 ++++ src/qt/main.cpp | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 src/qt/CMakeLists.txt create mode 100644 src/qt/main.cpp diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt new file mode 100644 index 0000000..ed4b08e --- /dev/null +++ b/src/qt/CMakeLists.txt @@ -0,0 +1,4 @@ +FIND_PACKAGE(QT6 REQUIRED) + +ADD_EXECUTABLE(test_qt main.cpp) +TARGET_LINK_LIBRARIES(test_qt PRIVATE ${CMAKE_THREAD_LIBS_INIT} qt::qt) diff --git a/src/qt/main.cpp b/src/qt/main.cpp new file mode 100644 index 0000000..0a6aa91 --- /dev/null +++ b/src/qt/main.cpp @@ -0,0 +1,6 @@ + + +int main() +{ + return 0; +} From d5f3650a55a29da48560ecc601974ea191d055b7 Mon Sep 17 00:00:00 2001 From: Stephan Kantelberg Date: Thu, 22 Feb 2024 16:46:18 +0100 Subject: [PATCH 7/8] fixed finding package --- src/qt/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index ed4b08e..1077e27 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -1,4 +1,4 @@ -FIND_PACKAGE(QT6 REQUIRED) +FIND_PACKAGE(Qt6 REQUIRED) ADD_EXECUTABLE(test_qt main.cpp) TARGET_LINK_LIBRARIES(test_qt PRIVATE ${CMAKE_THREAD_LIBS_INIT} qt::qt) From 2b2135f5bacb85c20cc363e411ed015d9efa727e Mon Sep 17 00:00:00 2001 From: Stephan Kantelberg Date: Mon, 4 Mar 2024 19:34:52 +0100 Subject: [PATCH 8/8] changed logic for setting up QT env variable --- CMakePresets.json | 4 ++-- conanfile.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index f80a192..19ea7d6 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -13,7 +13,7 @@ "binaryDir": "${sourceDir}/out/build/${presetName}", "installDir": "${sourceDir}/out/install/${presetName}", "environment": { - "DONT_CONFIGURE_QT": "1" + "CONFIGURE_QT": "0" }, "cacheVariables": { "CPP_STARTER_USE_SML": "ON", @@ -423,7 +423,7 @@ }, "environment": { "NOT_ON_C3I": "1", - "DONT_CONFIGURE_QT": "0" + "CONFIGURE_QT": "1" } } ], diff --git a/conanfile.py b/conanfile.py index ce7980c..7b89ebb 100644 --- a/conanfile.py +++ b/conanfile.py @@ -17,15 +17,15 @@ def configure(self): self.requires = conans.model.requires.Requirements(['fmt/10.0.0', 'sml/1.1.6']) return - if os.getenv("DONT_CONFIGURE_QT") == '1': + if os.getenv("CONFIGURE_QT") == '1': + self.requires = conans.model.requires.Requirements(['catch2/3.4.0', 'docopt.cpp/0.6.3', 'gtest/1.14.0', + 'qt/6.6.1', 'spdlog/1.12.0']) + else: requirement = ['catch2/3.4.0', 'gtest/1.14.0', 'docopt.cpp/0.6.3', 'spdlog/1.12.0', 'sml/1.1.8', 'nlohmann_json/3.11.2', 'boost/1.83.0', 'crowcpp-crow/1.0+5', 'cppzmq/4.9.0', 'protobuf/3.21.12'] self.requires = conans.model.requires.Requirements(requirement) - else: - self.requires = conans.model.requires.Requirements(['catch2/3.4.0', 'docopt.cpp/0.6.3', 'gtest/1.14.0', - 'qt/6.6.1', 'spdlog/1.12.0']) def build(self): cmake = CMakeToolchain(self)