diff options
author | Robert Adam <dev@robert-adam.de> | 2020-09-02 10:22:16 +0300 |
---|---|---|
committer | Robert Adam <dev@robert-adam.de> | 2020-09-02 19:30:33 +0300 |
commit | 40090d297f03977906557d4dfd2fd29067cf680d (patch) | |
tree | 51c2686d81d88e7ee46a8d728c01c4f3b4fab3d6 /overlay | |
parent | 8bdf32d4808135e8e8d6cba004e36b4a6ead0f42 (diff) |
MAINT: Make use of cmake configure for version
Instead of having to change the version number and the build year in all
those files manually, we let cmake do the work by replacing the
respective values in templates.
Diffstat (limited to 'overlay')
-rw-r--r-- | overlay/CMakeLists.txt | 8 | ||||
-rw-r--r-- | overlay/mumble_ol.rc.in (renamed from overlay/mumble_ol.rc) | 2 | ||||
-rw-r--r-- | overlay/overlay_exe/CMakeLists.txt | 8 | ||||
-rw-r--r-- | overlay/overlay_exe/overlay_exe.rc.in (renamed from overlay/overlay_exe/overlay_exe.rc) | 16 |
4 files changed, 17 insertions, 17 deletions
diff --git a/overlay/CMakeLists.txt b/overlay/CMakeLists.txt index 6cb1e85cf..e46a49fc3 100644 --- a/overlay/CMakeLists.txt +++ b/overlay/CMakeLists.txt @@ -25,7 +25,9 @@ set(COMPILED_DX11_PIXEL_SHADERS "overlay11.ps.h") set(COMPILED_DX11_VERTEX_SHADERS "overlay11.vs.h") set(COMPILED_EFFECTS "overlay.hex") -set(OVERLAY_RC "mumble_ol.rc") +set(OVERLAY_RC "${CMAKE_CURRENT_BINARY_DIR}/mumble_ol.rc") + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mumble_ol.rc.in" "${OVERLAY_RC}") # We save the output name in a variable because it's used by configure_file() if(64_BIT AND NOT BUILD_OVERLAY_XCOMPILE) @@ -38,8 +40,6 @@ remove_definitions("-DUNICODE") add_library(overlay SHARED) -configure_file(${OVERLAY_RC} ${CMAKE_CURRENT_BINARY_DIR}) - find_program(FXC "fxc" DOC "Effect-Compiler tool") if(NOT FXC) message(FATAL_ERROR "Effect-Compiler tool not found!") @@ -102,7 +102,7 @@ target_sources(overlay "overlay_launchers.h" "overlay_whitelist.h" - "${CMAKE_CURRENT_BINARY_DIR}/${OVERLAY_RC}" + "${OVERLAY_RC}" ) set_target_properties(overlay PROPERTIES OUTPUT_NAME ${OUTPUT_NAME}) diff --git a/overlay/mumble_ol.rc b/overlay/mumble_ol.rc.in index 19f5ee188..065d64cf0 100644 --- a/overlay/mumble_ol.rc +++ b/overlay/mumble_ol.rc.in @@ -34,7 +34,7 @@ VS_VERSION_INFO VERSIONINFO VALUE "FileDescription", "Mumble - Low-latency VoIP client" VALUE "FileVersion", "@PROJECT_VERSION@" VALUE "ProductVersion", "@PROJECT_VERSION@" - VALUE "LegalCopyright", "Copyright (c) 2005-2020 The Mumble Developers" + VALUE "LegalCopyright", "Copyright (c) 2005-@MUMBLE_BUILD_YEAR@ The Mumble Developers" VALUE "OriginalFilename", "@OUTPUT_NAME@" VALUE "ProductName", "Mumble" #ifdef SNAPSHOT_BUILD diff --git a/overlay/overlay_exe/CMakeLists.txt b/overlay/overlay_exe/CMakeLists.txt index 51e8f165b..cb32ff33f 100644 --- a/overlay/overlay_exe/CMakeLists.txt +++ b/overlay/overlay_exe/CMakeLists.txt @@ -3,7 +3,9 @@ # that can be found in the LICENSE file at the root of the # Mumble source tree or at <https://www.mumble.info/LICENSE>. -set(OVERLAY_EXE_RC "overlay_exe.rc") +set(OVERLAY_EXE_RC "${CMAKE_CURRENT_BINARY_DIR}/overlay_exe.rc") + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/overlay_exe.rc.in" "${OVERLAY_EXE_RC}") add_definitions("-DUNICODE" "-DWIN32_LEAN_AND_MEAN") @@ -18,14 +20,12 @@ if(NOT BUILD_OVERLAY_XCOMPILE) get_target_property(MUMBLE_SOURCE_DIR mumble SOURCE_DIR) endif() -configure_file(${OVERLAY_EXE_RC} ${CMAKE_CURRENT_BINARY_DIR}) - add_executable(overlay_exe WIN32 "overlay_exe.cpp" "overlay_exe.h" "${MUMBLE_SOURCE_DIR}/mumble.appcompat.manifest" - "${CMAKE_CURRENT_BINARY_DIR}/${OVERLAY_EXE_RC}" + "${OVERLAY_EXE_RC}" ) set_target_properties(overlay_exe PROPERTIES OUTPUT_NAME ${OUTPUT_NAME}) diff --git a/overlay/overlay_exe/overlay_exe.rc b/overlay/overlay_exe/overlay_exe.rc.in index e4a48358c..b3ab0ace5 100644 --- a/overlay/overlay_exe/overlay_exe.rc +++ b/overlay/overlay_exe/overlay_exe.rc.in @@ -18,13 +18,13 @@ #endif VS_VERSION_INFO VERSIONINFO - FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 - PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 - FILEFLAGSMASK VS_FFI_FILEFLAGSMASK - FILEFLAGS (VER_DEBUG|VER_RELEASE) - FILEOS VOS_NT_WINDOWS32 - FILETYPE VFT_APP - FILESUBTYPE 0L + FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 + PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS (VER_DEBUG|VER_RELEASE) + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0L BEGIN BLOCK "StringFileInfo" BEGIN @@ -34,7 +34,7 @@ VS_VERSION_INFO VERSIONINFO VALUE "FileDescription", "Mumble - Low-latency VoIP client" VALUE "FileVersion", "@PROJECT_VERSION@" VALUE "ProductVersion", "@PROJECT_VERSION@" - VALUE "LegalCopyright", "Copyright (c) 2005-2020 The Mumble Developers" + VALUE "LegalCopyright", "Copyright (c) 2005-@MUMBLE_BUILD_YEAR@ The Mumble Developers" VALUE "OriginalFilename", "@OUTPUT_NAME@" VALUE "ProductName", "Mumble" #ifdef SNAPSHOT_BUILD |