1
0
mirror of synced 2024-11-30 18:34:29 +01:00

build: Replace -WIP version suffix with .WIP

This commit is contained in:
WerWolv 2024-06-05 20:59:48 +02:00
parent 0e757e5fb1
commit c217b1b100
5 changed files with 15 additions and 4 deletions

View File

@ -35,8 +35,7 @@ set(CMAKE_INCLUDE_DIRECTORIES_BEFORE ON)
include("${IMHEX_BASE_FOLDER}/cmake/build_helpers.cmake")
# Setup project
loadVersion(IMHEX_VERSION)
string(REPLACE "-WIP" "" IMHEX_VERSION_PLAIN ${IMHEX_VERSION})
loadVersion(IMHEX_VERSION IMHEX_VERSION_PLAIN)
setVariableInParent(IMHEX_VERSION ${IMHEX_VERSION})
configureCMake()

View File

@ -1 +1 @@
1.35.0-WIP
1.35.0.WIP

View File

@ -397,12 +397,14 @@ macro(setDefaultBuiltTypeIfUnset)
endif()
endmacro()
function(loadVersion version)
function(loadVersion version plain_version)
set(VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/VERSION")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${VERSION_FILE})
file(READ "${VERSION_FILE}" read_version)
string(STRIP ${read_version} read_version)
string(REPLACE ".WIP" "" read_version_plain ${read_version})
set(${version} ${read_version} PARENT_SCOPE)
set(${plain_version} ${read_version_plain} PARENT_SCOPE)
endfunction()
function(detectBadClone)

View File

@ -632,6 +632,12 @@ namespace hex {
*/
bool isDebugBuild();
/**
* @brief Checks if this version of ImHex is a nightly build
* @return True if this version is a nightly, false if it's a release
*/
bool isNightlyBuild();
enum class UpdateType {
Stable,
Nightly

View File

@ -805,6 +805,10 @@ namespace hex {
#endif
}
bool isNightly() {
return getImHexVersion(false).ends_with("WIP");
}
bool updateImHex(UpdateType updateType) {
// Get the path of the updater executable
std::fs::path executablePath;