Skip to content

Commit ae010a3

Browse files
committed
Update version code in one place
1 parent 498945d commit ae010a3

File tree

5 files changed

+123
-8
lines changed

5 files changed

+123
-8
lines changed

CMakeLists.txt

+9-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ endif()
3333

3434
set(MYNOTEPAD_VERSION_MAJOR 1)
3535
set(MYNOTEPAD_VERSION_MINOR 0)
36-
set(MYNOTEPAD_VERSION_PATCH 6)
36+
set(MYNOTEPAD_VERSION_PATCH 7)
3737
message(STATUS "MyNotePad version: ${MYNOTEPAD_VERSION_MAJOR}."
3838
"${MYNOTEPAD_VERSION_MINOR}.${MYNOTEPAD_VERSION_PATCH}")
3939

@@ -55,6 +55,11 @@ if (UNIX)
5555
# message(STATUS "GTK headers: ${GTK_INCLUDE_DIRS}")
5656
# message(STATUS "GTK libraries: ${GTK_LIBRARIES}")
5757
# set(EXTRA_LIBS ${EXTRA_LIBS} ${GTK_LIBRARIES})
58+
else()
59+
configure_file(
60+
"${PROJECT_SOURCE_DIR}/static/wx.rc.in"
61+
"${PROJECT_SOURCE_DIR}/static/wx.rc"
62+
)
5863
endif()
5964

6065
# Specify the path manually
@@ -93,8 +98,8 @@ set(TARGET mynotepad)
9398
add_executable(${TARGET} WIN32 ${SOURCES})
9499

95100
# Markdown to HTML converter
96-
option(USE_EXTERN_LIB "Use external library to convert markdown to HTML" OFF)
97-
if (USE_EXTERN_LIB)
101+
option(USE_EXTERNAL_MD2HTML "Use external library to convert markdown to HTML" OFF)
102+
if (USE_EXTERNAL_MD2HTML)
98103
include(FetchContent)
99104
FetchContent_Declare(maddy
100105
GIT_REPOSITORY https://github.com/progsource/maddy.git
@@ -106,7 +111,7 @@ if (USE_EXTERN_LIB)
106111
# Do not add_subdirectory() because we only want the header files
107112
include_directories("${maddy_SOURCE_DIR}/include")
108113
endif()
109-
add_definitions("-DUSE_EXTERN_LIB")
114+
add_definitions("-DUSE_EXTERNAL_MD2HTML")
110115
else()
111116
add_subdirectory(md2html)
112117
set(EXTRA_LIBS ${EXTRA_LIBS} md2html)

src/main.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
#include <wx/utils.h>
1313
#include <wx/filedlg.h>
1414
#include <wx/clipbrd.h>
15-
#include <iostream>
16-
#include <string>
15+
16+
#include <sstream>
17+
#include <cstdlib>
1718

1819
#include "config.h"
1920
#include "main.h"
@@ -403,7 +404,7 @@ MathJax.Hub.Config({
403404
out << wxS("</body><html>");
404405
}
405406

406-
#ifdef USE_EXTERN_LIB
407+
#ifdef USE_EXTERNAL_MD2HTML
407408
#include "maddy/parser.h"
408409
#else
409410
#include "lex_parse.h"

static/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
wx.aps
1+
wx.aps
2+
wx.rc

static/wx.rc

-4.59 KB
Binary file not shown.

static/wx.rc.in

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
// Microsoft Visual C++ generated resource script.
2+
//
3+
#include "resource.h"
4+
5+
#define APSTUDIO_READONLY_SYMBOLS
6+
/
7+
//
8+
// Generated from the TEXTINCLUDE 2 resource.
9+
//
10+
#include "winres.h"
11+
12+
/
13+
#undef APSTUDIO_READONLY_SYMBOLS
14+
15+
/////////////////////////////////////////////////////////////////////////////
16+
// 中文(简体,中国) resources
17+
18+
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
19+
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
20+
21+
/////////////////////////////////////////////////////////////////////////////
22+
//
23+
// Icon
24+
//
25+
26+
// Icon with lowest ID value placed first to ensure application icon
27+
// remains consistent on all systems.
28+
ICON_MYNOTEPAD ICON "mynotepad.ico"
29+
30+
31+
/////////////////////////////////////////////////////////////////////////////
32+
//
33+
// Version
34+
//
35+
36+
VS_VERSION_INFO VERSIONINFO
37+
FILEVERSION @MYNOTEPAD_VERSION_MAJOR@,@MYNOTEPAD_VERSION_MINOR@,@MYNOTEPAD_VERSION_PATCH@,0
38+
PRODUCTVERSION @MYNOTEPAD_VERSION_MAJOR@,@MYNOTEPAD_VERSION_MINOR@,@MYNOTEPAD_VERSION_PATCH@,0
39+
FILEFLAGSMASK 0x3fL
40+
#ifdef _DEBUG
41+
FILEFLAGS 0x1L
42+
#else
43+
FILEFLAGS 0x0L
44+
#endif
45+
FILEOS 0x40004L
46+
FILETYPE 0x1L
47+
FILESUBTYPE 0x0L
48+
BEGIN
49+
BLOCK "StringFileInfo"
50+
BEGIN
51+
BLOCK "080404b0"
52+
BEGIN
53+
VALUE "CompanyName", "moooc.cc"
54+
VALUE "FileDescription", "MyNotePad"
55+
VALUE "FileVersion", "@MYNOTEPAD_VERSION_MAJOR@.@MYNOTEPAD_VERSION_MINOR@.@MYNOTEPAD_VERSION_PATCH@.0"
56+
VALUE "InternalName", "mynotepad.exe"
57+
VALUE "LegalCopyright", "Copyright (C) 2021"
58+
VALUE "OriginalFilename", "mynotepad.exe"
59+
VALUE "ProductName", "MyNotePad"
60+
VALUE "ProductVersion", "@MYNOTEPAD_VERSION_MAJOR@.@MYNOTEPAD_VERSION_MINOR@.@MYNOTEPAD_VERSION_PATCH@.0"
61+
END
62+
END
63+
BLOCK "VarFileInfo"
64+
BEGIN
65+
VALUE "Translation", 0x804, 1200
66+
END
67+
END
68+
69+
70+
#ifdef APSTUDIO_INVOKED
71+
/////////////////////////////////////////////////////////////////////////////
72+
//
73+
// TEXTINCLUDE
74+
//
75+
76+
1 TEXTINCLUDE
77+
BEGIN
78+
"resource.h\0"
79+
END
80+
81+
2 TEXTINCLUDE
82+
BEGIN
83+
"\0"
84+
END
85+
86+
3 TEXTINCLUDE
87+
BEGIN
88+
"\r\n"
89+
"\0"
90+
END
91+
92+
#endif // APSTUDIO_INVOKED
93+
94+
#endif // 中文(简体,中国) resources
95+
/////////////////////////////////////////////////////////////////////////////
96+
97+
98+
99+
#ifndef APSTUDIO_INVOKED
100+
/////////////////////////////////////////////////////////////////////////////
101+
//
102+
// Generated from the TEXTINCLUDE 3 resource.
103+
//
104+
105+
106+
/////////////////////////////////////////////////////////////////////////////
107+
#endif // not APSTUDIO_INVOKED
108+

0 commit comments

Comments
 (0)