Revision | 3f1b9d8c10477c1eb31fa3511abbb7c2f53175ea (tree) |
---|---|
Time | 2017-12-27 08:02:13 |
Author | Starg <starg@user...> |
Commiter | Starg |
Improve version number system
@@ -3,6 +3,26 @@ cmake_minimum_required(VERSION 3.9) | ||
3 | 3 | |
4 | 4 | project(timidity41) |
5 | 5 | |
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 | + | |
6 | 26 | add_definitions( |
7 | 27 | # TiMidity++ common |
8 | 28 | -DRETSIGTYPE=int |
@@ -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}) |
@@ -119,6 +119,7 @@ add_library( | ||
119 | 119 | w32g_res.rc |
120 | 120 | ) |
121 | 121 | |
122 | +add_dependencies(interface_w32g_res UpdateTim41Version) | |
122 | 123 | target_compile_definitions(interface_w32g_res PRIVATE -DIA_W32GUI -D__W32G__) |
123 | 124 | |
124 | 125 | # for twsyng |
@@ -140,4 +141,5 @@ add_library( | ||
140 | 141 | w32g_res.rc |
141 | 142 | ) |
142 | 143 | |
144 | +add_dependencies(interface_w32gsyn_res UpdateTim41Version) | |
143 | 145 | target_compile_definitions(interface_w32gsyn_res PRIVATE -DIA_W32G_SYN -D__W32G__ -DTWSYNG32) |
@@ -7,7 +7,7 @@ | ||
7 | 7 | #include <richedit.h> |
8 | 8 | #include "w32g_res.h" |
9 | 9 | #include "afxres.h" |
10 | - | |
10 | +#include "version.h" | |
11 | 11 | |
12 | 12 | 1 RT_MANIFEST "w32g_visualstyle.manifest" |
13 | 13 |
@@ -3682,8 +3682,8 @@ IDI_ICON_TIMIDITY ICON "w32g_icon.ico" | ||
3682 | 3682 | // |
3683 | 3683 | LANGUAGE LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN |
3684 | 3684 | 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 | |
3687 | 3687 | FILEOS VOS__WINDOWS32 |
3688 | 3688 | FILETYPE VFT_APP |
3689 | 3689 | FILESUBTYPE VFT2_UNKNOWN |
@@ -3697,14 +3697,20 @@ VS_VERSION_INFO VERSIONINFO | ||
3697 | 3697 | VALUE "Comments", "\0" |
3698 | 3698 | VALUE "CompanyName", "\0" |
3699 | 3699 | 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 | |
3701 | 3706 | VALUE "InternalName", "timw32g\0" |
3707 | + VALUE "OriginalFilename", "timw32g.exe\0" | |
3708 | + VALUE "ProductName", "TiMidity++ Win32GUI Version\0" | |
3709 | +#endif | |
3702 | 3710 | VALUE "LegalCopyright", "Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp>\r\nCopyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>\0" |
3703 | 3711 | VALUE "LegalTrademarks", "\0" |
3704 | - VALUE "OriginalFilename", "timw32g.exe\0" | |
3705 | 3712 | VALUE "PrivateBuild", "\0" |
3706 | - VALUE "ProductName", "TiMidity++ Win32GUI Version\0" | |
3707 | - VALUE "ProductVersion", "2, 13, 0, 0\0" | |
3713 | + VALUE "ProductVersion", TIMID_VERSION | |
3708 | 3714 | VALUE "SpecialBuild", "\0" |
3709 | 3715 | } |
3710 | 3716 | } |
@@ -1,7 +1,5 @@ | ||
1 | 1 | |
2 | 2 | add_definitions( |
3 | - [[-DVERSION="41.0.211.1"]] | |
4 | - [[-DTIMID_VERSION="41.0.211.1"]] | |
5 | 3 | [[-DDEFAULT_PATH=".\\"]] |
6 | 4 | ) |
7 | 5 |
@@ -174,6 +172,7 @@ add_executable( | ||
174 | 172 | ${TIMIDITY_COMMON_SOURCES} |
175 | 173 | ) |
176 | 174 | |
175 | +add_dependencies(timidity UpdateTim41Version) | |
177 | 176 | target_compile_definitions(timidity PRIVATE -DIA_NCURSES) |
178 | 177 | target_link_libraries(timidity interface ${TIMIDITY_COMMON_LIBS}) |
179 | 178 |
@@ -185,6 +184,7 @@ add_executable( | ||
185 | 184 | ${TIMIDITY_COMMON_SOURCES} |
186 | 185 | ) |
187 | 186 | |
187 | +add_dependencies(twsynsrv UpdateTim41Version) | |
188 | 188 | target_compile_definitions(twsynsrv PRIVATE -DIA_WINSYN -DTWSYNSRV) |
189 | 189 | target_link_libraries(twsynsrv interface_synsrv ${TIMIDITY_COMMON_LIBS}) |
190 | 190 |
@@ -197,6 +197,7 @@ add_executable( | ||
197 | 197 | $<TARGET_OBJECTS:interface_w32g_res> |
198 | 198 | ) |
199 | 199 | |
200 | +add_dependencies(timw32g UpdateTim41Version) | |
200 | 201 | target_compile_definitions(timw32g PRIVATE -DIA_W32GUI -D__W32G__) |
201 | 202 | target_link_libraries(timw32g interface_w32g ${TIMIDITY_COMMON_LIBS}) |
202 | 203 | DisableMSManifest(timw32g) |
@@ -210,6 +211,7 @@ add_executable( | ||
210 | 211 | $<TARGET_OBJECTS:interface_w32gsyn_res> |
211 | 212 | ) |
212 | 213 | |
214 | +add_dependencies(twsyng UpdateTim41Version) | |
213 | 215 | target_compile_definitions(twsyng PRIVATE -DIA_W32G_SYN -D__W32G__ -DTWSYNG32) |
214 | 216 | target_link_libraries(twsyng interface_w32gsyn ${TIMIDITY_COMMON_LIBS}) |
215 | 217 | DisableMSManifest(twsyng) |
@@ -560,7 +560,7 @@ static int flac_output_open(const char *fname, const char *comment) | ||
560 | 560 | |
561 | 561 | metadata[num_metadata] = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT); |
562 | 562 | if (metadata[num_metadata]) { |
563 | - const char *vendor_string = "Encoded with Timidity++-" VERSION "(compiled " __DATE__ ")"; | |
563 | + const char *vendor_string = "Encoded with Timidity++"; | |
564 | 564 | /* Location=output_name */ |
565 | 565 | memset(&commentry, 0, sizeof(commentry)); |
566 | 566 | FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&commentry, "LOCATION", comment); |
@@ -273,7 +273,7 @@ int write_ogg_header(Speex_ctx *ctx, int fd, char *comments) | ||
273 | 273 | { |
274 | 274 | int ret, result; |
275 | 275 | |
276 | - char *vendor_string = "Encoded with Timidity++-" TIMID_VERSION "(compiled " __DATE__ ")"; | |
276 | + char *vendor_string = "Encoded with Timidity++"; | |
277 | 277 | int comments_length = strlen(comments); |
278 | 278 | |
279 | 279 | comment_init(&comments, &comments_length, vendor_string); |
@@ -22,8 +22,6 @@ | ||
22 | 22 | #ifdef HAVE_CONFIG_H |
23 | 23 | #include "config.h" |
24 | 24 | #endif /* HAVE_CONFIG_H */ |
25 | -#include "sysdep.h" | |
26 | -#include "optcode.h" | |
27 | 25 | #include "version.h" |
28 | 26 | |
29 | -const char *timidity_version = VERSION; | |
27 | +const char *timidity_version = TIMID_VERSION; |
@@ -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 | - |
@@ -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_ */ |