Commit 492e0ae0 authored by Ralf Habacker's avatar Ralf Habacker

fixed cmake version macro and string handling

parent 0c31f849
......@@ -85,7 +85,7 @@ version (void)
"Copyright (C) 2002, 2003 Red Hat, Inc., CodeFactory AB, and others\n"
"This is free software; see the source for copying conditions.\n"
"There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
VERSION);
DBUS_VERSION_STRING);
exit (0);
}
......
set (PACKAGE dbus)
# the version major, minor and release number should be synchron to the dbus cvs - windows releases should only update the patch level
set (VERSION_MAJOR "1")
set (VERSION_MINOR "3")
set (VERSION_RELEASE "1")
set (VERSION_PATCH "0")
if (VERSION_PATCH)
set (VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}-${VERSION_PATCH}" )
else (VERSION_PATCH)
set (VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}" )
endif (VERSION_PATCH)
set (DBUS_MAJOR_VERSION ${VERSION_MAJOR})
set (DBUS_MINOR_VERSION ${VERSION_MAJOR})
set (DBUS_MICRO_VERSION ${VERSION_MAJOR})
set (DBUS_MAJOR_VERSION ${VERSION_MAJOR})
set (DBUS_VERSION ${VERSION})
set (DBUS_VERSION_STRING "${VERSION}")
project(${PACKAGE})
project(dbus)
set (DBUS_MAJOR_VERSION "1")
set (DBUS_MINOR_VERSION "3")
set (DBUS_MICRO_VERSION "1")
# used by file version info
set (DBUS_PATCH_VERSION "1")
set (DBUS_VERSION ${DBUS_MAJOR_VERSION}.${DBUS_MINOR_VERSION}.${DBUS_MICRO_VERSION})
endif (DBUS_PATCH_VERSION)
set (DBUS_VERSION_STRING "${DBUS_VERSION}")
# we need to be up to date
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.4 FATAL_ERROR)
......@@ -43,7 +34,7 @@ if (WIN32)
find_package(KDEWIN_Packager)
find_package(LibIconv)
include(Win32Macros)
addExplorerWrapper(${PACKAGE})
addExplorerWrapper(${CMAKE_PROJECT_NAME})
endif (WIN32)
find_package(LibXml2)
find_package(LibExpat)
......@@ -129,7 +120,7 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
# change configuration in Visual Studio to 'Pocket PC 2003 (ARMV4)'
#
if(wince)
project(${PACKAGE}-wince)
project(${CMAKE_PROJECT_NAME}-wince)
# don't forget parameters
set(wince 1 CACHE TYPE STRING FORCE)
set(wcelibcex ${wcelibcex} CACHE TYPE STRING FORCE)
......@@ -549,8 +540,8 @@ MESSAGE(" ")
GET_FILENAME_COMPONENT(C_COMPILER ${CMAKE_C_COMPILER} NAME)
GET_FILENAME_COMPONENT(CXX_COMPILER ${CMAKE_CXX_COMPILER} NAME)
message(" D-BUS ${VERSION} ")
message(" ========== ")
message(" D-BUS ${DBUS_VERSION} ")
message(" =========== ")
message(" ")
message(" prefix: ${prefix} ")
message(" exec_prefix: ${exec_prefix} ")
......@@ -631,5 +622,5 @@ MESSAGE(" ")
INCLUDE(modules/CPackInstallConfig.cmake)
if (KDEWIN_PACKAGER_FOUND)
KDEWIN_PACKAGER(${PACKAGE} ${VERSION} "ipc library" "")
KDEWIN_PACKAGER(${CMAKE_PROJECT_NAME} ${DBUS_VERSION} "ipc library" "")
endif (KDEWIN_PACKAGER_FOUND)
......@@ -18,12 +18,11 @@
#cmakedefine DBUS_DAEMONDIR "@DBUS_DAEMONDIR@"
#cmakedefine PACKAGE "@PACKAGE@"
/* Version number of package */
#cmakedefine VERSION "@VERSION@"
#cmakedefine DBUS_MAJOR_VERSION ${VERSION_MAJOR}
#cmakedefine DBUS_MINOR_VERSION ${VERSION_MINOR}
#cmakedefine DBUS_MICRO_VERSION ${VERSION_RELEASE}
#cmakedefine DBUS_VERSION ((@VERSION_MAJOR@ << 16) | (@VERSION_MINOR@ << 8) | (@VERSION_RELEASE@))
#cmakedefine DBUS_VERSION_STRING "@VERSION@"
#cmakedefine DBUS_MAJOR_VERSION @DBUS_MAJOR_VERSION@
#cmakedefine DBUS_MINOR_VERSION @DBUS_MINOR_VERSION@
#cmakedefine DBUS_MICRO_VERSION @DBUS_MICRO_VERSION@
#cmakedefine DBUS_VERSION ((@DBUS_MAJOR_VERSION@ << 16) | (@DBUS_MINOR_VERSION@ << 8) | (@DBUS_MICRO_VERSION@))
#cmakedefine DBUS_VERSION_STRING "@DBUS_VERSION_STRING@"
// test binaries
/* Full path to test file test/test-exit in builddir */
......
......@@ -228,6 +228,18 @@ set(libdbus_HEADERS
# for debugging
${DBUS_UTIL_HEADERS}
)
if (MSVC)
set (BUILD_FILEVERSION ${DBUS_MAJOR_VERSION},${DBUS_MINOR_VERSION},${DBUS_MICRO_VERSION},${DBUS_PATCH_VERSION})
# no idea how to create the current date as string
message(STATUS "FIXME create the current date as string in dbus/CMakeLists.txt")
set (BUILD_TIMESTAMP 20091205)
configure_file(${DBUS_DIR}/versioninfo.rc.in ${CMAKE_CURRENT_BINARY_DIR}/versioninfo.rc)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/afxres.h "")
list(APPEND libdbus_SOURCES versioninfo.rc)
set_source_files_properties(versioninfo.rc COMPILE_FLAGS "-D__LINE__=1")
endif (MSVC)
if(MSVC AND splitlib)
set(DBUS_LIB_TYPE STATIC)
......
......@@ -1204,7 +1204,7 @@ handle_server_data_anonymous_mech (DBusAuth *auth,
{
DBusString plaintext;
DBusString encoded;
_dbus_string_init_const (&plaintext, "D-Bus " VERSION);
_dbus_string_init_const (&plaintext, "D-Bus " DBUS_VERSION_STRING);
_dbus_string_init (&encoded);
_dbus_string_hex_encode (&plaintext, 0,
&encoded,
......@@ -1262,7 +1262,7 @@ handle_client_initial_response_anonymous_mech (DBusAuth *auth,
return FALSE;
if (!_dbus_string_append (&plaintext,
"libdbus " VERSION))
"libdbus " DBUS_VERSION_STRING))
goto failed;
if (!_dbus_string_hex_encode (&plaintext, 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment