From e4c20384095486c9339722d407ba49831200168e Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 15 Apr 2024 11:00:37 +0200 Subject: [PATCH 01/13] Dynamic windows builds --- .github/workflows/windows.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a6d147796f..53056b60ec 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -68,8 +68,8 @@ jobs: -D CMAKE_C_COMPILER="C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/x64/bin/clang-cl.exe" \ -D CMAKE_CXX_COMPILER="C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/x64/bin/clang-cl.exe" \ -D CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ - -D VCPKG_TARGET_TRIPLET="x64-windows-static" \ - -D VCPKG_HOST_TRIPLET="x64-windows-static" \ + -D VCPKG_TARGET_TRIPLET="x64-windows" \ + -D VCPKG_HOST_TRIPLET="x64-windows" \ -D WITH_VCPKG=ON \ -D WITH_SPIX=ON \ -D WITH_NFC=OFF \ @@ -82,7 +82,7 @@ jobs: -D SENTRY_DSN=${{ secrets.SENTRY_DSN }} \ -D SENTRY_ENV="${APP_ENV}" \ -D CMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded\$<\$:Debug>" \ - -D PKG_CONFIG_EXECUTABLE=${CMAKE_BUILD_DIR}/vcpkg_installed/x64-windows-static/tools/pkgconf/pkgconf.exe \ + -D PKG_CONFIG_EXECUTABLE=${CMAKE_BUILD_DIR}/vcpkg_installed/x64-windows/tools/pkgconf/pkgconf.exe \ -D WITH_BLUETOOTH=ON \ -D VCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:/src" \ ${EXTRA_CMAKE_ARGS} @@ -91,7 +91,7 @@ jobs: uses: actions/upload-artifact@v4 if: failure() with: - name: build-logs-x64-windows-static + name: build-logs-x64-windows path: | C:/src/**/*.log @@ -102,7 +102,7 @@ jobs: - name: 🧫 Test shell: bash env: - PROJ_LIB: ${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/x64-windows-static/share/proj + PROJ_LIB: ${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/x64-windows/share/proj run: | SOURCE_DIR=$( cygpath "${{ github.workspace }}" ) pip install -r "${SOURCE_DIR}/test/spix/requirements.txt" @@ -122,20 +122,20 @@ jobs: uses: actions/upload-artifact@v4 if: failure() with: - name: package-logs-x64-windows-static + name: package-logs-x64-windows path: ${{ env.CMAKE_BUILD_DIR }}/_CPack_Packages/**/*.log - name: 📦 Upload package if: ${{ env.ARTIFACT_NAME != null }} uses: actions/upload-artifact@v4 with: - name: "QField-dev-x64-windows-static-${{ env.BUILD_TYPE }}" + name: "QField-dev-x64-windows-${{ env.BUILD_TYPE }}" path: ${{ env.ARTIFACT_PATHNAME }} - name: 📊 Upload test report uses: actions/upload-artifact@v4 with: - name: "test-report-x64-windows-static-${{ env.BUILD_TYPE }}" + name: "test-report-x64-windows-${{ env.BUILD_TYPE }}" path: "${{ env.CMAKE_BUILD_DIR }}/report" - name: 🚀 Upload release asset From 3ae5f2065685048ac4f02bb474065bfcb1445c4c Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Tue, 16 Apr 2024 11:22:27 +0700 Subject: [PATCH 02/13] Add libprotobuf-lite patch --- vcpkg/ports/qgis/libprotobuf-lite.patch | 38 +++++++++++++++++++++++++ vcpkg/ports/qgis/portfile.cmake | 1 + 2 files changed, 39 insertions(+) create mode 100644 vcpkg/ports/qgis/libprotobuf-lite.patch diff --git a/vcpkg/ports/qgis/libprotobuf-lite.patch b/vcpkg/ports/qgis/libprotobuf-lite.patch new file mode 100644 index 0000000000..591e1c8929 --- /dev/null +++ b/vcpkg/ports/qgis/libprotobuf-lite.patch @@ -0,0 +1,38 @@ +From e3a41d679edfd64d5fa4caa33c8564d9163ebdcd Mon Sep 17 00:00:00 2001 +From: Matthias Kuhn +Date: Fri, 15 Mar 2024 16:50:00 +0100 +Subject: [PATCH] Switch to conditional protobuf-lite target + +The original version number check was completely random numbers +--- + CMakeLists.txt | 3 --- + src/core/CMakeLists.txt | 2 +- + 2 files changed, 1 insertion(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 564a1fe30bb4..e6f1278f7bf4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -375,9 +375,6 @@ if(WITH_CORE) + + find_package(Protobuf CONFIG) + find_package(Protobuf REQUIRED) +- if(Protobuf_VERSION GREATER_EQUAL 4.23) +- set(Protobuf_LITE_LIBRARY protobuf::libprotobuf-lite) +- endif() + + message(STATUS "Found Protobuf: ${Protobuf_LIBRARIES}") + if (NOT Protobuf_PROTOC_EXECUTABLE) +diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt +index 26fca1e2bf99..692753b4e273 100644 +--- a/src/core/CMakeLists.txt ++++ b/src/core/CMakeLists.txt +@@ -2460,7 +2460,7 @@ target_link_libraries(qgis_core + EXPAT::EXPAT + ${SQLITE3_LIBRARY} + ${LIBZIP_LIBRARY} +- ${Protobuf_LITE_LIBRARY} ++ $ + ${ZLIB_LIBRARIES} + ${EXIV2_LIBRARY} + PROJ::proj diff --git a/vcpkg/ports/qgis/portfile.cmake b/vcpkg/ports/qgis/portfile.cmake index f21f71c0ec..8318d7a33d 100644 --- a/vcpkg/ports/qgis/portfile.cmake +++ b/vcpkg/ports/qgis/portfile.cmake @@ -18,6 +18,7 @@ vcpkg_from_github( crssync-no-install.patch include-qthread.patch invoke.patch + libprotobuf-lite.patch ) file(REMOVE ${SOURCE_PATH}/cmake/FindGDAL.cmake) From c0e90859e565b17cd472cf9c4edbf633f8dfd1e5 Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Tue, 16 Apr 2024 16:27:22 +0700 Subject: [PATCH 03/13] Additional fixes from QGIS master --- vcpkg/ports/qgis/portfile.cmake | 1 + vcpkg/ports/qgis/windowsqt6fixes.patch | 675 +++++++++++++++++++++++++ 2 files changed, 676 insertions(+) create mode 100644 vcpkg/ports/qgis/windowsqt6fixes.patch diff --git a/vcpkg/ports/qgis/portfile.cmake b/vcpkg/ports/qgis/portfile.cmake index 8318d7a33d..4fa2a54738 100644 --- a/vcpkg/ports/qgis/portfile.cmake +++ b/vcpkg/ports/qgis/portfile.cmake @@ -19,6 +19,7 @@ vcpkg_from_github( include-qthread.patch invoke.patch libprotobuf-lite.patch + windowsqt6fixes.patch ) file(REMOVE ${SOURCE_PATH}/cmake/FindGDAL.cmake) diff --git a/vcpkg/ports/qgis/windowsqt6fixes.patch b/vcpkg/ports/qgis/windowsqt6fixes.patch new file mode 100644 index 0000000000..2fbe17b72c --- /dev/null +++ b/vcpkg/ports/qgis/windowsqt6fixes.patch @@ -0,0 +1,675 @@ +From ce3f74347af6e2ff2707b70ad06766317520d76a Mon Sep 17 00:00:00 2001 +From: "Juergen E. Fischer" +Date: Wed, 27 Mar 2024 06:35:21 +0100 +Subject: [PATCH] changes to support msvc builds with qt6 + +--- + CMakeLists.txt | 20 +++++++------- + external/mdal/frmts/mdal_h2i.cpp | 2 +- + external/mdal/mdal_utils.cpp | 14 +++++----- + external/qspatialite/CMakeLists.txt | 14 +++++----- + external/qspatialite/qsql_spatialite.cpp | 2 +- + external/untwine/api/QgisUntwine_win.cpp | 2 +- + python/PyQt6/gui/gui_auto.sip | 2 ++ + python/gui/gui_auto.sip | 2 ++ + src/app/CMakeLists.txt | 4 +++ + src/app/main.cpp | 10 +++---- + src/app/qgisapp.cpp | 2 +- + src/core/layout/qgslayoutitemlegend.cpp | 2 +- + src/core/mesh/qgstopologicalmesh.cpp | 2 +- + src/core/pal/labelposition.cpp | 2 +- + src/core/pointcloud/qgslazdecoder.cpp | 2 ++ + .../pointcloud/qgspointcloudlayerrenderer.cpp | 2 +- + src/core/qgsattributetableconfig.h | 2 +- + src/core/qgsexpressioncontext.cpp | 4 +++ + src/core/qgsopenclutils.cpp | 27 ++++++++++++++++--- + src/gui/CMakeLists.txt | 9 ++++++- + src/native/CMakeLists.txt | 2 +- + src/native/win/qgswinnative.cpp | 24 ++++++++++++++++- + src/native/win/qgswinnative.h | 14 +++++++--- + src/providers/grass/qgsgrass.cpp | 4 +-- + src/server/qgis_mapserver.cpp | 4 +-- + 25 files changed, 122 insertions(+), 52 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e69f5558320c..f2a80042cbd5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -85,17 +85,15 @@ if (USE_OPENCL) + endif() + + # Configure CCache if available +-if(NOT MSVC) +- option(USE_CCACHE "Use ccache" ON) +- if (USE_CCACHE) +- find_program(CCACHE_FOUND ccache) +- if(CCACHE_FOUND) +- set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) +- set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) +- message(STATUS "ccache found") +- endif(CCACHE_FOUND) +- endif(USE_CCACHE) +-endif(NOT MSVC) ++option(USE_CCACHE "Use ccache" ON) ++if (USE_CCACHE) ++ find_program(CCACHE_FOUND ccache) ++ if(CCACHE_FOUND) ++ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) ++ set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) ++ message(STATUS "ccache found") ++ endif(CCACHE_FOUND) ++endif(USE_CCACHE) + + if (IOS) + set (DEFAULT_FORCE_STATIC_LIBS TRUE) +diff --git a/external/mdal/frmts/mdal_h2i.cpp b/external/mdal/frmts/mdal_h2i.cpp +index 0b2ca0f33dbb..be5b2b6834ad 100644 +--- a/external/mdal/frmts/mdal_h2i.cpp ++++ b/external/mdal/frmts/mdal_h2i.cpp +@@ -137,7 +137,7 @@ bool MDAL::DriverH2i::parseJsonFile( const std::string filePath, MetadataH2i &me + metadata.dirPath = MDAL::dirName( filePath ); + + } +- catch ( Json::exception &e ) ++ catch ( Json::exception & ) + { + return false; + } +diff --git a/external/mdal/mdal_utils.cpp b/external/mdal/mdal_utils.cpp +index efcbc1b6489a..4691f00b99a8 100644 +--- a/external/mdal/mdal_utils.cpp ++++ b/external/mdal/mdal_utils.cpp +@@ -17,7 +17,9 @@ + #include + + #ifdef _MSC_VER ++#ifndef UNICODE + #define UNICODE ++#endif + #include + #include + #include +@@ -1113,12 +1115,12 @@ std::vector MDAL::Library::libraryFilesInDir( const std::string &di + { + std::vector filesList; + #ifdef _WIN32 +- WIN32_FIND_DATA data; ++ WIN32_FIND_DATAA data; + HANDLE hFind; + std::string pattern = dirPath; + pattern.push_back( '*' ); + +- hFind = FindFirstFile( pattern.c_str(), &data ); ++ hFind = FindFirstFileA( pattern.c_str(), &data ); + + if ( hFind == INVALID_HANDLE_VALUE ) + return filesList; +@@ -1129,7 +1131,7 @@ std::vector MDAL::Library::libraryFilesInDir( const std::string &di + if ( !fileName.empty() && fileExtension( fileName ) == ".dll" ) + filesList.push_back( fileName ); + } +- while ( FindNextFile( hFind, &data ) != 0 ); ++ while ( FindNextFileA( hFind, &data ) != 0 ); + + FindClose( hFind ); + #else +@@ -1140,8 +1142,8 @@ std::vector MDAL::Library::libraryFilesInDir( const std::string &di + std::string fileName( de->d_name ); + if ( !fileName.empty() ) + { +- std::string extentsion = fileExtension( fileName ); +- if ( extentsion == ".so" || extentsion == ".dylib" ) ++ std::string extension = fileExtension( fileName ); ++ if ( extension == ".so" || extension == ".dylib" ) + filesList.push_back( fileName ); + } + de = readdir( dir ); +@@ -1160,7 +1162,7 @@ bool MDAL::Library::loadLibrary() + #ifdef _WIN32 + UINT uOldErrorMode = + SetErrorMode( SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS ); +- d->mLibrary = LoadLibrary( d->mLibraryFile.c_str() ); ++ d->mLibrary = LoadLibraryA( d->mLibraryFile.c_str() ); + SetErrorMode( uOldErrorMode ); + #else + d->mLibrary = dlopen( d->mLibraryFile.c_str(), RTLD_LAZY ); +diff --git a/external/qspatialite/CMakeLists.txt b/external/qspatialite/CMakeLists.txt +index 33536dafe913..527f383303c7 100644 +--- a/external/qspatialite/CMakeLists.txt ++++ b/external/qspatialite/CMakeLists.txt +@@ -7,18 +7,18 @@ add_definitions(-DQT_SHARED) + + include_directories(SYSTEM + ${SQLITE3_INCLUDE_DIR} +- ${Qt5Sql_PRIVATE_INCLUDE_DIRS} ++ ${${QT_VERSION_BASE}Sql_PRIVATE_INCLUDE_DIRS} + ) + +-set(QSQLSPATIALITE_SRC qsql_spatialite.cpp smain.cpp) +-QT5_WRAP_CPP(QSQLSPATIALITE_SRC qsql_spatialite.h smain.h) ++set(QSQLSPATIALITE_SRC qsql_spatialite.cpp smain.cpp qsql_spatialite.h smain.h) + + add_library(qsqlspatialite SHARED ${QSQLSPATIALITE_SRC}) ++ + target_link_libraries(qsqlspatialite +- ${Qt5Core_LIBRARIES} +- ${Qt5Sql_LIBRARIES} +- spatialite::spatialite +- qgis_core ++ ${QT_VERSION_BASE}::Core ++ ${QT_VERSION_BASE}::Sql ++ spatialite::spatialite ++ qgis_core + ) + + install(TARGETS qsqlspatialite +diff --git a/external/qspatialite/qsql_spatialite.cpp b/external/qspatialite/qsql_spatialite.cpp +index 0e8f15a25f76..5a75a04748b3 100644 +--- a/external/qspatialite/qsql_spatialite.cpp ++++ b/external/qspatialite/qsql_spatialite.cpp +@@ -632,7 +632,7 @@ bool QSpatiaLiteDriver::open( const QString &db, const QString &, const QString + bool openReadOnlyOption = false; + bool openUriOption = false; + +- const auto opts = conOpts.splitRef( QLatin1Char( ';' ) ); ++ const auto opts = conOpts.split( QLatin1Char( ';' ) ); + for ( auto option : opts ) + { + option = option.trimmed(); +diff --git a/external/untwine/api/QgisUntwine_win.cpp b/external/untwine/api/QgisUntwine_win.cpp +index 7469655df8f8..47d355ce3675 100644 +--- a/external/untwine/api/QgisUntwine_win.cpp ++++ b/external/untwine/api/QgisUntwine_win.cpp +@@ -28,7 +28,7 @@ bool QgisUntwine::start(Options& options) + cmdline += "--" + op.first + " \"" + op.second + "\" "; + + PROCESS_INFORMATION processInfo; +- STARTUPINFO startupInfo; ++ STARTUPINFOA startupInfo; + + ZeroMemory(&processInfo, sizeof(PROCESS_INFORMATION)); + ZeroMemory(&startupInfo, sizeof(STARTUPINFO)); +diff --git a/python/PyQt6/gui/gui_auto.sip b/python/PyQt6/gui/gui_auto.sip +index c668cc6c9a90..46863b186a85 100644 +--- a/python/PyQt6/gui/gui_auto.sip ++++ b/python/PyQt6/gui/gui_auto.sip +@@ -325,7 +325,9 @@ + %Include auto_generated/editorwidgets/qgsdefaultsearchwidgetwrapper.sip + %Include auto_generated/editorwidgets/qgsdoublespinbox.sip + %Include auto_generated/editorwidgets/qgshtmlwidgetwrapper.sip ++%If ( HAVE_QSCI_SIP ) + %Include auto_generated/editorwidgets/qgsjsoneditwidget.sip ++%End + %Include auto_generated/editorwidgets/qgsmultiedittoolbutton.sip + %Include auto_generated/editorwidgets/qgsrelationaggregatesearchwidgetwrapper.sip + %Include auto_generated/editorwidgets/qgsrelationreferencesearchwidgetwrapper.sip +diff --git a/python/gui/gui_auto.sip b/python/gui/gui_auto.sip +index c668cc6c9a90..46863b186a85 100644 +--- a/python/gui/gui_auto.sip ++++ b/python/gui/gui_auto.sip +@@ -325,7 +325,9 @@ + %Include auto_generated/editorwidgets/qgsdefaultsearchwidgetwrapper.sip + %Include auto_generated/editorwidgets/qgsdoublespinbox.sip + %Include auto_generated/editorwidgets/qgshtmlwidgetwrapper.sip ++%If ( HAVE_QSCI_SIP ) + %Include auto_generated/editorwidgets/qgsjsoneditwidget.sip ++%End + %Include auto_generated/editorwidgets/qgsmultiedittoolbutton.sip + %Include auto_generated/editorwidgets/qgsrelationaggregatesearchwidgetwrapper.sip + %Include auto_generated/editorwidgets/qgsrelationreferencesearchwidgetwrapper.sip +diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt +index 928d98718706..7e866fd20488 100644 +--- a/src/app/CMakeLists.txt ++++ b/src/app/CMakeLists.txt +@@ -514,6 +514,10 @@ if (ANDROID) + else() + add_executable(${QGIS_APP_NAME} MACOSX_BUNDLE WIN32 ${QGIS_APPMAIN_SRCS}) + ++ if(MSVC AND BUILD_WITH_QT6) ++ qt_disable_unicode_defines(${QGIS_APP_NAME}) ++ endif(MSVC AND BUILD_WITH_QT6) ++ + # require c++17 + target_compile_features(${QGIS_APP_NAME} PRIVATE cxx_std_17) + endif() +diff --git a/src/app/main.cpp b/src/app/main.cpp +index 92d7c591946a..5d1746945c76 100644 +--- a/src/app/main.cpp ++++ b/src/app/main.cpp +@@ -177,10 +177,10 @@ void usage( const QString &appName ) + << QStringLiteral( " the PostGIS extension\n" ) ; // OK + + #ifdef Q_OS_WIN +- MessageBox( nullptr, +- msg.join( QString() ).toLocal8Bit().constData(), +- "QGIS command line options", +- MB_OK ); ++ MessageBoxA( nullptr, ++ msg.join( QString() ).toLocal8Bit().constData(), ++ "QGIS command line options", ++ MB_OK ); + #else + std::cout << msg.join( QString() ).toLocal8Bit().constData(); + #endif +@@ -219,7 +219,7 @@ void myPrint( const char *fmt, ... ) + #if defined(Q_OS_WIN) + char buffer[1024]; + vsnprintf( buffer, sizeof buffer, fmt, ap ); +- OutputDebugString( buffer ); ++ OutputDebugStringA( buffer ); + #else + vfprintf( stderr, fmt, ap ); + #endif +diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp +index 3b36ea2c3a43..86c93abe97fe 100644 +--- a/src/app/qgisapp.cpp ++++ b/src/app/qgisapp.cpp +@@ -13038,7 +13038,7 @@ void QgisApp::openURL( QString url, bool useQgisDocDirectory ) + CFRelease( urlRef ); + #elif defined(Q_OS_WIN) + if ( url.startsWith( "file://", Qt::CaseInsensitive ) ) +- ShellExecute( 0, 0, url.mid( 7 ).toLocal8Bit().constData(), 0, 0, SW_SHOWNORMAL ); ++ ShellExecuteA( 0, 0, url.mid( 7 ).toLocal8Bit().constData(), 0, 0, SW_SHOWNORMAL ); + else + QDesktopServices::openUrl( url ); + #else +diff --git a/src/core/layout/qgslayoutitemlegend.cpp b/src/core/layout/qgslayoutitemlegend.cpp +index 6d1a02d3cfda..1ccef7dc7c81 100644 +--- a/src/core/layout/qgslayoutitemlegend.cpp ++++ b/src/core/layout/qgslayoutitemlegend.cpp +@@ -1198,7 +1198,7 @@ void QgsLayoutItemLegend::doUpdateFilterByMap() + { + mapExtent.transform( mapTransform ); + } +- catch ( QgsCsException &cse ) ++ catch ( QgsCsException & ) + { + continue; + } +diff --git a/src/core/mesh/qgstopologicalmesh.cpp b/src/core/mesh/qgstopologicalmesh.cpp +index b789f224f99d..e6b040f7e067 100644 +--- a/src/core/mesh/qgstopologicalmesh.cpp ++++ b/src/core/mesh/qgstopologicalmesh.cpp +@@ -703,7 +703,7 @@ QgsMeshEditingError QgsTopologicalMesh::counterClockwiseFaces( QgsMeshFace &face + if ( error != QgsMeshEditingError() ) + return error; + +- if ( clockwise > 0 )// clockwise --> reverse the order of the index; ++ if ( clockwise )// clockwise --> reverse the order of the index; + { + for ( int i = 0; i < faceSize / 2; ++i ) + { +diff --git a/src/core/pal/labelposition.cpp b/src/core/pal/labelposition.cpp +index 724eaaafaba7..323c7c0ffc3c 100644 +--- a/src/core/pal/labelposition.cpp ++++ b/src/core/pal/labelposition.cpp +@@ -574,7 +574,7 @@ double LabelPosition::getDistanceToPoint( double xp, double yp, bool useOuterBou + geos::unique_ptr point( GEOSGeom_createPointFromXY_r( geosctxt, xp, yp ) ); + contains = ( GEOSPreparedContainsProperly_r( geosctxt, mPreparedOuterBoundsGeos, point.get() ) == 1 ); + } +- catch ( GEOSException &e ) ++ catch ( GEOSException & ) + { + contains = false; + } +diff --git a/src/core/pointcloud/qgslazdecoder.cpp b/src/core/pointcloud/qgslazdecoder.cpp +index 67a4e3b7d462..efde5717dba5 100644 +--- a/src/core/pointcloud/qgslazdecoder.cpp ++++ b/src/core/pointcloud/qgslazdecoder.cpp +@@ -38,7 +38,9 @@ + #include "lazperf/readers.hpp" + + #if defined(_MSC_VER) ++#ifndef UNICODE + #define UNICODE ++#endif + #include + #include + #endif +diff --git a/src/core/pointcloud/qgspointcloudlayerrenderer.cpp b/src/core/pointcloud/qgspointcloudlayerrenderer.cpp +index b4868da229b2..276167147f58 100644 +--- a/src/core/pointcloud/qgspointcloudlayerrenderer.cpp ++++ b/src/core/pointcloud/qgspointcloudlayerrenderer.cpp +@@ -688,7 +688,7 @@ void QgsPointCloudLayerRenderer::renderTriangulatedSurface( QgsPointCloudRenderC + { + delaunator.reset( new delaunator::Delaunator( points ) ); + } +- catch ( std::exception &e ) ++ catch ( std::exception & ) + { + // something went wrong, better to retrieve initial state + QgsDebugMsgLevel( QStringLiteral( "Error with triangulation" ), 4 ); +diff --git a/src/core/qgsattributetableconfig.h b/src/core/qgsattributetableconfig.h +index ba50862a3312..9daf64a74a2f 100644 +--- a/src/core/qgsattributetableconfig.h ++++ b/src/core/qgsattributetableconfig.h +@@ -48,7 +48,7 @@ class CORE_EXPORT QgsAttributeTableConfig + /** + * Defines the configuration of a column in the attribute table. + */ +- struct ColumnConfig ++ struct CORE_EXPORT ColumnConfig + { + //! Constructor for ColumnConfig + ColumnConfig() = default; +diff --git a/src/core/qgsexpressioncontext.cpp b/src/core/qgsexpressioncontext.cpp +index b05f99490a5e..8e0b9c2bcedd 100644 +--- a/src/core/qgsexpressioncontext.cpp ++++ b/src/core/qgsexpressioncontext.cpp +@@ -106,7 +106,11 @@ void QgsExpressionContextScope::addVariable( const QgsExpressionContextScope::St + + bool QgsExpressionContextScope::removeVariable( const QString &name ) + { ++#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) ++ return mVariables.remove( name ); ++#else + return mVariables.remove( name ) > 0; ++#endif + } + + bool QgsExpressionContextScope::hasVariable( const QString &name ) const +diff --git a/src/core/qgsopenclutils.cpp b/src/core/qgsopenclutils.cpp +index 39fab282a0d0..8b193d05049e 100644 +--- a/src/core/qgsopenclutils.cpp ++++ b/src/core/qgsopenclutils.cpp +@@ -25,6 +25,10 @@ + #include + + #ifdef Q_OS_WIN ++#if defined(UNICODE) && !defined(_UNICODE) ++#pragma message(_UNICODE undefined) ++#define _UNICODE ++#endif + #include + #include + #endif +@@ -100,7 +104,12 @@ void QgsOpenClUtils::init() + } + + #ifdef Q_OS_WIN +- HMODULE hModule = GetModuleHandle( "OpenCL.dll" ); ++#ifdef _UNICODE ++#define _T(x) L##x ++#else ++#define _T(x) x ++#endif ++ HMODULE hModule = GetModuleHandle( _T( "OpenCL.dll" ) ); + if ( hModule ) + { + TCHAR pszFileName[1024]; +@@ -114,13 +123,13 @@ void QgsOpenClUtils::init() + DWORD dwLen = GetFileVersionInfoSize( pszFileName, &dwUseless ); + if ( dwLen ) + { +- LPTSTR lpVI = ( LPSTR ) malloc( dwLen ); ++ LPTSTR lpVI = ( LPTSTR ) malloc( dwLen * sizeof( TCHAR ) ); + if ( lpVI ) + { + if ( GetFileVersionInfo( pszFileName, 0, dwLen, lpVI ) ) + { + VS_FIXEDFILEINFO *lpFFI; +- if ( VerQueryValue( lpVI, "\\", ( LPVOID * ) &lpFFI, ( UINT * ) &dwUseless ) ) ++ if ( VerQueryValue( lpVI, _T( "\\" ), ( LPVOID * ) &lpFFI, ( UINT * ) &dwUseless ) ) + { + QgsMessageLog::logMessage( QObject::tr( "OpenCL Product version: %1.%2.%3.%4" ) + .arg( lpFFI->dwProductVersionMS >> 16 ) +@@ -163,13 +172,23 @@ void QgsOpenClUtils::init() + + QgsDebugMsgLevel( QString( "d:%1 subBlock:%2" ).arg( d ).arg( subBlock ), 2 ); + +- BOOL r = VerQueryValue( lpVI, subBlock.toUtf8(), ( LPVOID * )&lpBuffer, ( UINT * )&dwUseless ); ++ BOOL r = VerQueryValue( lpVI, ++#ifdef UNICODE ++ subBlock.toStdWString().c_str(), ++#else ++ subBlock.toUtf8(), ++#endif ++ ( LPVOID * )&lpBuffer, ( UINT * )&dwUseless ); + + if ( r && lpBuffer && lpBuffer != INVALID_HANDLE_VALUE && dwUseless < 1023 ) + { + QgsMessageLog::logMessage( QObject::tr( "Found OpenCL version info %1: %2" ) + .arg( d ) ++#ifdef UNICODE ++ .arg( QString::fromUtf16( ( const ushort * ) lpBuffer ) ), ++#else + .arg( QString::fromLocal8Bit( lpBuffer ) ), ++#endif + LOGMESSAGE_TAG, Qgis::MessageLevel::Info ); + } + } +diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt +index 09b327700271..129136e34f9e 100644 +--- a/src/gui/CMakeLists.txt ++++ b/src/gui/CMakeLists.txt +@@ -1612,6 +1612,13 @@ else() + PROPERTIES COMPILE_FLAGS "-w -Wno-deprecated-declarations") + endif() + ++if(MSVC) ++ set_source_files_properties( ++ ${CMAKE_BINARY_DIR}/src/gui/qgis_gui_autogen/mocs_compilation.cpp ++ PROPERTIES COMPILE_FLAGS "/bigobj" ++ ) ++endif() ++ + ############################################################# + # qgis_gui library + +@@ -1707,7 +1714,7 @@ GENERATE_EXPORT_HEADER( + set(QGIS_GUI_HDRS ${QGIS_GUI_HDRS} ${CMAKE_CURRENT_BINARY_DIR}/qgis_gui.h) + + if(NOT APPLE OR NOT QGIS_MACAPP_FRAMEWORK) +- if (WIN32 ) ++ if (WIN32) + include_directories(${CMAKE_SOURCE_DIR}/src/native/win) + elseif (APPLE) + include_directories(${CMAKE_SOURCE_DIR}/src/native/mac) +diff --git a/src/native/CMakeLists.txt b/src/native/CMakeLists.txt +index cedc517814a1..73edb952b1ad 100644 +--- a/src/native/CMakeLists.txt ++++ b/src/native/CMakeLists.txt +@@ -144,7 +144,7 @@ if (UNIX AND NOT APPLE AND NOT ANDROID) + target_link_libraries(qgis_native ${QT_VERSION_BASE}::DBus) + endif() + +-if (MSVC) ++if (MSVC AND NOT BUILD_WITH_QT6) + find_package(${QT_VERSION_BASE}WinExtras) + + target_link_libraries(qgis_native shell32) +diff --git a/src/native/win/qgswinnative.cpp b/src/native/win/qgswinnative.cpp +index 008c207a35aa..dbc83f6819b2 100644 +--- a/src/native/win/qgswinnative.cpp ++++ b/src/native/win/qgswinnative.cpp +@@ -23,16 +23,24 @@ + #include + #include + #include ++#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + #include + #include + #include + #include + #include ++#endif + #include "wintoastlib.h" + #include + #include + #include + ++#ifdef UNICODE ++#define _T(x) L##x ++#else ++#define _T(x) x ++#endif ++ + + struct LPITEMIDLISTDeleter + { +@@ -57,6 +65,7 @@ void QgsWinNative::initializeMainWindow( QWindow *window, + const QString &version ) + { + mWindow = window; ++#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + if ( mTaskButton ) + return; // already initialized! + +@@ -64,6 +73,7 @@ void QgsWinNative::initializeMainWindow( QWindow *window, + mTaskButton->setWindow( window ); + mTaskProgress = mTaskButton->progress(); + mTaskProgress->setVisible( false ); ++#endif + + QString appName = qgetenv( "QGIS_WIN_APP_NAME" ); + if ( appName.isEmpty() ) +@@ -126,7 +136,7 @@ void QgsWinNative::showFileProperties( const QString &path ) + info.nShow = SW_SHOWNORMAL; + info.fMask = SEE_MASK_INVOKEIDLIST; + info.lpIDList = pidl.get(); +- info.lpVerb = "properties"; ++ info.lpVerb = _T( "properties" ); + + ShellExecuteEx( &info ); + } +@@ -134,24 +144,31 @@ void QgsWinNative::showFileProperties( const QString &path ) + + void QgsWinNative::showUndefinedApplicationProgress() + { ++#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + mTaskProgress->setMaximum( 0 ); + mTaskProgress->show(); ++#endif + } + + void QgsWinNative::setApplicationProgress( double progress ) + { ++#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + mTaskProgress->setMaximum( 100 ); + mTaskProgress->show(); + mTaskProgress->setValue( static_cast< int >( std::round( progress ) ) ); ++#endif + } + + void QgsWinNative::hideApplicationProgress() + { ++#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + mTaskProgress->hide(); ++#endif + } + + void QgsWinNative::onRecentProjectsChanged( const std::vector &recentProjects ) + { ++#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QWinJumpList jumplist; + jumplist.recent()->clear(); + for ( const RecentProjectProperties &recentProject : recentProjects ) +@@ -163,6 +180,7 @@ void QgsWinNative::onRecentProjectsChanged( const std::vectorsetArguments( QStringList( recentProject.path ) ); + jumplist.recent()->addItem( newProject ); + } ++#endif + } + + class NotificationHandler : public WinToastLib::IWinToastHandler +@@ -228,7 +246,11 @@ bool QgsWinNative::openTerminalAtPath( const QString &path ) + return process.startDetached( &pid ); + } + ++#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + bool QgsWinNativeEventFilter::nativeEventFilter( const QByteArray &eventType, void *message, long * ) ++#else ++bool QgsWinNativeEventFilter::nativeEventFilter( const QByteArray &eventType, void *message, qintptr * ) ++#endif + { + static const QByteArray sWindowsGenericMSG{ "windows_generic_MSG" }; + if ( !message || eventType != sWindowsGenericMSG ) +diff --git a/src/native/win/qgswinnative.h b/src/native/win/qgswinnative.h +index 9f0e7479d144..c67902998128 100644 +--- a/src/native/win/qgswinnative.h ++++ b/src/native/win/qgswinnative.h +@@ -15,8 +15,8 @@ + * * + ***************************************************************************/ + +-#ifndef QGSMACNATIVE_H +-#define QGSMACNATIVE_H ++#ifndef QGSWINNATIVE_H ++#define QGSWINNATIVE_H + + #include "qgsnative.h" + #include +@@ -25,8 +25,10 @@ + #include + #pragma comment(lib,"Shell32.lib") + ++#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + class QWinTaskbarButton; + class QWinTaskbarProgress; ++#endif + class QWindow; + + +@@ -35,7 +37,11 @@ class QgsWinNativeEventFilter : public QObject, public QAbstractNativeEventFilte + Q_OBJECT + public: + ++#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + bool nativeEventFilter( const QByteArray &eventType, void *message, long * ) override; ++#else ++ bool nativeEventFilter( const QByteArray &eventType, void *message, qintptr *result ) override; ++#endif + + signals: + +@@ -70,10 +76,12 @@ class NATIVE_EXPORT QgsWinNative : public QgsNative + QWindow *mWindow = nullptr; + Capabilities mCapabilities = NativeFilePropertiesDialog | NativeOpenTerminalAtPath; + bool mWinToastInitialized = false; ++#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QWinTaskbarButton *mTaskButton = nullptr; + QWinTaskbarProgress *mTaskProgress = nullptr; ++#endif + QgsWinNativeEventFilter *mNativeEventFilter = nullptr; + + }; + +-#endif // QGSMACNATIVE_H ++#endif // QGSWINNATIVE_H +diff --git a/src/providers/grass/qgsgrass.cpp b/src/providers/grass/qgsgrass.cpp +index eb8585c112e3..946af31a1ded 100644 +--- a/src/providers/grass/qgsgrass.cpp ++++ b/src/providers/grass/qgsgrass.cpp +@@ -270,8 +270,8 @@ QString QgsGrass::pathSeparator() + #include + QString QgsGrass::shortPath( const QString &path ) + { +- TCHAR buf[MAX_PATH]; +- int len = GetShortPathName( path.toUtf8().constData(), buf, MAX_PATH ); ++ char buf[MAX_PATH]; ++ int len = GetShortPathNameA( path.toUtf8().constData(), buf, MAX_PATH ); + + if ( len == 0 || len > MAX_PATH ) + { +diff --git a/src/server/qgis_mapserver.cpp b/src/server/qgis_mapserver.cpp +index 38d9fe5dcb7c..1ed9042085e0 100644 +--- a/src/server/qgis_mapserver.cpp ++++ b/src/server/qgis_mapserver.cpp +@@ -177,7 +177,7 @@ class TcpServerWorker: public QObject + }; + + // This will delete the connection +- QTcpSocket::connect( clientConnection, &QAbstractSocket::disconnected, clientConnection, connectionDeleter, Qt::QueuedConnection ); ++ QObject::connect( clientConnection, &QAbstractSocket::disconnected, clientConnection, connectionDeleter, Qt::QueuedConnection ); + + #if 0 // Debugging output + clientConnection->connect( clientConnection, &QAbstractSocket::errorOccurred, clientConnection, [ = ]( QAbstractSocket::SocketError socketError ) +@@ -187,7 +187,7 @@ class TcpServerWorker: public QObject + #endif + + // Incoming connection parser +- QTcpSocket::connect( clientConnection, &QIODevice::readyRead, context, [ = ] { ++ QObject::connect( clientConnection, &QIODevice::readyRead, context, [ = ] { + + // Read all incoming data + while ( clientConnection->bytesAvailable() > 0 ) From 0d8b2cf7be8500807e17a8acdb6317215f875667 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 16 Apr 2024 21:45:24 +0200 Subject: [PATCH 04/13] Update qgis-cmake-wrapper.cmake --- cmake/qgis-cmake-wrapper.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/qgis-cmake-wrapper.cmake b/cmake/qgis-cmake-wrapper.cmake index 8526cfe97b..c248bd392f 100644 --- a/cmake/qgis-cmake-wrapper.cmake +++ b/cmake/qgis-cmake-wrapper.cmake @@ -63,7 +63,7 @@ endfunction() # set(CMAKE_USE_PTHREADS_INIT 1) #endif() -if(TRUE) # Should possibly have a "static only" check +if(FALSE) # Should possibly have a "static only" check find_package(PkgConfig QUIET) _find_and_link_library(authmethod_basic_a QGIS::Core) From 9826b0deeb6bfe41bf857fb649e4e7b642e76416 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Fri, 19 Apr 2024 08:52:23 +0200 Subject: [PATCH 05/13] Update windows.yml --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 53056b60ec..9988f7657f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -81,7 +81,7 @@ jobs: -D NUGET_TOKEN=${{ secrets.GITHUB_TOKEN }} \ -D SENTRY_DSN=${{ secrets.SENTRY_DSN }} \ -D SENTRY_ENV="${APP_ENV}" \ - -D CMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded\$<\$:Debug>" \ + -D CMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded\$<\$:Debug>DLL" \ -D PKG_CONFIG_EXECUTABLE=${CMAKE_BUILD_DIR}/vcpkg_installed/x64-windows/tools/pkgconf/pkgconf.exe \ -D WITH_BLUETOOTH=ON \ -D VCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:/src" \ From 84feb697053cef2b167e0f371d354fb2bd406bc2 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Fri, 19 Apr 2024 18:02:56 +0200 Subject: [PATCH 06/13] Update windows.yml --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9988f7657f..c278b63bca 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -71,7 +71,7 @@ jobs: -D VCPKG_TARGET_TRIPLET="x64-windows" \ -D VCPKG_HOST_TRIPLET="x64-windows" \ -D WITH_VCPKG=ON \ - -D WITH_SPIX=ON \ + -D WITH_SPIX=OFF \ -D WITH_NFC=OFF \ -D APP_VERSION="${APP_VERSION}" \ -D APP_VERSION_STR="${APP_VERSION_STR}" \ From 9206240a1c12547691bae6cdd7cc32a5f806022a Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Fri, 19 Apr 2024 18:17:31 +0200 Subject: [PATCH 07/13] Update CMakeLists.txt --- src/app/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 75a64881c9..73c14e4b49 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -120,7 +120,7 @@ function(create_executable) endif() if(WITH_VCPKG) # this triggers the initialisation of static qca ossl plugin. - target_compile_definitions(${exe_TARGET} PUBLIC HAVE_STATIC_QCA_PLUGINS) +# target_compile_definitions(${exe_TARGET} PUBLIC HAVE_STATIC_QCA_PLUGINS) endif() set_target_properties(${exe_TARGET} PROPERTIES AUTORCC TRUE) From 282bd82ba2fbdb81611044e3540dc888f4e5bf0f Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 22 Apr 2024 19:26:27 +0200 Subject: [PATCH 08/13] Upload sdk --- .github/workflows/windows.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c278b63bca..a8daf0ac4a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -87,6 +87,19 @@ jobs: -D VCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:/src" \ ${EXTRA_CMAKE_ARGS} + - name: 📦 Create SDK +# if: github.event_name == 'workflow_dispatch' || github.event_name == 'release' + run: | + ${CMAKE_BUILD_DIR}/_deps/vcpkg-src/vcpkg.exe export --zip --output-dir=./sdk --x-install-root=${CMAKE_BUILD_DIR}/vcpkg_installed + + - name: 📤 Upload sdk +# if: github.event_name == 'workflow_dispatch' || github.event_name == 'release' + uses: actions/upload-artifact@v4 + with: + name: qfield-sdk-x64-windows + path: | + sdk/vcpkg-export-*.zip + - name: 📑 Upload dep build logs uses: actions/upload-artifact@v4 if: failure() From c7b9258f628ad8e97e97951ce50096811647b0c0 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 22 Apr 2024 19:34:09 +0200 Subject: [PATCH 09/13] Fix paths --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a8daf0ac4a..de5f545f04 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -90,7 +90,7 @@ jobs: - name: 📦 Create SDK # if: github.event_name == 'workflow_dispatch' || github.event_name == 'release' run: | - ${CMAKE_BUILD_DIR}/_deps/vcpkg-src/vcpkg.exe export --zip --output-dir=./sdk --x-install-root=${CMAKE_BUILD_DIR}/vcpkg_installed + ${{ env.CMAKE_BUILD_DIR }}/_deps/vcpkg-src/vcpkg.exe export --zip --output-dir=./sdk --x-install-root=${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed - name: 📤 Upload sdk # if: github.event_name == 'workflow_dispatch' || github.event_name == 'release' From 97fcb912458e170fa15ed63a8acbd7ae811a5875 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 23 Apr 2024 06:46:31 +0200 Subject: [PATCH 10/13] Enable ffmpeg --- vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index 70ea3a6299..07f55b5640 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -56,7 +56,7 @@ "features": [ { "name": "ffmpeg", - "platform": "linux | android" + "platform": "linux | android | (window & !static)" }, "qml" ] From bdef16a71480eac509d6fa2d436203e75e82ce5a Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 23 Apr 2024 07:02:29 +0200 Subject: [PATCH 11/13] windowS --- vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index 07f55b5640..c5aa070516 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -56,7 +56,7 @@ "features": [ { "name": "ffmpeg", - "platform": "linux | android | (window & !static)" + "platform": "linux | android | (windows & !static)" }, "qml" ] From 74705fed931ee50322b72d551e4fb4feb092d7d2 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 23 Apr 2024 07:12:39 +0200 Subject: [PATCH 12/13] Install additional files --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 307541e274..e6e6b5f2aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -276,6 +276,11 @@ if(WITH_VCPKG) install(DIRECTORY "${PROJ_DATA_PATH}/" DESTINATION "${CMAKE_INSTALL_DATADIR}/proj/") install(DIRECTORY "${VCPKG_BASE_DIR}/share/gdal/" DESTINATION "${CMAKE_INSTALL_DATADIR}/gdal") + if(VCPKG_TARGET_TRIPLET STREQUAL "x64-windows") + install(DIRECTORY "${VCPKG_BASE_DIR}/bin/" DESTINATION "${CMAKE_INSTALL_DATADIR}/bin" FILES_MATCHING PATTERN "*.dll") + install(DIRECTORY "${VCPKG_BASE_DIR}/Qt6/" DESTINATION "${CMAKE_INSTALL_DATADIR}/bin/Qt6") + endif() + add_dependencies(qfield deploy) endif() From a5050d2d5d71468bd64a51b8b6ade30f4448f2a5 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 23 Apr 2024 08:03:25 +0200 Subject: [PATCH 13/13] Fix install path --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e6e6b5f2aa..acf0786882 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -277,8 +277,14 @@ if(WITH_VCPKG) install(DIRECTORY "${VCPKG_BASE_DIR}/share/gdal/" DESTINATION "${CMAKE_INSTALL_DATADIR}/gdal") if(VCPKG_TARGET_TRIPLET STREQUAL "x64-windows") - install(DIRECTORY "${VCPKG_BASE_DIR}/bin/" DESTINATION "${CMAKE_INSTALL_DATADIR}/bin" FILES_MATCHING PATTERN "*.dll") - install(DIRECTORY "${VCPKG_BASE_DIR}/Qt6/" DESTINATION "${CMAKE_INSTALL_DATADIR}/bin/Qt6") + install(DIRECTORY "${VCPKG_BASE_DIR}/bin/" DESTINATION "${CMAKE_INSTALL_BINDIR}" FILES_MATCHING PATTERN "*.dll") + install(DIRECTORY "${VCPKG_BASE_DIR}/Qt6/" + DESTINATION "${CMAKE_INSTALL_BINDIR}/Qt6" + FILES_MATCHING + PATTERN "*.dll" + PATTERN "qmldir" + PATTERN "*.qmltypes" + ) endif() add_dependencies(qfield deploy)