Skip to content

Commit

Permalink
Update version code in one place
Browse files Browse the repository at this point in the history
  • Loading branch information
fungaren committed Oct 26, 2021
1 parent 498945d commit ae010a3
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 8 deletions.
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ endif()

set(MYNOTEPAD_VERSION_MAJOR 1)
set(MYNOTEPAD_VERSION_MINOR 0)
set(MYNOTEPAD_VERSION_PATCH 6)
set(MYNOTEPAD_VERSION_PATCH 7)
message(STATUS "MyNotePad version: ${MYNOTEPAD_VERSION_MAJOR}."
"${MYNOTEPAD_VERSION_MINOR}.${MYNOTEPAD_VERSION_PATCH}")

Expand All @@ -55,6 +55,11 @@ if (UNIX)
# message(STATUS "GTK headers: ${GTK_INCLUDE_DIRS}")
# message(STATUS "GTK libraries: ${GTK_LIBRARIES}")
# set(EXTRA_LIBS ${EXTRA_LIBS} ${GTK_LIBRARIES})
else()
configure_file(
"${PROJECT_SOURCE_DIR}/static/wx.rc.in"
"${PROJECT_SOURCE_DIR}/static/wx.rc"
)
endif()

# Specify the path manually
Expand Down Expand Up @@ -93,8 +98,8 @@ set(TARGET mynotepad)
add_executable(${TARGET} WIN32 ${SOURCES})

# Markdown to HTML converter
option(USE_EXTERN_LIB "Use external library to convert markdown to HTML" OFF)
if (USE_EXTERN_LIB)
option(USE_EXTERNAL_MD2HTML "Use external library to convert markdown to HTML" OFF)
if (USE_EXTERNAL_MD2HTML)
include(FetchContent)
FetchContent_Declare(maddy
GIT_REPOSITORY https://github.com/progsource/maddy.git
Expand All @@ -106,7 +111,7 @@ if (USE_EXTERN_LIB)
# Do not add_subdirectory() because we only want the header files
include_directories("${maddy_SOURCE_DIR}/include")
endif()
add_definitions("-DUSE_EXTERN_LIB")
add_definitions("-DUSE_EXTERNAL_MD2HTML")
else()
add_subdirectory(md2html)
set(EXTRA_LIBS ${EXTRA_LIBS} md2html)
Expand Down
7 changes: 4 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
#include <wx/utils.h>
#include <wx/filedlg.h>
#include <wx/clipbrd.h>
#include <iostream>
#include <string>

#include <sstream>
#include <cstdlib>

#include "config.h"
#include "main.h"
Expand Down Expand Up @@ -403,7 +404,7 @@ MathJax.Hub.Config({
out << wxS("</body><html>");
}

#ifdef USE_EXTERN_LIB
#ifdef USE_EXTERNAL_MD2HTML
#include "maddy/parser.h"
#else
#include "lex_parse.h"
Expand Down
3 changes: 2 additions & 1 deletion static/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
wx.aps
wx.aps
wx.rc
Binary file removed static/wx.rc
Binary file not shown.
108 changes: 108 additions & 0 deletions static/wx.rc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"

/
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// 中文(简体,中国) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED

/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
ICON_MYNOTEPAD ICON "mynotepad.ico"


/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION @MYNOTEPAD_VERSION_MAJOR@,@MYNOTEPAD_VERSION_MINOR@,@MYNOTEPAD_VERSION_PATCH@,0
PRODUCTVERSION @MYNOTEPAD_VERSION_MAJOR@,@MYNOTEPAD_VERSION_MINOR@,@MYNOTEPAD_VERSION_PATCH@,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080404b0"
BEGIN
VALUE "CompanyName", "moooc.cc"
VALUE "FileDescription", "MyNotePad"
VALUE "FileVersion", "@MYNOTEPAD_VERSION_MAJOR@.@MYNOTEPAD_VERSION_MINOR@.@[email protected]"
VALUE "InternalName", "mynotepad.exe"
VALUE "LegalCopyright", "Copyright (C) 2021"
VALUE "OriginalFilename", "mynotepad.exe"
VALUE "ProductName", "MyNotePad"
VALUE "ProductVersion", "@MYNOTEPAD_VERSION_MAJOR@.@MYNOTEPAD_VERSION_MINOR@.@[email protected]"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x804, 1200
END
END


#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE
BEGIN
"resource.h\0"
END

2 TEXTINCLUDE
BEGIN
"\0"
END

3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END

#endif // APSTUDIO_INVOKED

#endif // 中文(简体,中国) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

0 comments on commit ae010a3

Please sign in to comment.