Skip to content

Commit f76dbc3

Browse files
committed
Add test that runs CMake on the sample project
1 parent 5be1905 commit f76dbc3

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ jobs:
108108
for /f "delims=" %%d in ( 'vswhere.exe -latest -property installationPath' ) do @( call "%%d\VC\Auxiliary\Build\vcvars64.bat" )
109109
IF "%QT_VERSION:~0,1%"=="5" ( dir %Qt5_DIR% ) ELSE ( dir %QT_ROOT_DIR%\lib\cmake )
110110
qmake
111+
cmake -S . -B ./build
111112
shell: cmd
112113

113114
- name: Configure test project on unix
@@ -122,6 +123,7 @@ jobs:
122123
ls "${Qt5_DIR}"
123124
fi
124125
qmake
126+
cmake -S . -B ./build
125127
shell: bash
126128

127129
- name: Install tools with options
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)