Skip to content

Commit 6cf14df

Browse files
authored
Merge branch 'master' into use-auto-desktop
2 parents 1b15628 + 6f7dd7e commit 6cf14df

File tree

5 files changed

+49
-11
lines changed

5 files changed

+49
-11
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ jobs:
127127
run: |
128128
cd tests/TestWithModules
129129
for /f "delims=" %%d in ( 'vswhere.exe -latest -property installationPath' ) do @( call "%%d\VC\Auxiliary\Build\vcvars64.bat" )
130-
IF "%QT_VERSION:~0,1%"=="5" ( dir %Qt5_DIR%\lib\cmake ) ELSE ( dir %Qt6_DIR%\lib\cmake )
130+
IF "%QT_VERSION:~0,1%"=="5" ( dir %Qt5_DIR% ) ELSE ( dir %QT_ROOT_DIR%\lib\cmake )
131131
qmake
132+
cmake -S . -B ./build
132133
shell: cmd
133134

134135
- name: Configure test project on unix
@@ -138,11 +139,12 @@ jobs:
138139
run: |
139140
cd tests/TestWithModules
140141
if [[ $QT_VERSION == 6* ]]; then
141-
ls "$Qt6_DIR/lib/cmake"
142+
ls "${QT_ROOT_DIR}/lib/cmake"
142143
else
143-
ls "$Qt5_DIR/lib/cmake"
144+
ls "${Qt5_DIR}"
144145
fi
145146
qmake
147+
cmake -S . -B ./build
146148
shell: bash
147149

148150
- name: Install source

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Possible values: `desktop`, `android`, `ios`, or `winrt`
4444
Default: `desktop`
4545

4646
### `arch`
47-
This is the target architecture that your program will be built for. This is only used for Windows and Android.
47+
This is the target architecture that your program will be built for.
4848

4949
**Linux x86 packages are not supported by this action.** Qt does not offer pre-built Linux x86 packages. Please consider using your distro's repository or building it manually.
5050

@@ -67,7 +67,8 @@ Android: `android_armv7`
6767
### `dir`
6868
This is the directory prefix that Qt will be installed to.
6969

70-
For example, if you set dir to `${{ github.workspace }}/example/`, your bin folder will be located at `$GITHUB_WORKSPACE/example/Qt/5.15.2/{arch}/bin`. When possible, access your Qt directory through the `Qt5_DIR` or `Qt6_DIR` environment variable.
70+
For example, if you set dir to `${{ github.workspace }}/example/`, your bin folder will be located at `$GITHUB_WORKSPACE/example/Qt/5.15.2/{arch}/bin`.
71+
When possible, access your Qt directory through the `QT_ROOT_DIR` environment variable; this will point to `$GITHUB_WORKSPACE/example/Qt/5.15.2/{arch}` in this case.
7172

7273
Default: `$RUNNER_WORKSPACE` (this is one folder above the starting directory)
7374

