From b12a1cb53e34a76bf31a42579008aba506d04f21 Mon Sep 17 00:00:00 2001 From: Trihedraf Date: Fri, 19 Feb 2021 22:48:19 -0800 Subject: [PATCH] add CPack zips for Windows --- .circleci/config.yml | 4 +++ CMake/mingwcc64.cmake | 1 + CMakeLists.txt | 76 ++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 80 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 91a3a01a7..85f5d949c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -66,7 +66,9 @@ jobs: - run: Packaging/windows/mingw-prep.sh - run: cmake -S. -Bbuild -DNIGHTLY_BUILD=ON -DCMAKE_TOOLCHAIN_FILE=../CMake/mingwcc.cmake - run: cmake --build build -j $(nproc) + - run: cmake --build build --target package - store_artifacts: {path: ./build/devilutionx.exe, destination: devilutionx_x86.exe} + - store_artifacts: {path: ./build/devilutionx.zip, destination: devilutionx_x86.zip} windows_x64: docker: - image: ubuntu:20.04 @@ -82,7 +84,9 @@ jobs: - run: Packaging/windows/mingw-prep64.sh - run: cmake -S. -Bbuild -DNIGHTLY_BUILD=ON -DCMAKE_TOOLCHAIN_FILE=../CMake/mingwcc64.cmake - run: cmake --build build -j $(nproc) + - run: cmake --build build --target package - store_artifacts: {path: ./build/devilutionx.exe, destination: devilutionx_x64.exe} + - store_artifacts: {path: ./build/devilutionx.zip, destination: devilutionx_x64.zip} switch: docker: - image: devkitpro/devkita64:20200528 diff --git a/CMake/mingwcc64.cmake b/CMake/mingwcc64.cmake index 198ef6c63..4af1313f7 100644 --- a/CMake/mingwcc64.cmake +++ b/CMake/mingwcc64.cmake @@ -17,3 +17,4 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +SET(SYSTEM_BITS x64) \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index e80b52afa..3e90470aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -615,7 +615,81 @@ if(SWITCH) endif() if(CPACK) - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + if(NOT SYSTEM_BITS MATCHES x64 AND WIN32) + set(CPACK_PACKAGE_FILE_NAME "devilutionx") + set(CPACK_PACKAGE_NAME ${project_name}) + set(CPACK_GENERATOR "ZIP") + set(CPACK_STRIP_FILES TRUE) + install(TARGETS ${BIN_TARGET} DESTINATION .) + install(FILES "${PROJECT_SOURCE_DIR}/Packaging/windows/README.txt" + DESTINATION "." + ) + install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/CharisSILB.ttf" + DESTINATION "." + ) + install(FILES "~/repo/SDL2_ttf-2.0.15/i686-w64-mingw32/bin/libfreetype-6.dll" + DESTINATION "." + ) + install(FILES "~/repo/SDL2-2.0.9/i686-w64-mingw32/bin/SDL2.dll" + DESTINATION "." + ) + install(FILES "~/repo/SDL2_mixer-2.0.4/i686-w64-mingw32/bin/SDL2_mixer.dll" + DESTINATION "." + ) + install(FILES "~/repo/SDL2_ttf-2.0.15/i686-w64-mingw32/bin/SDL2_ttf.dll" + DESTINATION "." + ) + install(FILES "~/repo/SDL2_ttf-2.0.15/i686-w64-mingw32/bin/zlib1.dll" + DESTINATION "." + ) + install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/LICENSE.CharisSILB.txt" + DESTINATION "LICENSE" + ) + install(FILES "~/repo/SDL2_ttf-2.0.15/i686-w64-mingw32/bin/LICENSE.freetype.txt" + DESTINATION "LICENSE" + ) + install(FILES "~/repo/SDL2-2.0.9/README-SDL.txt" + DESTINATION "LICENSE" + ) + + elseif(SYSTEM_BITS MATCHES x64 AND WIN32) + set(CPACK_PACKAGE_FILE_NAME "devilutionx") + set(CPACK_PACKAGE_NAME ${project_name}) + set(CPACK_GENERATOR "ZIP") + set(CPACK_STRIP_FILES TRUE) + install(TARGETS ${BIN_TARGET} DESTINATION .) + install(FILES "${PROJECT_SOURCE_DIR}/Packaging/windows/README.txt" + DESTINATION "." + ) + install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/CharisSILB.ttf" + DESTINATION "." + ) + install(FILES "~/repo/SDL2_ttf-2.0.15/x86_64-w64-mingw32/bin/libfreetype-6.dll" + DESTINATION "." + ) + install(FILES "~/repo/SDL2-2.0.9/x86_64-w64-mingw32/bin/SDL2.dll" + DESTINATION "." + ) + install(FILES "~/repo/SDL2_mixer-2.0.4/x86_64-w64-mingw32/bin/SDL2_mixer.dll" + DESTINATION "." + ) + install(FILES "~/repo/SDL2_ttf-2.0.15/x86_64-w64-mingw32/bin/SDL2_ttf.dll" + DESTINATION "." + ) + install(FILES "~/repo/SDL2_ttf-2.0.15/x86_64-w64-mingw32/bin/zlib1.dll" + DESTINATION "." + ) + install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/LICENSE.CharisSILB.txt" + DESTINATION "LICENSE" + ) + install(FILES "~/repo/SDL2_ttf-2.0.15/x86_64-w64-mingw32/bin/LICENSE.freetype.txt" + DESTINATION "LICENSE" + ) + install(FILES "~/repo/SDL2-2.0.9/README-SDL.txt" + DESTINATION "LICENSE" + ) + + elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") string(TOLOWER ${PROJECT_NAME} project_name) set(CPACK_PACKAGE_NAME ${project_name}) set(CPACK_GENERATOR "7Z")