Skip to content

Commit

Permalink
Replace VERSIONINFO resource cmake macro (#1449)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrolcl authored Dec 10, 2024
1 parent e604d9e commit 3eaf722
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 239 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FluidSynth - A Software Synthesizer
#
# Copyright (C) 2003-2023 Peter Hanappe and others.
# Copyright (C) 2003-2024 Peter Hanappe and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
Expand Down
79 changes: 0 additions & 79 deletions cmake_admin/VersionInfo.in

This file was deleted.

37 changes: 0 additions & 37 deletions cmake_admin/VersionResource.rc

This file was deleted.

35 changes: 35 additions & 0 deletions cmake_admin/VersionResource.rc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "winver.h"

VS_VERSION_INFO VERSIONINFO
FILEVERSION @FLUIDSYNTH_VERSION_MAJOR@, @FLUIDSYNTH_VERSION_MINOR@, @FLUIDSYNTH_VERSION_MICRO@
PRODUCTVERSION @FLUIDSYNTH_VERSION_MAJOR@, @FLUIDSYNTH_VERSION_MINOR@, @FLUIDSYNTH_VERSION_MICRO@, 0
#ifdef DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE @TARGET_TYPE@
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "FluidSynth"
VALUE "FileDescription", "FluidSynth - A Software Synthesizer"
VALUE "FileVersion", "@FLUIDSYNTH_VERSION_MAJOR@.@FLUIDSYNTH_VERSION_MINOR@.@FLUIDSYNTH_VERSION_MICRO@"
VALUE "Full Version", "@FLUIDSYNTH_VERSION_MAJOR@.@FLUIDSYNTH_VERSION_MINOR@.@[email protected]"
VALUE "InternalName", "FluidSynth"
VALUE "ProductName", "@PRODUCT_NAME@"
VALUE "LegalCopyright", "Copyright (C) 2003-2024 Peter Hanappe and others. Licensed under the terms of the LGPL v2.1"
VALUE "OriginalFilename", "@TARGET_FILENAME@"
VALUE "ProductVersion", "@FLUIDSYNTH_VERSION_MAJOR@.@FLUIDSYNTH_VERSION_MINOR@.@FLUIDSYNTH_VERSION_MICRO@"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END

107 changes: 0 additions & 107 deletions cmake_admin/generate_product_version.cmake

This file was deleted.

30 changes: 15 additions & 15 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FluidSynth - A Software Synthesizer
#
# Copyright (C) 2003-2010 Peter Hanappe and others.
# Copyright (C) 2003-2024 Peter Hanappe and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -211,20 +211,11 @@ configure_file ( ${FluidSynth_SOURCE_DIR}/include/fluidsynth.cmake
${public_main_HEADER} )

if ( WIN32 )
include(generate_product_version)
generate_product_version(
VersionFilesOutputVariable
NAME "Fluidsynth"
BUNDLE "Fluidsynth"
VERSION_MAJOR ${FLUIDSYNTH_VERSION_MAJOR}
VERSION_MINOR ${FLUIDSYNTH_VERSION_MINOR}
VERSION_PATCH ${FLUIDSYNTH_VERSION_MICRO}
VERSION_REVISION 0
COMMENTS "Fluidsynth"
COMPANY_NAME "Fluidsynth LGPL"
ORIGINAL_FILENAME "libfluidsynth.dll"
FILE_DESCRIPTION "Fluidsynth"
)
set(TARGET_TYPE "VFT_DLL")
set(TARGET_FILENAME "libfluidsynth-${LIB_VERSION_CURRENT}.dll")
set(PRODUCT_NAME "FluidSynth Library")
set(VersionFilesOutputVariable "${FluidSynth_BINARY_DIR}/src/VersionInfoLib.rc")
configure_file(${FluidSynth_SOURCE_DIR}/cmake_admin/VersionResource.rc.in ${VersionFilesOutputVariable} @ONLY)
endif ( WIN32 )

add_library ( libfluidsynth-OBJ OBJECT
Expand Down Expand Up @@ -449,8 +440,17 @@ if ( WASAPI_SUPPORT )
set ( fluidsynth_SOURCES ${fluidsynth_SOURCES} fluid_wasapi_device_enumerate.c )
endif ( WASAPI_SUPPORT )

if ( WIN32 )
set(TARGET_TYPE "VFT_APP")
set(TARGET_FILENAME "fluidsynth.exe")
set(PRODUCT_NAME "FluidSynth CLI")
set(VersionFilesOutputVariable "${FluidSynth_BINARY_DIR}/src/VersionInfo.rc")
configure_file(${FluidSynth_SOURCE_DIR}/cmake_admin/VersionResource.rc.in ${VersionFilesOutputVariable} @ONLY)
endif ( WIN32 )

add_executable ( fluidsynth
${fluidsynth_SOURCES}
${VersionFilesOutputVariable}
)

set_target_properties ( fluidsynth
Expand Down

0 comments on commit 3eaf722

Please sign in to comment.