From 0db7268f5b81f39a4126782c2fef4282c2e75dd8 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sat, 15 Feb 2020 18:43:28 +0800 Subject: Make resource files for Windows actually work. --- midifmt-plugin/CMakeLists.txt | 4 +++- midifmt-plugin/midifmt-plugin.rc | 16 -------------- midifmt-plugin/midifmt-plugin.rc.in | 24 ++++++++++++++++++++ qmidiplayer-desktop/CMakeLists.txt | 4 +++- qmidiplayer-desktop/qmidiplayer.rc | 18 --------------- qmidiplayer-desktop/qmidiplayer.rc.in | 29 +++++++++++++++++++++++++ simple-visualization/CMakeLists.txt | 4 +++- simple-visualization/simple-visualization.rc | 16 -------------- simple-visualization/simple-visualization.rc.in | 24 ++++++++++++++++++++ visualization/CMakeLists.txt | 4 +++- visualization/visualization.rc | 16 -------------- visualization/visualization.rc.in | 24 ++++++++++++++++++++ 12 files changed, 113 insertions(+), 70 deletions(-) delete mode 100644 midifmt-plugin/midifmt-plugin.rc create mode 100644 midifmt-plugin/midifmt-plugin.rc.in delete mode 100644 qmidiplayer-desktop/qmidiplayer.rc create mode 100644 qmidiplayer-desktop/qmidiplayer.rc.in delete mode 100644 simple-visualization/simple-visualization.rc create mode 100644 simple-visualization/simple-visualization.rc.in delete mode 100644 visualization/visualization.rc create mode 100644 visualization/visualization.rc.in diff --git a/midifmt-plugin/CMakeLists.txt b/midifmt-plugin/CMakeLists.txt index d90ffe8..2b58b0b 100644 --- a/midifmt-plugin/CMakeLists.txt +++ b/midifmt-plugin/CMakeLists.txt @@ -4,7 +4,9 @@ set(midifmt-plugin_SOURCES ) if(WIN32) - list(APPEND midifmt-plugin_SOURCES midifmt-plugin.rc) + get_filename_component(CURRENT_SUBPROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME) + configure_file("midifmt-plugin.rc.in" "midifmt-plugin.rc" @ONLY) + list(APPEND midifmt-plugin_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/midifmt-plugin.rc) endif(WIN32) include_directories(${PROJECT_SOURCE_DIR}/include/) diff --git a/midifmt-plugin/midifmt-plugin.rc b/midifmt-plugin/midifmt-plugin.rc deleted file mode 100644 index 3489340..0000000 --- a/midifmt-plugin/midifmt-plugin.rc +++ /dev/null @@ -1,16 +0,0 @@ -1 VERSIONINFO -FILEVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0 -PRODUCTVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0 -FILETYPE VFT_DLL -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904E4"" - BEGIN - VALUE "FileDescription", "QMidiPlayer extra MIDI format support plugin" - VALUE "FileVersion", APP_VERSION - VALUE "ProductName", "QMidiPlayer extra MIDI format support plugin" - VALUE "ProductVersion", APP_VERSION - END - END -END diff --git a/midifmt-plugin/midifmt-plugin.rc.in b/midifmt-plugin/midifmt-plugin.rc.in new file mode 100644 index 0000000..2ec0d95 --- /dev/null +++ b/midifmt-plugin/midifmt-plugin.rc.in @@ -0,0 +1,24 @@ +1 VERSIONINFO +FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 +PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 +FILETYPE 2 //VFT_DLL +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Chris Xiong\0" + VALUE "FileDescription", "QMidiPlayer extra MIDI format support plugin\0" + VALUE "FileVersion", "@PROJECT_VERSION@\0" + VALUE "InternalName", "@CURRENT_SUBPROJECT@\0" + VALUE "LegalCopyright", "GPLv3 (Chris Xiong)" + VALUE "OriginalFilename", "libmidifmt-plugin.dll\0" + VALUE "ProductName", "QMidiPlayer extra MIDI format support plugin\0" + VALUE "ProductVersion", "@PROJECT_VERSION@\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/qmidiplayer-desktop/CMakeLists.txt b/qmidiplayer-desktop/CMakeLists.txt index 037a3f1..9d285c3 100644 --- a/qmidiplayer-desktop/CMakeLists.txt +++ b/qmidiplayer-desktop/CMakeLists.txt @@ -44,7 +44,9 @@ set(qmpdesktop_SOURCES ) if(WIN32) - list(APPEND qmpdesktop_SOURCES qmidiplayer.rc) + get_filename_component(CURRENT_SUBPROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME) + configure_file("qmidiplayer.rc.in" "qmidiplayer.rc" @ONLY) + list(APPEND qmpdesktop_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/qmidiplayer.rc) endif(WIN32) set(CMAKE_AUTOMOC ON) diff --git a/qmidiplayer-desktop/qmidiplayer.rc b/qmidiplayer-desktop/qmidiplayer.rc deleted file mode 100644 index ee00a3d..0000000 --- a/qmidiplayer-desktop/qmidiplayer.rc +++ /dev/null @@ -1,18 +0,0 @@ -IDI_ICON1 ICON "../img/qmidiplayer.ico" -1 VERSIONINFO -FILEVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0 -PRODUCTVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0 -FILETYPE VFT_APP -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904E4"" - BEGIN - VALUE "FileDescription", "QMidiPlayer" - VALUE "FileVersion", APP_VERSION - VALUE "ProductName", "QMidiPlayer" - VALUE "ProductVersion", APP_VERSION - END - END -END -1 RT_MANIFEST "qmidiplayer.exe.xml" diff --git a/qmidiplayer-desktop/qmidiplayer.rc.in b/qmidiplayer-desktop/qmidiplayer.rc.in new file mode 100644 index 0000000..c5c268c --- /dev/null +++ b/qmidiplayer-desktop/qmidiplayer.rc.in @@ -0,0 +1,29 @@ +#ifndef RT_MANIFEST +#define RT_MANIFEST 24 +#endif +IDI_ICON1 ICON "../img/qmidiplayer.ico" +1 VERSIONINFO +FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 +PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 +FILETYPE 1 //VFT_APP +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Chris Xiong\0" + VALUE "FileDescription", "QMidiPlayer\0" + VALUE "FileVersion", "@PROJECT_VERSION@\0" + VALUE "InternalName", "@CURRENT_SUBPROJECT@\0" + VALUE "LegalCopyright", "GPLv3 (Chris Xiong)" + VALUE "OriginalFilename", "qmidiplayer.exe\0" + VALUE "ProductName", "QMidiPlayer\0" + VALUE "ProductVersion", "@PROJECT_VERSION@\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END +1 RT_MANIFEST "qmidiplayer.exe.xml" diff --git a/simple-visualization/CMakeLists.txt b/simple-visualization/CMakeLists.txt index 689dd99..9966c31 100644 --- a/simple-visualization/CMakeLists.txt +++ b/simple-visualization/CMakeLists.txt @@ -8,7 +8,9 @@ set(simple-visualization_SOURCES ) if(WIN32) - list(APPEND simple-visualization_SOURCES simple-visualization.rc) + get_filename_component(CURRENT_SUBPROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME) + configure_file("simple-visualization.rc.in" "simple-visualization.rc" @ONLY) + list(APPEND simple-visualization_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/simple-visualization.rc) endif(WIN32) set(CMAKE_AUTOMOC ON) diff --git a/simple-visualization/simple-visualization.rc b/simple-visualization/simple-visualization.rc deleted file mode 100644 index 92f11e6..0000000 --- a/simple-visualization/simple-visualization.rc +++ /dev/null @@ -1,16 +0,0 @@ -1 VERSIONINFO -FILEVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0 -PRODUCTVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0 -FILETYPE VFT_DLL -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904E4"" - BEGIN - VALUE "FileDescription", "QMidiPlayer simple visualization plugin" - VALUE "FileVersion", APP_VERSION - VALUE "ProductName", "QMidiPlayer simple visualization plugin" - VALUE "ProductVersion", APP_VERSION - END - END -END diff --git a/simple-visualization/simple-visualization.rc.in b/simple-visualization/simple-visualization.rc.in new file mode 100644 index 0000000..e98cecf --- /dev/null +++ b/simple-visualization/simple-visualization.rc.in @@ -0,0 +1,24 @@ +1 VERSIONINFO +FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 +PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 +FILETYPE 2 //VFT_DLL +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Chris Xiong\0" + VALUE "FileDescription", "QMidiPlayer simple visualization plugin\0" + VALUE "FileVersion", "@PROJECT_VERSION@\0" + VALUE "InternalName", "@CURRENT_SUBPROJECT@\0" + VALUE "LegalCopyright", "GPLv3 (Chris Xiong)" + VALUE "OriginalFilename", "libsimple-visualization.dll\0" + VALUE "ProductName", "QMidiPlayer simple visualization plugin\0" + VALUE "ProductVersion", "@PROJECT_VERSION@\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/visualization/CMakeLists.txt b/visualization/CMakeLists.txt index bc7d568..678f4a7 100644 --- a/visualization/CMakeLists.txt +++ b/visualization/CMakeLists.txt @@ -8,7 +8,9 @@ set(visualization_SOURCES ) if(WIN32) - list(APPEND visualization_SOURCES visualization.rc) + get_filename_component(CURRENT_SUBPROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME) + configure_file("visualization.rc.in" "visualization.rc" @ONLY) + list(APPEND visualization_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/visualization.rc) endif(WIN32) set(BUILD_DUMB ON) diff --git a/visualization/visualization.rc b/visualization/visualization.rc deleted file mode 100644 index d5b47db..0000000 --- a/visualization/visualization.rc +++ /dev/null @@ -1,16 +0,0 @@ -1 VERSIONINFO -FILEVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0 -PRODUCTVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0 -FILETYPE VFT_DLL -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904E4"" - BEGIN - VALUE "FileDescription", "QMidiPlayer visualization plugin" - VALUE "FileVersion", APP_VERSION - VALUE "ProductName", "QMidiPlayer visualization plugin" - VALUE "ProductVersion", APP_VERSION - END - END -END diff --git a/visualization/visualization.rc.in b/visualization/visualization.rc.in new file mode 100644 index 0000000..a074fc8 --- /dev/null +++ b/visualization/visualization.rc.in @@ -0,0 +1,24 @@ +1 VERSIONINFO +FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 +PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 +FILETYPE 2 //VFT_DLL +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Chris Xiong\0" + VALUE "FileDescription", "QMidiPlayer visualization plugin\0" + VALUE "FileVersion", "@PROJECT_VERSION@\0" + VALUE "InternalName", "@CURRENT_SUBPROJECT@\0" + VALUE "LegalCopyright", "GPLv3 (Chris Xiong)" + VALUE "OriginalFilename", "libvisualization.dll\0" + VALUE "ProductName", "QMidiPlayer visualization plugin\0" + VALUE "ProductVersion", "@PROJECT_VERSION@\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END -- cgit v1.2.3