From 8c0101405ac8ceee9338f5c5fe287c989b5c3bcf Mon Sep 17 00:00:00 2001 From: Jnewbon <48688400+Jnewbon@users.noreply.github.com> Date: Thu, 9 May 2019 17:52:59 +0100 Subject: [PATCH] #6497 Fixed problem with windows version variables not working in cmd --- .gitignore | 2 ++ CMakeLists.txt | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 1c985260..230d632f 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ src/setup/win32/synergy.suo /.idea /cmake-build-debug /CMakeLists.txt.user +/.vs +/CMakeLists.txt.* diff --git a/CMakeLists.txt b/CMakeLists.txt index bf9eecbe..6c75ee5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -344,11 +344,11 @@ macro(generate_versionfile) "export SYNERGY_VERSION_PATCH=\"${SYNERGY_VERSION_PATCH}\"\n" "export SYNERGY_VERSION_STAGE=\"${SYNERGY_VERSION_STAGE}\"\n") elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - FILE(WRITE ${CMAKE_BINARY_DIR}/version - "$env:SYNERGY_VERSION_MAJOR=\"${SYNERGY_VERSION_MAJOR}\"\n" - "$env:SYNERGY_VERSION_MINOR=\"${SYNERGY_VERSION_MINOR}\"\n" - "$env:SYNERGY_VERSION_PATCH=\"${SYNERGY_VERSION_PATCH}\"\n" - "$env:SYNERGY_VERSION_STAGE=\"${SYNERGY_VERSION_STAGE}\"\n") + FILE(WRITE ${CMAKE_BINARY_DIR}/version.bat + "SET SYNERGY_VERSION_MAJOR=\"${SYNERGY_VERSION_MAJOR}\"\n" + "SET SYNERGY_VERSION_MINOR=\"${SYNERGY_VERSION_MINOR}\"\n" + "SET SYNERGY_VERSION_PATCH=\"${SYNERGY_VERSION_PATCH}\"\n" + "SET SYNERGY_VERSION_STAGE=\"${SYNERGY_VERSION_STAGE}\"\n") endif() endmacro(generate_versionfile)