From ae010a3728f1587be07257f33753938b1605edad Mon Sep 17 00:00:00 2001 From: mooction <389094993@qq.com> Date: Wed, 27 Oct 2021 00:00:33 +0800 Subject: [PATCH] Update version code in one place --- CMakeLists.txt | 13 ++++-- src/main.cpp | 7 +-- static/.gitignore | 3 +- static/wx.rc | Bin 4698 -> 0 bytes static/wx.rc.in | 108 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 123 insertions(+), 8 deletions(-) delete mode 100644 static/wx.rc create mode 100644 static/wx.rc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index df7060b..a3cec5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}") @@ -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 @@ -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 @@ -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) diff --git a/src/main.cpp b/src/main.cpp index 846bd00..3bf6680 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,8 +12,9 @@ #include #include #include -#include -#include + +#include +#include #include "config.h" #include "main.h" @@ -403,7 +404,7 @@ MathJax.Hub.Config({ out << wxS(""); } -#ifdef USE_EXTERN_LIB +#ifdef USE_EXTERNAL_MD2HTML #include "maddy/parser.h" #else #include "lex_parse.h" diff --git a/static/.gitignore b/static/.gitignore index 0a9a7ac..7a50310 100644 --- a/static/.gitignore +++ b/static/.gitignore @@ -1 +1,2 @@ -wx.aps \ No newline at end of file +wx.aps +wx.rc diff --git a/static/wx.rc b/static/wx.rc deleted file mode 100644 index 0d12c7b0fac2fa824b7718eaa3db46537fe91b40..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4698 zcmd6rTW=ai6vxkV)qaN!eo2%j20M!S8e>dRFd%bLBSo@Y3=WbF7MEOCh zvXQa_k29-6QMTX7m?utZo!thzU0~J4JnVQpWkdz+iv0@jHh4!!^E7ucl#?}bvIRyB zeQQu1uWZ}BC&4Q0o&`>JjQIHSA98z3VFrS7Enc zT)57mZlX$`E^+5jCg6-&tGlQkFX$?wP{&da8aZtew@&NjtMdjNb(|TLUhf%eX(F!D zM>OJk%~0q1v^>25`g*RB73wYL#P1ET>3TwoNXwG!2>98P{G9^*<`Y^>oL0B!a*1Tw zH%axu;NuXP-GV{80Cj)pmXNp8QPH`c9`$g}Z-u&3WqALpqE48LI(-uMMVYwjsdFCV zBvzshi##tK^tdhfH;Gf17!V#MB$7K=s6|U$UKQKvl?dJ|}}u zVi^0r4*r$nuPEH&31!X|x5a!Ff$T}bU0-&$`2p4)Q19O(v$>R^43%XeN?OH{|355j zA#FmfF36pE#*04|`