mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 19:00:22 +08:00
cmake: testing Windows deployment
This commit is contained in:
parent
07409a11a0
commit
4865885f31
8
.github/workflows/build-qv2ray-cmake.yml
vendored
8
.github/workflows/build-qv2ray-cmake.yml
vendored
@ -117,8 +117,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake .. -GNinja
|
cmake .. -GNinja -DCMAKE_INSTALL_PREFIX=./deployment
|
||||||
cmake --build . --parallel $(nproc)
|
cmake --build . --parallel $(nproc)
|
||||||
|
cmake --install .
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
- name: Linux - ${{ matrix.qt_version }} - Generate Dependencies and Build
|
- name: Linux - ${{ matrix.qt_version }} - Generate Dependencies and Build
|
||||||
if: matrix.platform == 'ubuntu-16.04'
|
if: matrix.platform == 'ubuntu-16.04'
|
||||||
@ -204,14 +205,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\
|
set VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\
|
||||||
cd build
|
cd build
|
||||||
cd release
|
cd deployment
|
||||||
del *.cpp *.h *.o *.qrc *.qm *.hpp *.obj
|
|
||||||
windeployqt ./qv2ray.exe --compiler-runtime --verbose 2
|
windeployqt ./qv2ray.exe --compiler-runtime --verbose 2
|
||||||
- name: Win-${{ matrix.arch }} - ${{ matrix.qt_version }} - Create 7z Release
|
- name: Win-${{ matrix.arch }} - ${{ matrix.qt_version }} - Create 7z Release
|
||||||
if: matrix.platform == 'windows-latest'
|
if: matrix.platform == 'windows-latest'
|
||||||
uses: DuckSoft/create-7z-action@v1.0
|
uses: DuckSoft/create-7z-action@v1.0
|
||||||
with:
|
with:
|
||||||
pathSource: ./build/release/
|
pathSource: ./build/deployment/
|
||||||
pathTarget: ./release.7z
|
pathTarget: ./release.7z
|
||||||
- name: Win-${{ matrix.arch }} - ${{ matrix.qt_version }} - Uploading artifact
|
- name: Win-${{ matrix.arch }} - ${{ matrix.qt_version }} - Uploading artifact
|
||||||
if: matrix.platform == 'windows-latest'
|
if: matrix.platform == 'windows-latest'
|
||||||
|
@ -198,7 +198,7 @@ if(APPLE)
|
|||||||
include(cmake/macdeploy.cmake)
|
include(cmake/macdeploy.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE AND NOT WIN32)
|
||||||
install(TARGETS ${PROJECT_NAME}
|
install(TARGETS ${PROJECT_NAME}
|
||||||
RUNTIME
|
RUNTIME
|
||||||
DESTINATION bin
|
DESTINATION bin
|
||||||
@ -214,9 +214,7 @@ if(UNIX AND NOT APPLE)
|
|||||||
install(FILES assets/icons/qv2ray.png
|
install(FILES assets/icons/qv2ray.png
|
||||||
DESTINATION share/icons/hicolor/256x256/apps/
|
DESTINATION share/icons/hicolor/256x256/apps/
|
||||||
)
|
)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(UNIX AND NOT WIN32)
|
|
||||||
install(FILES ${QM_FILES}
|
install(FILES ${QM_FILES}
|
||||||
DESTINATION share/qv2ray/lang
|
DESTINATION share/qv2ray/lang
|
||||||
)
|
)
|
||||||
@ -224,4 +222,36 @@ endif()
|
|||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_link_libraries(${PROJECT_NAME} wininet wsock32 ws2_32 user32)
|
target_link_libraries(${PROJECT_NAME} wininet wsock32 ws2_32 user32)
|
||||||
|
install(TARGETS ${PROJECT_NAME}
|
||||||
|
RUNTIME
|
||||||
|
DESTINATION .
|
||||||
|
)
|
||||||
|
install(FILES ${QM_FILES}
|
||||||
|
DESTINATION lang
|
||||||
|
)
|
||||||
|
|
||||||
|
set(prefix "${PROJECT_NAME}.exe")
|
||||||
|
set(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${prefix}")
|
||||||
|
|
||||||
|
# Directories to look for dependencies
|
||||||
|
set(DIRS "${CMAKE_BINARY_DIR}")
|
||||||
|
# Path used for searching by FIND_XXX(), with appropriate suffixes added
|
||||||
|
if(CMAKE_PREFIX_PATH)
|
||||||
|
foreach(dir ${CMAKE_PREFIX_PATH})
|
||||||
|
list(APPEND DIRS "${dir}/bin" "${dir}/lib")
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Append Qt's lib folder which is two levels above Qt5Widgets_DIR
|
||||||
|
list(APPEND DIRS "${Qt5Widgets_DIR}/../..")
|
||||||
|
|
||||||
|
include(InstallRequiredSystemLibraries)
|
||||||
|
|
||||||
|
message(STATUS "APPS: ${APPS}")
|
||||||
|
message(STATUS "QT_PLUGINS: ${QT_PLUGINS}")
|
||||||
|
message(STATUS "DIRS: ${DIRS}")
|
||||||
|
|
||||||
|
install(CODE "include(BundleUtilities)
|
||||||
|
fixup_bundle(\"${APPS}\" \"${QT_PLUGINS}\" \"${DIRS}\")")
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user