diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 354b224f..7b5a0f18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,35 +8,35 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] + qtver: [5.12.12, 6.5.3] steps: - name: Checkout - uses: actions/checkout@v2 - - - name: Cache Qt - id: cache-qt - uses: actions/cache@v2 - with: - path: ${{ github.workspace }}/Qt/ - key: ${{ runner.os }}-QtCache-5-12-12 + uses: actions/checkout@v4 - name: Install Qt - uses: jurplel/install-qt-action@v2 + uses: jurplel/install-qt-action@v3 with: - version: 5.12.12 + version: ${{ matrix.qtver }} dir: "${{ github.workspace }}/Qt/" - cached: ${{ steps.cache-qt.outputs.cache-hit }} + cache: true + cache-key-prefix: ${{ matrix.qtver }}-${{ matrix.os }} - name: Install Linux dependencies if: "contains( matrix.os, 'ubuntu')" run: sudo apt-get install libxkbcommon-x11-0 libgl1-mesa-dev mesa-common-dev libglfw3-dev libglu1-mesa-dev + + - name: Use MSVC (Windows) + uses: ilammy/msvc-dev-cmd@v1 - - name: Build - uses: lukka/run-cmake@v1 - with: - cmakeListsOrSettingsJson: CMakeListsTxtAdvanced - cmakeListsTxtPath: "${{ github.workspace }}/CMakeLists.txt" - cmakeAppendedArgs: - buildDirectory: ${{ github.workspace }}/cmakebuild - buildWithCMakeArgs: "--config Release" - useVcpkgToolchainFile: false - + - name: Configure 5.12 + if: "contains( matrix.qtver, '5.12')" + run: | + cmake -S . -B build + + - name: Configure 6.5 + if: "contains( matrix.qtver, '6.5')" + run: | + cmake -S . -DUSE_QT6=TRUE -B build + + - name: Build + run: cmake --build build diff --git a/.gitignore b/.gitignore index dff97119..832aaace 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ plugins resources Doxygen.log *.swp +build \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index a0ffc249..9f1e10a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.15) project(qwt) @@ -15,8 +15,16 @@ add_definitions(-DQWT_NO_SVG -DQWT_MOC_INCLUDE) include(src/CMakeLists.txt) -find_package(Qt5 COMPONENTS REQUIRED Concurrent Core Gui OpenGL PrintSupport Widgets) -set(QT_LIBRARIES Qt5::Concurrent Qt5::Core Qt5::Gui Qt5::OpenGL Qt5::PrintSupport Qt5::Widgets) +option(USE_QT6 "Use Qt6" FALSE) + +if(USE_QT6) + find_package(Qt6 COMPONENTS REQUIRED Concurrent Core Gui OpenGLWidgets PrintSupport Widgets) + set(QT_LIBRARIES Qt6::Concurrent Qt6::Core Qt6::Gui Qt6::OpenGLWidgets Qt6::PrintSupport Qt6::Widgets) +else(USE_QT6) + find_package(Qt5 COMPONENTS REQUIRED Concurrent Core Gui OpenGL PrintSupport Widgets) + set(QT_LIBRARIES Qt5::Concurrent Qt5::Core Qt5::Gui Qt5::OpenGL Qt5::PrintSupport Qt5::Widgets) +endif(USE_QT6) + set(CMAKE_AUTOMOC ON) add_library(${PROJECT_NAME} src/CMakeLists.txt ${HEADER_FILES} ${SOURCE_FILES} ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 04b08b61..d0dbbfd8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required(VERSION 2.8.12) - set(HEADER_FILES ${HEADER_FILES} src/qwt.h src/qwt_abstract_scale_draw.h @@ -207,12 +205,10 @@ src/qwt_scale_widget.cpp) # QwtOpenGL set(HEADER_FILES ${HEADER_FILES} -src/qwt_plot_glcanvas.h src/qwt_plot_opengl_canvas.h ) set(SOURCE_FILES ${SOURCE_FILES} -src/qwt_plot_glcanvas.cpp src/qwt_plot_opengl_canvas.cpp )