diff options
| author | Christoph Berg <myon@debian.org> | 2026-06-22 12:03:44 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2026-06-22 12:03:44 +0200 |
| commit | d83a420f0517d7fc47aeb288a6a0cf4891784fcc (patch) | |
| tree | 6d9c83527c56458a8360ba080bf5f4ca73d526dc /CMake/Modules | |
| parent | 4b089ae3f7e9e2d5662f718f663b26a4e8ee63ca (diff) | |
New upstream version 3.0.2+dfsgupstream/3.0.2+dfsg
Diffstat (limited to 'CMake/Modules')
| -rw-r--r-- | CMake/Modules/NSIS.template.in | 16 | ||||
| -rw-r--r-- | CMake/Modules/generate_version_info.cmake | 2 | ||||
| -rw-r--r-- | CMake/Modules/set_build_type.cmake | 38 |
3 files changed, 50 insertions, 6 deletions
diff --git a/CMake/Modules/NSIS.template.in b/CMake/Modules/NSIS.template.in index 9e171e28..b14a8623 100644 --- a/CMake/Modules/NSIS.template.in +++ b/CMake/Modules/NSIS.template.in @@ -970,6 +970,22 @@ SectionEnd ; "Program Files" for AllUsers, "My Documents" for JustMe... Function .onInit + ; --- WSJT-X running-process check (custom) --- + ; Abort cleanly if WSJT-X is already running, to avoid a half-installed + ; mess when the user upgrades over a live instance. Uses tasklist+findstr + ; (built into every supported Windows version) so no NSIS plugin is + ; required. + wsjtx_running_check: + nsExec::Exec '"$SYSDIR\cmd.exe" /c tasklist /FI "IMAGENAME eq wsjtx.exe" 2>NUL | $SYSDIR\findstr.exe /I "wsjtx.exe" >NUL' + Pop $0 + ${If} $0 == "0" + MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION \ + "WSJT-X is currently running. $\n$\nPlease close it before installing or upgrading." \ + /SD IDCANCEL IDRETRY wsjtx_running_check + Abort + ${EndIf} + ; --- end WSJT-X running-process check --- + Push $0 Push $1 Push $2 diff --git a/CMake/Modules/generate_version_info.cmake b/CMake/Modules/generate_version_info.cmake index b746aaba..4fc6c4a4 100644 --- a/CMake/Modules/generate_version_info.cmake +++ b/CMake/Modules/generate_version_info.cmake @@ -115,7 +115,7 @@ function(generate_version_info outfiles) endif() endif() - if (NOT PROJECT_VERSION_REVISION AND BUILD_TYPE_REVISION) + if (NOT PRODUCT_VERSION_REVISION AND BUILD_TYPE_REVISION) set (PRODUCT_VERSION_REVISION ${BUILD_TYPE_REVISION}) endif () diff --git a/CMake/Modules/set_build_type.cmake b/CMake/Modules/set_build_type.cmake index 1f1f1273..9305c0e7 100644 --- a/CMake/Modules/set_build_type.cmake +++ b/CMake/Modules/set_build_type.cmake @@ -20,6 +20,10 @@ include (CMakeParseArguments) # variable BUIlD_TYPE_REVISION is unset. # macro (set_build_type) + set (WSJT_RELEASE_CHANNEL "DEVEL" CACHE STRING "Build release channel: DEVEL, RC, or GA.") + set_property (CACHE WSJT_RELEASE_CHANNEL PROPERTY STRINGS DEVEL RC GA) + set (WSJT_RC_NUMBER "" CACHE STRING "Release candidate number used when WSJT_RELEASE_CHANNEL is RC.") + set (options GA) set (oneValueArgs RC) set (multiValueArgs) @@ -31,12 +35,36 @@ macro (set_build_type) if (BUILD_TYPE_GA AND BUILD_TYPE_RC) message (FATAL_ERROR "Only specify one build type from RC or GA.") endif () - if (NOT BUILD_TYPE_GA) - if (BUILD_TYPE_RC) - set (BUILD_TYPE_REVISION "-rc${BUILD_TYPE_RC}") + + string (TOUPPER "${WSJT_RELEASE_CHANNEL}" _WSJT_RELEASE_CHANNEL) + if (ARGC GREATER 0) + if (BUILD_TYPE_GA) + set (_WSJT_RELEASE_CHANNEL "GA") + elseif (BUILD_TYPE_RC) + if ("${BUILD_TYPE_RC}" STREQUAL "0") + set (_WSJT_RELEASE_CHANNEL "DEVEL") + else () + set (_WSJT_RELEASE_CHANNEL "RC") + set (WSJT_RC_NUMBER "${BUILD_TYPE_RC}") + endif () else () - set (BUILD_TYPE_REVISION "-devel") + set (_WSJT_RELEASE_CHANNEL "DEVEL") + endif () + endif () + + if (NOT _WSJT_RELEASE_CHANNEL MATCHES "^(DEVEL|RC|GA)$") + message (FATAL_ERROR "WSJT_RELEASE_CHANNEL must be DEVEL, RC, or GA; got \"${WSJT_RELEASE_CHANNEL}\".") + endif () + + set (BUILD_TYPE_REVISION "") + if (_WSJT_RELEASE_CHANNEL STREQUAL "DEVEL") + set (BUILD_TYPE_REVISION "-devel") + elseif (_WSJT_RELEASE_CHANNEL STREQUAL "RC") + if (NOT WSJT_RC_NUMBER MATCHES "^[1-9][0-9]*$") + message (FATAL_ERROR "WSJT_RC_NUMBER must be a positive integer when WSJT_RELEASE_CHANNEL is RC.") endif () + set (BUILD_TYPE_REVISION "-rc${WSJT_RC_NUMBER}") endif () - message (STATUS "Building ${PROJECT_NAME} v${PROJECT_VERSION}${BUILD_TYPE_REVISION}") + set (WSJT_RELEASE_CHANNEL "${_WSJT_RELEASE_CHANNEL}" CACHE STRING "Build release channel: DEVEL, RC, or GA." FORCE) + message (STATUS "Building ${PROJECT_NAME} v${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${BUILD_TYPE_REVISION}") endmacro () |
