mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-07-19 05:24:59 -04:00
chore: Add support for Qt Creator version to the plugin build script (#87)
This will allow to add code conditional on the Qt Creator version to the plugin codebase. The Qt Creator version will be passed from the build script automatically. This will also allow to easily extend the Github Actions job matrix to create releases for more than one Qt Creator version. Using QT_VERSION_CHECK allows to reuse existing Qt patterns of checking versions. Code has been tested by invoking QODEASSIST_QT_CREATOR_VERSION in code.
This commit is contained in:
committed by
GitHub
parent
3b188740e8
commit
d8a01504a3
12
.github/workflows/build_cmake.yml
vendored
12
.github/workflows/build_cmake.yml
vendored
@ -187,6 +187,15 @@ jobs:
|
||||
set(ENV{CXX} ${{ matrix.config.cxx }})
|
||||
set(ENV{MACOSX_DEPLOYMENT_TARGET} "${{ env.MACOS_DEPLOYMENT_TARGET }}")
|
||||
|
||||
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)" version_match "$ENV{QT_CREATOR_VERSION}")
|
||||
set(QT_CREATOR_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
set(QT_CREATOR_VERSION_MINOR "${CMAKE_MATCH_2}")
|
||||
set(QT_CREATOR_VERSION_PATCH "${CMAKE_MATCH_3}")
|
||||
|
||||
if(NOT version_match)
|
||||
message(FATAL_ERROR "Failed to parse Qt Creator version string: $ENV{QT_CREATOR_VERSION}")
|
||||
endif()
|
||||
|
||||
if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x")
|
||||
execute_process(
|
||||
COMMAND "${{ matrix.config.environment_script }}" && set
|
||||
@ -223,6 +232,9 @@ jobs:
|
||||
--qt-path "${{ steps.qt.outputs.qt_dir }}"
|
||||
--qtc-path "${{ steps.qt_creator.outputs.qtc_dir }}"
|
||||
--output-path "$ENV{GITHUB_WORKSPACE}"
|
||||
--add-config=-DQODEASSIST_QT_CREATOR_VERSION_MAJOR=${QT_CREATOR_VERSION_MAJOR}
|
||||
--add-config=-DQODEASSIST_QT_CREATOR_VERSION_MINOR=${QT_CREATOR_VERSION_MINOR}
|
||||
--add-config=-DQODEASSIST_QT_CREATOR_VERSION_PATCH=${QT_CREATOR_VERSION_PATCH}
|
||||
RESULT_VARIABLE result
|
||||
)
|
||||
if (NOT result EQUAL 0)
|
||||
|
Reference in New Issue
Block a user