Test Qt Dependencis
This commit is contained in:
+11
-9
@@ -1,16 +1,18 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
project(Testing LANGUAGES CXX)
|
||||
project(TestingQt LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
add_executable(test_app main.cpp)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
if(MINGW)
|
||||
target_link_options(test_app PRIVATE
|
||||
-static
|
||||
-static-libgcc
|
||||
-static-libstdc++
|
||||
)
|
||||
endif()
|
||||
find_package(Qt6 REQUIRED COMPONENTS Widgets)
|
||||
|
||||
add_executable(test_app
|
||||
main.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(test_app PRIVATE Qt6::Widgets)
|
||||
Vendored
+26
-15
@@ -17,24 +17,35 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build Windows') {
|
||||
agent { label 'windows' }
|
||||
steps {
|
||||
cleanWs()
|
||||
checkout scm
|
||||
stage('Build Windows') {
|
||||
agent { label 'windows' }
|
||||
steps {
|
||||
cleanWs()
|
||||
checkout scm
|
||||
|
||||
bat '''
|
||||
call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat"
|
||||
bat '''
|
||||
call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat"
|
||||
|
||||
cmake -S . -B build\\windows -G Ninja ^
|
||||
-DCMAKE_BUILD_TYPE=Release ^
|
||||
-DCMAKE_TOOLCHAIN_FILE=C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake
|
||||
cmake -S . -B build\\windows -G Ninja ^
|
||||
-DCMAKE_BUILD_TYPE=Release ^
|
||||
-DCMAKE_TOOLCHAIN_FILE=C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake ^
|
||||
-DVCPKG_TARGET_TRIPLET=x64-windows
|
||||
|
||||
cmake --build build\\windows
|
||||
'''
|
||||
cmake --build build\\windows
|
||||
|
||||
archiveArtifacts artifacts: 'build/windows/test_app.exe', fingerprint: true
|
||||
}
|
||||
}
|
||||
if exist dist\\windows rmdir /s /q dist\\windows
|
||||
mkdir dist\\windows
|
||||
|
||||
copy build\\windows\\test_app.exe dist\\windows\\test_app.exe
|
||||
|
||||
C:\\vcpkg\\installed\\x64-windows\\tools\\Qt6\\bin\\windeployqt.exe ^
|
||||
--release ^
|
||||
--no-translations ^
|
||||
dist\\windows\\test_app.exe
|
||||
'''
|
||||
|
||||
archiveArtifacts artifacts: 'dist/windows/**', fingerprint: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,16 @@
|
||||
#include <iostream>
|
||||
#include <QApplication>
|
||||
#include <QMessageBox>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QMessageBox box;
|
||||
box.setWindowTitle("Jenkins Qt Test");
|
||||
box.setText("Hello from Qt + Jenkins!");
|
||||
box.setInformativeText("This app was built on Windows agent.");
|
||||
box.setStandardButtons(QMessageBox::Ok);
|
||||
box.exec();
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello, World!" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
|
||||
{
|
||||
"dependencies": [
|
||||
"qtbase"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user