#6497 Fixed problem with windows version variables not working in cmd

This commit is contained in:
Jnewbon 2019-05-09 17:52:59 +01:00 committed by GitHub
parent e412cd2189
commit 8c0101405a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

2
.gitignore vendored
View File

@ -22,3 +22,5 @@ src/setup/win32/synergy.suo
/.idea
/cmake-build-debug
/CMakeLists.txt.user
/.vs
/CMakeLists.txt.*

View File

@ -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)