• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision3f1b9d8c10477c1eb31fa3511abbb7c2f53175ea (tree)
Time2017-12-27 08:02:13
AuthorStarg <starg@user...>
CommiterStarg

Log Message

Improve version number system

Change Summary

Incremental Difference

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,26 @@ cmake_minimum_required(VERSION 3.9)
33
44 project(timidity41)
55
6+find_package(Git)
7+
8+if("${Git_FOUND}" AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
9+ add_custom_target(
10+ UpdateTim41Version
11+ COMMAND "${CMAKE_COMMAND}"
12+ -DGIT_EXECUTABLE="${GIT_EXECUTABLE}"
13+ -DINFILE="${CMAKE_CURRENT_SOURCE_DIR}/version.h.in"
14+ -DOUTFILE="${CMAKE_CURRENT_BINARY_DIR}/version.h"
15+ -P "${CMAKE_CURRENT_SOURCE_DIR}/WriteVersion.cmake"
16+ COMMENT "Updating version info..."
17+ )
18+else()
19+ set(tim41VersionStr "current")
20+ set(tim41Version3Comma "41,0,0")
21+ configure_file(version.h.in version.h)
22+endif()
23+
24+include_directories("${CMAKE_CURRENT_BINARY_DIR}")
25+
626 add_definitions(
727 # TiMidity++ common
828 -DRETSIGTYPE=int
--- /dev/null
+++ b/WriteVersion.cmake
@@ -0,0 +1,11 @@
1+
2+execute_process(
3+ COMMAND "${GIT_EXECUTABLE}" describe
4+ OUTPUT_VARIABLE gitDescribeResult
5+ OUTPUT_STRIP_TRAILING_WHITESPACE
6+)
7+
8+string(REPLACE "tim" "" tim41VersionStr "${gitDescribeResult}")
9+string(REGEX MATCH "[0-9.]+\\.[0-9.]+\\.[0-9.]+" tim41Version3 "${gitDescribeResult}")
10+string(REPLACE "." "," tim41Version3Comma "${tim41Version3}")
11+configure_file(${INFILE} ${OUTFILE})
--- a/interface/CMakeLists.txt
+++ b/interface/CMakeLists.txt
@@ -119,6 +119,7 @@ add_library(
119119 w32g_res.rc
120120 )
121121
122+add_dependencies(interface_w32g_res UpdateTim41Version)
122123 target_compile_definitions(interface_w32g_res PRIVATE -DIA_W32GUI -D__W32G__)
123124
124125 # for twsyng
@@ -140,4 +141,5 @@ add_library(
140141 w32g_res.rc
141142 )
142143
144+add_dependencies(interface_w32gsyn_res UpdateTim41Version)
143145 target_compile_definitions(interface_w32gsyn_res PRIVATE -DIA_W32G_SYN -D__W32G__ -DTWSYNG32)
--- a/interface/w32g_res.rc
+++ b/interface/w32g_res.rc
@@ -7,7 +7,7 @@
77 #include <richedit.h>
88 #include "w32g_res.h"
99 #include "afxres.h"
10-
10+#include "version.h"
1111
1212 1 RT_MANIFEST "w32g_visualstyle.manifest"
1313
@@ -3682,8 +3682,8 @@ IDI_ICON_TIMIDITY ICON "w32g_icon.ico"
36823682 //
36833683 LANGUAGE LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN
36843684 VS_VERSION_INFO VERSIONINFO
3685- FILEVERSION 2,13,0,0
3686- PRODUCTVERSION 2,13,0,0
3685+ FILEVERSION TIMID_VERSION4_COMMA
3686+ PRODUCTVERSION TIMID_VERSION4_COMMA
36873687 FILEOS VOS__WINDOWS32
36883688 FILETYPE VFT_APP
36893689 FILESUBTYPE VFT2_UNKNOWN
@@ -3697,14 +3697,20 @@ VS_VERSION_INFO VERSIONINFO
36973697 VALUE "Comments", "\0"
36983698 VALUE "CompanyName", "\0"
36993699 VALUE "FileDescription", "timw32g\0"
3700- VALUE "FileVersion", "2, 13, 0, 0\0"
3700+ VALUE "FileVersion", TIMID_VERSION_RESSTR
3701+#ifdef TWSYNG32
3702+ VALUE "InternalName", "twsyng\0"
3703+ VALUE "OriginalFilename", "twsyng.exe\0"
3704+ VALUE "ProductName", "TiMidity++ Win32GUI Synthesizer Version\0"
3705+#else
37013706 VALUE "InternalName", "timw32g\0"
3707+ VALUE "OriginalFilename", "timw32g.exe\0"
3708+ VALUE "ProductName", "TiMidity++ Win32GUI Version\0"
3709+#endif
37023710 VALUE "LegalCopyright", "Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp>\r\nCopyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>\0"
37033711 VALUE "LegalTrademarks", "\0"
3704- VALUE "OriginalFilename", "timw32g.exe\0"
37053712 VALUE "PrivateBuild", "\0"
3706- VALUE "ProductName", "TiMidity++ Win32GUI Version\0"
3707- VALUE "ProductVersion", "2, 13, 0, 0\0"
3713+ VALUE "ProductVersion", TIMID_VERSION
37083714 VALUE "SpecialBuild", "\0"
37093715 }
37103716 }
--- a/timidity/CMakeLists.txt
+++ b/timidity/CMakeLists.txt
@@ -1,7 +1,5 @@
11
22 add_definitions(
3- [[-DVERSION="41.0.211.1"]]
4- [[-DTIMID_VERSION="41.0.211.1"]]
53 [[-DDEFAULT_PATH=".\\"]]
64 )
75
@@ -174,6 +172,7 @@ add_executable(
174172 ${TIMIDITY_COMMON_SOURCES}
175173 )
176174
175+add_dependencies(timidity UpdateTim41Version)
177176 target_compile_definitions(timidity PRIVATE -DIA_NCURSES)
178177 target_link_libraries(timidity interface ${TIMIDITY_COMMON_LIBS})
179178
@@ -185,6 +184,7 @@ add_executable(
185184 ${TIMIDITY_COMMON_SOURCES}
186185 )
187186
187+add_dependencies(twsynsrv UpdateTim41Version)
188188 target_compile_definitions(twsynsrv PRIVATE -DIA_WINSYN -DTWSYNSRV)
189189 target_link_libraries(twsynsrv interface_synsrv ${TIMIDITY_COMMON_LIBS})
190190
@@ -197,6 +197,7 @@ add_executable(
197197 $<TARGET_OBJECTS:interface_w32g_res>
198198 )
199199
200+add_dependencies(timw32g UpdateTim41Version)
200201 target_compile_definitions(timw32g PRIVATE -DIA_W32GUI -D__W32G__)
201202 target_link_libraries(timw32g interface_w32g ${TIMIDITY_COMMON_LIBS})
202203 DisableMSManifest(timw32g)
@@ -210,6 +211,7 @@ add_executable(
210211 $<TARGET_OBJECTS:interface_w32gsyn_res>
211212 )
212213
214+add_dependencies(twsyng UpdateTim41Version)
213215 target_compile_definitions(twsyng PRIVATE -DIA_W32G_SYN -D__W32G__ -DTWSYNG32)
214216 target_link_libraries(twsyng interface_w32gsyn ${TIMIDITY_COMMON_LIBS})
215217 DisableMSManifest(twsyng)
--- a/timidity/flac_a.c
+++ b/timidity/flac_a.c
@@ -560,7 +560,7 @@ static int flac_output_open(const char *fname, const char *comment)
560560
561561 metadata[num_metadata] = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT);
562562 if (metadata[num_metadata]) {
563- const char *vendor_string = "Encoded with Timidity++-" VERSION "(compiled " __DATE__ ")";
563+ const char *vendor_string = "Encoded with Timidity++";
564564 /* Location=output_name */
565565 memset(&commentry, 0, sizeof(commentry));
566566 FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&commentry, "LOCATION", comment);
--- a/timidity/speex_a.c
+++ b/timidity/speex_a.c
@@ -273,7 +273,7 @@ int write_ogg_header(Speex_ctx *ctx, int fd, char *comments)
273273 {
274274 int ret, result;
275275
276- char *vendor_string = "Encoded with Timidity++-" TIMID_VERSION "(compiled " __DATE__ ")";
276+ char *vendor_string = "Encoded with Timidity++";
277277 int comments_length = strlen(comments);
278278
279279 comment_init(&comments, &comments_length, vendor_string);
--- a/timidity/version.c
+++ b/timidity/version.c
@@ -22,8 +22,6 @@
2222 #ifdef HAVE_CONFIG_H
2323 #include "config.h"
2424 #endif /* HAVE_CONFIG_H */
25-#include "sysdep.h"
26-#include "optcode.h"
2725 #include "version.h"
2826
29-const char *timidity_version = VERSION;
27+const char *timidity_version = TIMID_VERSION;
--- a/version.h
+++ /dev/null
@@ -1,46 +0,0 @@
1-/*
2- TiMidity++ -- MIDI to WAVE converter and player
3- Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp>
4- Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>
5-
6- This program is free software; you can redistribute it and/or modify
7- it under the terms of the GNU General Public License as published by
8- the Free Software Foundation; either version 2 of the License, or
9- (at your option) any later version.
10-
11- This program is distributed in the hope that it will be useful,
12- but WITHOUT ANY WARRANTY; without even the implied warranty of
13- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14- GNU General Public License for more details.
15-
16- You should have received a copy of the GNU General Public License
17- along with this program; if not, write to the Free Software
18- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19-
20-*/
21-
22-#ifndef ___VERSION_H_
23-#define ___VERSION_H_
24-
25-#ifdef HAVE_CONFIG_H
26-#include "config.h"
27-#endif /* HAVE_CONFIG_H */
28-
29-#ifndef VERSION
30-#define VERSION "2.14.0"
31-#endif
32-#ifndef TIMID_VERSION
33-#define TIMID_VERSION "current"
34-#endif
35-#ifndef PACKAGE_NAME
36-#define PACKAGE_NAME "TiMidity++"
37-#endif
38-#ifndef PACKAGE_VERSION
39-#define PACKAGE_VERSION TIMID_VERSION
40-#endif
41-#ifndef PACKAGE_STRING
42-#define PACKAGE_STRING PACKAGE_NAME " " VERSION
43-#endif
44-
45-#endif /* !___VERSION_H_ */
46-
--- /dev/null
+++ b/version.h.in
@@ -0,0 +1,29 @@
1+/*
2+TiMidity++ -- MIDI to WAVE converter and player
3+Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp>
4+Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>
5+
6+This program is free software; you can redistribute it and/or modify
7+it under the terms of the GNU General Public License as published by
8+the Free Software Foundation; either version 2 of the License, or
9+(at your option) any later version.
10+
11+This program is distributed in the hope that it will be useful,
12+but WITHOUT ANY WARRANTY; without even the implied warranty of
13+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+GNU General Public License for more details.
15+
16+You should have received a copy of the GNU General Public License
17+along with this program; if not, write to the Free Software
18+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19+
20+*/
21+
22+#ifndef ___VERSION_H_
23+#define ___VERSION_H_
24+
25+#define TIMID_VERSION "${tim41VersionStr}"
26+#define TIMID_VERSION4_COMMA ${tim41Version3Comma},0
27+#define TIMID_VERSION_RESSTR "${tim41Version3Comma},0\0"
28+
29+#endif /* !___VERSION_H_ */