forked from simulationcraft/simc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use CPack to create a release package on windows (simulationcraft#6501)
Tries to mirror the current nightly to some degree (Version number separator is different), and also better structures windeployqt
- Loading branch information
Showing
5 changed files
with
84 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Use Cpack for packaging Simc | ||
# This can be used to package eg. a nightly release | ||
|
||
# Parse version from config file | ||
file(READ "${PROJECT_SOURCE_DIR}/engine/config.hpp" SC_CONFIG_FILE_CONTENT) | ||
string(REGEX MATCH "SC_MAJOR_VERSION \"([0-9]*)\"" SC_MAJOR_VERSION_MATCH ${SC_CONFIG_FILE_CONTENT}) | ||
if (SC_MAJOR_VERSION_MATCH) | ||
message(VERBOSE "Simc major version: ${CMAKE_MATCH_1}") | ||
set(CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_MATCH_1}) | ||
endif() | ||
string(REGEX MATCH "SC_MINOR_VERSION \"([0-9]*)\"" SC_MINOR_VERSION_MATCH ${SC_CONFIG_FILE_CONTENT}) | ||
if (SC_MINOR_VERSION_MATCH) | ||
message(VERBOSE "Simc minor version: ${CMAKE_MATCH_1}") | ||
set(CPACK_PACKAGE_VERSION_MINOR ${CMAKE_MATCH_1}) | ||
endif() | ||
message(VERBOSE "Simc git hash: ${GIT_COMMIT_HASH}") | ||
set(CPACK_PACKAGE_VERSION_PATCH ${GIT_COMMIT_HASH}) | ||
|
||
# Global options | ||
set(CPACK_PACKAGE_VENDOR "SimulationCraft") | ||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md") | ||
set(CPACK_PACKAGE_HOMEPAGE_URL "https://www.simulationcraft.org/") | ||
set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/qt/icon/Simcraft2.ico") | ||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") | ||
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md") | ||
|
||
if(WIN32) | ||
set(CPACK_GENERATOR "7Z") | ||
endif() | ||
|
||
include(CPack) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
function(windeployqt target) | ||
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}" REQUIRED) | ||
|
||
# Bundle Library Files | ||
if(CMAKE_BUILD_TYPE_UPPER STREQUAL "DEBUG") | ||
set(WINDEPLOYQT_ARGS --debug) | ||
else() | ||
set(WINDEPLOYQT_ARGS --release) | ||
endif() | ||
|
||
message(VERBOSE "WINDEPLOYQT_EXECUTABLE ${WINDEPLOYQT_EXECUTABLE}") | ||
|
||
add_custom_command(TARGET ${target} POST_BUILD | ||
COMMAND "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/winqt/" | ||
COMMAND "${CMAKE_COMMAND}" -E | ||
env PATH="${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}" | ||
${WINDEPLOYQT_ARGS} | ||
--verbose 0 | ||
--no-compiler-runtime | ||
--no-translations | ||
--dir "${CMAKE_CURRENT_BINARY_DIR}/winqt/" | ||
$<TARGET_FILE:${target}> | ||
COMMENT "Deploying Qt..." | ||
) | ||
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/winqt/" DESTINATION ${SIMC_INSTALL_BIN}) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters