diff --git a/CMakeLists.txt b/CMakeLists.txt
index 48b0fe1c..dd06b917 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,8 @@ PROJECT(MOO)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
FIND_PACKAGE(MooCmake)
-SET(MOO_VERSION 0.10.4)
+MOO_DEFINE_VERSIONS("0.10.5-unstable")
+
SET(MOO_PACKAGE_NAME moo)
SET(MOO_EMAIL "emuntyan@sourceforge.net")
SET(MOO_COPYRIGHT "2004-2010 Yevgen Muntyan <${MOO_EMAIL}>")
@@ -21,7 +22,6 @@ INCLUDE(cmake/gtk.cmake)
INCLUDE(cmake/moo.cmake)
INCLUDE(cmake/dist.cmake)
-MOO_DEFINE_VERSIONS(MOO ${MOO_VERSION})
SET(MOO_MODULE_MAJOR_VERSION 1)
SET(MOO_MODULE_MINOR_VERSION 0)
SET(MOO_MODULE_VERSION \"${MOO_MODULE_MAJOR_VERSION}.${MOO_MODULE_MINOR_VERSION}\")
diff --git a/cmake/dist.cmake b/cmake/dist.cmake
index 4c8bd008..846b9fba 100644
--- a/cmake/dist.cmake
+++ b/cmake/dist.cmake
@@ -71,13 +71,13 @@ STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.]([0-9]+)" "\\1" CPACK_PACKAGE_VERSIO
STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.]([0-9]+)" "\\2" CPACK_PACKAGE_VERSION_MINOR ${MOO_VERSION})
STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.]([0-9]+)" "\\3" CPACK_PACKAGE_VERSION_PATCH ${MOO_VERSION})
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "medit a text editor")
-SET(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${MOO_VERSION})
+SET(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${MOO_PACKAGE_VERSION})
SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/COPYING.GPL)
SET(CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/README)
# SET(CPACK_GENERATOR)
SET(CPACK_PACKAGE_EXECUTABLES medit medit)
-SET(CPACK_SOURCE_PACKAGE_FILE_NAME "medit-${MOO_VERSION}")
+SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
SET(CPACK_SOURCE_IGNORE_FILES "/plat/win32/gtk-win/;/build/;/[.]hg;/[.]git;/junk/;/vs/;/ugly/;/_build/;/_install/;.*[.]orig$")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "medit")
@@ -88,7 +88,7 @@ SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "medit")
# SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS)
# SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS)
# SET(CPACK_NSIS_COMPRESSOR)
-SET(CPACK_NSIS_DISPLAY_NAME "medit ${MOO_VERSION}")
+SET(CPACK_NSIS_DISPLAY_NAME "medit ${MOO_DISPLAY_VERSION}")
SET(CPACK_NSIS_PACKAGE_NAME "medit")
# SET(CPACK_NSIS_INSTALLED_ICON_NAME)
SET(CPACK_NSIS_HELP_LINK "http://mooedit.sourceforge.net/")
diff --git a/cmake/modules/FindMooCmake.cmake b/cmake/modules/FindMooCmake.cmake
index e1153f44..b315d2a5 100644
--- a/cmake/modules/FindMooCmake.cmake
+++ b/cmake/modules/FindMooCmake.cmake
@@ -1,4 +1,4 @@
-OPTION(MOO_DEV_MODE_CMAKE "Enable developer mode for cmake - bunch of checks, warnings, etc." OFF)
+SET(MOO_DEV_MODE_CMAKE OFF CACHE BOOL "Enable developer mode for cmake - bunch of checks, warnings, etc.")
MARK_AS_ADVANCED(MOO_DEV_MODE_CMAKE)
IF(MOO_DEV_MODE_CMAKE)
@@ -14,6 +14,24 @@ MACRO(MOO_ERROR)
MESSAGE(FATAL_ERROR ${ARGN})
ENDMACRO(MOO_ERROR)
+MACRO(MOO_DEFINE_VERSIONS version)
+ IF(NOT "${version}" MATCHES "^[0-9]+[.][0-9]+[.][0-9]+(-.*)?$")
+ MOO_ERROR("Bad version string '${version}'")
+ ENDIF(NOT "${version}" MATCHES "^[0-9]+[.][0-9]+[.][0-9]+(-.*)?$")
+ STRING(REGEX REPLACE "^([0-9]+)[.]([0-9]+)[.]([0-9]+)(-(.*))?$" "\\1" MOO_MAJOR_VERSION "${version}")
+ STRING(REGEX REPLACE "^([0-9]+)[.]([0-9]+)[.]([0-9]+)(-(.*))?$" "\\2" MOO_MINOR_VERSION "${version}")
+ STRING(REGEX REPLACE "^([0-9]+)[.]([0-9]+)[.]([0-9]+)(-(.*))?$" "\\3" MOO_MICRO_VERSION "${version}")
+ STRING(REGEX REPLACE "^([0-9]+)[.]([0-9]+)[.]([0-9]+)(-(.*))?$" "\\5" MOO_VERSION_SUFFIX "${version}")
+ SET(MOO_VERSION "${MOO_MAJOR_VERSION}.${MOO_MINOR_VERSION}.${MOO_MICRO_VERSION}")
+ IF("${MOO_VERSION_SUFFIX}" STREQUAL "")
+ SET(MOO_PACKAGE_VERSION "${MOO_VERSION}")
+ SET(MOO_DISPLAY_VERSION "${MOO_VERSION}")
+ ELSE("${MOO_VERSION_SUFFIX}" STREQUAL "")
+ SET(MOO_PACKAGE_VERSION "${MOO_VERSION}-${MOO_VERSION_SUFFIX}")
+ SET(MOO_DISPLAY_VERSION "${MOO_VERSION} ${MOO_VERSION_SUFFIX}")
+ ENDIF("${MOO_VERSION_SUFFIX}" STREQUAL "")
+ENDMACRO(MOO_DEFINE_VERSIONS)
+
###########################################################################
#
# Build type
@@ -367,12 +385,10 @@ MACRO(MOO_OPTION variable dfltval helpstring)
SET(_moo_option_header)
SET(_moo_option_define)
MOO_COLLECT_SIMPLE_ARGS(HIDDEN _moo_option_hidden HEADER _moo_option_header DEFINE _moo_option_define ARGN ${ARGN})
- IF(NOT _moo_option_hidden)
- OPTION(${variable} "${helpstring}" "${dfltval}")
- ELSE(NOT _moo_option_hidden)
- SET(${variable} "${dfltval}" CACHE BOOL "${helpstring}")
+ SET(${variable} "${dfltval}" CACHE BOOL "${helpstring}")
+ IF(_moo_option_hidden)
MARK_AS_ADVANCED(${variable})
- ENDIF(NOT _moo_option_hidden)
+ ENDIF(_moo_option_hidden)
IF(_moo_option_header)
# MOO_DEBUG(${variable})
MOO_DEFINE_H(${variable} "${helpstring}")
diff --git a/cmake/moo.cmake b/cmake/moo.cmake
index be14d282..40fa2223 100644
--- a/cmake/moo.cmake
+++ b/cmake/moo.cmake
@@ -1,11 +1,3 @@
-MACRO(MOO_DEFINE_VERSIONS name version)
- STRING(REGEX REPLACE "([^.]+)[.].*" "\\1" ${name}_MAJOR_VERSION ${version})
- STRING(REGEX REPLACE "[^.]+[.]([^.]+).*" "\\1" ${name}_MINOR_VERSION ${version})
- STRING(REGEX REPLACE "[^.]+[.][^.]+[.]([^.]+)" "\\1" ${name}_MICRO_VERSION ${version})
- SET(${name}_VERSION "\"${version}\"")
- SET(${name}_VERSION_UNQUOTED "${version}")
-ENDMACRO(MOO_DEFINE_VERSIONS)
-
FIND_PACKAGE(PythonInterp)
IF(NOT PYTHONINTERP_FOUND)
MESSAGE(FATAL_ERROR "Python not found")
diff --git a/config.h.in b/config.h.in
index ece6330d..17c7b864 100644
--- a/config.h.in
+++ b/config.h.in
@@ -5,10 +5,13 @@
#define MOO_BUILD_LUA 1
#define MOO_BUILD_UTILS 1
+#define MOO_VERSION "@MOO_VERSION@"
+#define MOO_DISPLAY_VERSION "@MOO_DISPLAY_VERSION@"
+#define MOO_PACKAGE_VERSION "@MOO_PACKAGE_VERSION@"
+
#define MOO_MAJOR_VERSION @MOO_MAJOR_VERSION@
#define MOO_MICRO_VERSION @MOO_MICRO_VERSION@
#define MOO_MINOR_VERSION @MOO_MINOR_VERSION@
-#define MOO_VERSION @MOO_VERSION@
#define MOO_MODULE_MAJOR_VERSION @MOO_MODULE_MAJOR_VERSION@
#define MOO_MODULE_MINOR_VERSION @MOO_MODULE_MINOR_VERSION@
diff --git a/medit/main.c b/medit/main.c
index 04ef2ba7..859113fe 100644
--- a/medit/main.c
+++ b/medit/main.c
@@ -169,7 +169,7 @@ post_parse_func (void)
{
if (medit_opts.show_version)
{
- g_print ("medit " MOO_VERSION "\n");
+ g_print ("medit " MOO_DISPLAY_VERSION "\n");
exit (0);
}
diff --git a/medit/medit.rc.in b/medit/medit.rc.in
index efecf875..74b211ea 100644
--- a/medit/medit.rc.in
+++ b/medit/medit.rc.in
@@ -17,12 +17,12 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
VALUE "CompanyName", "http://mooedit.sourceforge.net/"
VALUE "FileDescription", "medit"
- VALUE "FileVersion", "@MOO_VERSION_UNQUOTED@.0"
- VALUE "InternalName", "medit-@MOO_VERSION_UNQUOTED@"
+ VALUE "FileVersion", "@MOO_VERSION@.0"
+ VALUE "InternalName", "medit"
VALUE "LegalCopyright", "@MOO_COPYRIGHT@"
VALUE "OriginalFilename", "medit.exe"
VALUE "ProductName", "medit"
- VALUE "ProductVersion", @MOO_VERSION@
+ VALUE "ProductVersion", "@MOO_PACKAGE_VERSION@"
END
END
BLOCK "VarFileInfo"
diff --git a/moo/mooapp/mooapp-info.h b/moo/mooapp/mooapp-info.h
index bd017e2b..3dc8aa9e 100644
--- a/moo/mooapp/mooapp-info.h
+++ b/moo/mooapp/mooapp-info.h
@@ -20,7 +20,6 @@
#define MOO_APP_FULL_NAME "medit"
#define MOO_APP_DESCRIPTION _("medit is a text editor")
#define MOO_APP_LOGO "medit"
-#define MOO_APP_VERSION MOO_VERSION
#define MOO_APP_WEBSITE "http://mooedit.sourceforge.net/"
#define MOO_APP_WEBSITE_LABEL "http://mooedit.sourceforge.net/"
diff --git a/moo/mooapp/mooappabout.c b/moo/mooapp/mooappabout.c
index 4a718b3a..598b600d 100644
--- a/moo/mooapp/mooappabout.c
+++ b/moo/mooapp/mooappabout.c
@@ -180,8 +180,8 @@ create_about_dialog (void)
g_object_add_weak_pointer (G_OBJECT (dialog), &about_dialog);
g_signal_connect (dialog, "delete-event", G_CALLBACK (gtk_widget_hide_on_delete), NULL);
- markup = g_markup_printf_escaped ("%s-%s",
- MOO_APP_FULL_NAME, MOO_APP_VERSION);
+ markup = g_markup_printf_escaped ("%s %s",
+ MOO_APP_FULL_NAME, MOO_DISPLAY_VERSION);
gtk_label_set_markup (gxml->name, markup);
g_free (markup);
@@ -236,7 +236,7 @@ moo_app_get_system_info (MooApp *app)
text = g_string_new (NULL);
- g_string_append_printf (text, "%s-%s\n", MOO_APP_FULL_NAME, MOO_APP_VERSION);
+ g_string_append_printf (text, "%s-%s\n", MOO_APP_FULL_NAME, MOO_PACKAGE_VERSION);
string = get_system_name ();
g_string_append_printf (text, "OS: %s\n", string);
diff --git a/plat/mac/Info.plist.in b/plat/mac/Info.plist.in
index 87e0f659..219cb23e 100644
--- a/plat/mac/Info.plist.in
+++ b/plat/mac/Info.plist.in
@@ -7,7 +7,7 @@
CFBundleExecutable
medit
CFBundleGetInfoString
- @MOO_VERSION_UNQUOTED@, Copyright @MOO_COPYRIGHT@
+ @MOO_DISPLAY_VERSION@, Copyright @MOO_COPYRIGHT@
CFBundleIconFile
medit.icns
CFBundleIdentifier
@@ -17,11 +17,11 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- @MOO_VERSION_UNQUOTED@
+ @MOO_VERSION@
CFBundleSignature
????
CFBundleVersion
- @MOO_VERSION_UNQUOTED@
+ @MOO_VERSION@
NSHumanReadableCopyright
Copyright @MOO_COPYRIGHT@, GNU General Public License.
LSMinimumSystemVersion
diff --git a/plat/unix/distcheck.in b/plat/unix/distcheck.in
index 77c2bf3e..4a9b5dbb 100755
--- a/plat/unix/distcheck.in
+++ b/plat/unix/distcheck.in
@@ -7,7 +7,7 @@ docmd() {
top_builddir=`pwd`
top_testdir=`mktemp --tmpdir -d medit-distcheck-XXXXXXXX`
-package=medit-${MOO_VERSION}
+package=medit-${MOO_PACKAGE_VERSION}
docmd make package_source
docmd cp $package.tar.bz2 $top_testdir/
diff --git a/plugins/moofileselector.c b/plugins/moofileselector.c
index 285f0932..0cf1f9f4 100644
--- a/plugins/moofileselector.c
+++ b/plugins/moofileselector.c
@@ -45,10 +45,6 @@
#include
#include
-#ifndef MOO_VERSION
-#define MOO_VERSION NULL
-#endif
-
#define DIR_PREFS MOO_PLUGIN_PREFS_ROOT "/" MOO_FILE_SELECTOR_PLUGIN_ID "/last_dir"
diff --git a/plugins/moofind.c b/plugins/moofind.c
index 55f1e54d..7d7da4f1 100644
--- a/plugins/moofind.c
+++ b/plugins/moofind.c
@@ -16,9 +16,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#ifndef MOO_VERSION
-#define MOO_VERSION NULL
-#endif
#include "mooedit/mooplugin-macro.h"
#include "mooeditplugins.h"
diff --git a/plugins/moopython/moo.rc.in b/plugins/moopython/moo.rc.in
index 0b283c2e..dbc6e39a 100644
--- a/plugins/moopython/moo.rc.in
+++ b/plugins/moopython/moo.rc.in
@@ -16,12 +16,12 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
VALUE "CompanyName", "http://mooedit.sourceforge.net/"
VALUE "FileDescription", "libmoo bindings for python"
- VALUE "FileVersion", "@MOO_VERSION_UNQUOTED@.0"
- VALUE "InternalName", "moo-mod-@MOO_VERSION_UNQUOTED@"
+ VALUE "FileVersion", "@MOO_VERSION@.0"
+ VALUE "InternalName", "moo-mod"
VALUE "LegalCopyright", "(C) @MOO_COPYRIGHT@"
VALUE "OriginalFilename", "moo.pyd"
VALUE "ProductName", "moo.pyd"
- VALUE "ProductVersion", @MOO_VERSION@
+ VALUE "ProductVersion", "@MOO_PACKAGE_VERSION@"
END
END
BLOCK "VarFileInfo"
diff --git a/plugins/moopython/plugins/pyproject/project-plugin.ini.in.in b/plugins/moopython/plugins/pyproject/project-plugin.ini.in.in
index 71e0f7d9..9ac5a094 100644
--- a/plugins/moopython/plugins/pyproject/project-plugin.ini.in.in
+++ b/plugins/moopython/plugins/pyproject/project-plugin.ini.in.in
@@ -8,6 +8,6 @@ id=ProjectManager
_name=Project Manager
_description=Project manager
author=Yevgen Muntyan
-version=@MOO_VERSION_UNQUOTED@
+version=@MOO_VERSION@
enabled=false
visible=false
diff --git a/plugins/moopython/plugins/python.ini.in.in b/plugins/moopython/plugins/python.ini.in.in
index bdbee16e..0e4166d1 100644
--- a/plugins/moopython/plugins/python.ini.in.in
+++ b/plugins/moopython/plugins/python.ini.in.in
@@ -8,4 +8,4 @@ id=Python
_name=Python
_description=Python support
author=Yevgen Muntyan
-version=@MOO_VERSION_UNQUOTED@
+version=@MOO_VERSION@
diff --git a/plugins/moopython/plugins/terminal.ini.in.in b/plugins/moopython/plugins/terminal.ini.in.in
index d3cad566..49f9e0d9 100644
--- a/plugins/moopython/plugins/terminal.ini.in.in
+++ b/plugins/moopython/plugins/terminal.ini.in.in
@@ -8,4 +8,4 @@ id=Terminal
_name=Terminal
_description=Terminal plugin
author=Yevgen Muntyan
-version=@MOO_VERSION_UNQUOTED@
+version=@MOO_VERSION@
diff --git a/plugins/moopython/pymoo.rc.in b/plugins/moopython/pymoo.rc.in
index 1c536b12..0c9008e6 100644
--- a/plugins/moopython/pymoo.rc.in
+++ b/plugins/moopython/pymoo.rc.in
@@ -16,12 +16,12 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
VALUE "CompanyName", "http://mooedit.sourceforge.net/"
VALUE "FileDescription", "python plugin for medit"
- VALUE "FileVersion", "@MOO_VERSION_UNQUOTED@.0"
- VALUE "InternalName", "pymoo-@MOO_VERSION_UNQUOTED@"
+ VALUE "FileVersion", "@MOO_VERSION@.0"
+ VALUE "InternalName", "pymoo"
VALUE "LegalCopyright", "(C) @MOO_COPYRIGHT@"
VALUE "OriginalFilename", "pymoo.dll"
VALUE "ProductName", "pymoo.dll"
- VALUE "ProductVersion", @MOO_VERSION@
+ VALUE "ProductVersion", "@MOO_PACKAGE_VERSION@"
END
END
BLOCK "VarFileInfo"