Version number fun

This commit is contained in:
Yevgen Muntyan 2010-05-14 16:57:02 -07:00
parent 68e5180fa0
commit 7b271a3659
18 changed files with 51 additions and 48 deletions

View File

@ -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}\")

View File

@ -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/")

View File

@ -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}")

View File

@ -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")

View File

@ -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@

View File

@ -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);
}

View File

@ -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"

View File

@ -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/"

View File

@ -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 ("<span size=\"xx-large\"><b>%s-%s</b></span>",
MOO_APP_FULL_NAME, MOO_APP_VERSION);
markup = g_markup_printf_escaped ("<span size=\"xx-large\"><b>%s %s</b></span>",
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);

View File

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>medit</string>
<key>CFBundleGetInfoString</key>
<string>@MOO_VERSION_UNQUOTED@, Copyright @MOO_COPYRIGHT@</string>
<string>@MOO_DISPLAY_VERSION@, Copyright @MOO_COPYRIGHT@</string>
<key>CFBundleIconFile</key>
<string>medit.icns</string>
<key>CFBundleIdentifier</key>
@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>@MOO_VERSION_UNQUOTED@</string>
<string>@MOO_VERSION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>@MOO_VERSION_UNQUOTED@</string>
<string>@MOO_VERSION@</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright @MOO_COPYRIGHT@, GNU General Public License.</string>
<key>LSMinimumSystemVersion</key>

View File

@ -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/

View File

@ -45,10 +45,6 @@
#include <errno.h>
#include <sys/stat.h>
#ifndef MOO_VERSION
#define MOO_VERSION NULL
#endif
#define DIR_PREFS MOO_PLUGIN_PREFS_ROOT "/" MOO_FILE_SELECTOR_PLUGIN_ID "/last_dir"

View File

@ -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"

View File

@ -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"

View File

@ -8,6 +8,6 @@ id=ProjectManager
_name=Project Manager
_description=Project manager
author=Yevgen Muntyan <muntyan@tamu.edu>
version=@MOO_VERSION_UNQUOTED@
version=@MOO_VERSION@
enabled=false
visible=false

View File

@ -8,4 +8,4 @@ id=Python
_name=Python
_description=Python support
author=Yevgen Muntyan <muntyan@tamu.edu>
version=@MOO_VERSION_UNQUOTED@
version=@MOO_VERSION@

View File

@ -8,4 +8,4 @@ id=Terminal
_name=Terminal
_description=Terminal plugin
author=Yevgen Muntyan <muntyan@tamu.edu>
version=@MOO_VERSION_UNQUOTED@
version=@MOO_VERSION@

View File

@ -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"