@@ -260,9 +261,13 @@ Example value: `--external 7z`
260261
## More info
261262
For more in-depth and certifiably up-to-date documentation, check the documentation for aqtinstall [here](https://aqtinstall.readthedocs.io/en/latest/getting_started.html).
262263

263-
The Qt bin directory is appended to your `path` environment variable. `Qt5_DIR`/`Qt6_DIR` is also set appropriately for cmake.
264+
The Qt bin directory is appended to your `path` environment variable.
265+
`Qt5_DIR` is also set appropriately for CMake if you are using Qt 5.
264266
In addition, `QT_PLUGIN_PATH`, `QML2_IMPORT_PATH`, `PKG_CONFIG_PATH` and `LD_LIBRARY_PATH` are set accordingly. `IQTA_TOOLS` is set to the "Tools" directory if tools are installed as well.
265267

268+
Since the Qt bin directory is in your `path`, you will not need to set the `CMAKE_PREFIX_PATH` CMake variable.
269+
If you wish to do so, you can set it to either `${QT_ROOT_DIR}` or to `${QT_ROOT_DIR}/lib/cmake`.
270+
266271
Big thanks to the [aqtinstall](https://github.com/miurahr/aqtinstall/) developer for making this easy. Please go support [miurahr](https://github.com/miurahr/aqtinstall), he did all of the hard work here ([his liberapay](https://liberapay.com/miurahr)).
267272

268273
This action is distributed under the [MIT license](LICENSE).

README_upgrade_guide.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
worked properly. As long as you are using `aqtinstall v3` or higher, the new version of `install-qt-action` will do
1010
that automatically, so you can remove the second step where you add the parallel desktop version of Qt.
1111
If you don't, your workflow will install desktop Qt twice.
12+
* Added the `QT_ROOT_DIR` environment variable that points to the root of the Qt installation.
13+
This variable points to the same directory as the old `Qt5_DIR` and `Qt6_DIR` variables.
14+
* Changed `Qt5_DIR` environment variable, so that it points to `${QT_ROOT_DIR}/lib/cmake`, as required by CMake.
15+
If your action uses this variable for any other purpose, you should update it to use `QT_ROOT_DIR` instead.
16+
* Removed the `Qt5_Dir` and `Qt6_DIR` environment variables, because they are not used by CMake.
17+
If your action uses these variables, you should update them to use `QT_ROOT_DIR` instead.
1218

1319
## v3
1420
* Updated `aqtinstall` to version 2.1.* by default.

action/src/main.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ const run = async (): Promise<void> => {
281281
const dependencies = [
282282
"build-essential",
283283
"libgl1-mesa-dev",
284+
"libgstreamer-gl1.0-0",
284285
"libpulse-dev",
285286
"libxcb-glx0",
286287
"libxcb-icccm4",
@@ -413,13 +414,11 @@ const run = async (): Promise<void> => {
413414
if (process.platform !== "win32") {
414415
setOrAppendEnvVar("PKG_CONFIG_PATH", nativePath(`${qtPath}/lib/pkgconfig`));
415416
}
416-
// If less than qt6, set qt5_dir variable, otherwise set qt6_dir variable
417+
// If less than qt6, set Qt5_DIR variable
417418
if (compareVersions(inputs.version, "<", "6.0.0")) {
418-
core.exportVariable("Qt5_Dir", qtPath); // Incorrect name that was fixed, but kept around so it doesn't break anything
419-
core.exportVariable("Qt5_DIR", qtPath);
420-
} else {
421-
core.exportVariable("Qt6_DIR", qtPath);
419+
core.exportVariable("Qt5_DIR", nativePath(`${qtPath}/lib/cmake`));
422420
}
421+
core.exportVariable("QT_ROOT_DIR", qtPath);
423422
core.exportVariable("QT_PLUGIN_PATH", nativePath(`${qtPath}/plugins`));
424423
core.exportVariable("QML2_IMPORT_PATH", nativePath(`${qtPath}/qml`));
425424
core.addPath(nativePath(`${qtPath}/bin`));
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
cmake_minimum_required(VERSION 3.1.0)
2+
3+
project(whatspoppin VERSION 1.0.0 LANGUAGES CXX)
4+
5+
set(CMAKE_CXX_STANDARD 11)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
8+
set(CMAKE_AUTOMOC ON)
9+
set(CMAKE_AUTORCC ON)
10+
set(CMAKE_AUTOUIC ON)
11+
12+
if(CMAKE_VERSION VERSION_LESS "3.7.0")
13+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
14+
endif()
15+
16+
if(DEFINED ENV{Qt5_DIR})
17+
find_package(Qt5 COMPONENTS WebEngineWidgets REQUIRED)
18+
add_executable(whatspoppin main.cpp)
19+
target_link_libraries(whatspoppin Qt5::WebEngineWidgets)
20+
else()
21+
find_package(Qt6 REQUIRED COMPONENTS Core WebEngineWidgets)
22+
qt_standard_project_setup()
23+
add_executable(whatspoppin main.cpp)
24+
target_link_libraries(whatspoppin PRIVATE Qt::WebEngineWidgets Qt6::Core)
25+
endif()
26+

0 commit comments

Comments
 (0)