diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2011-09-22 21:26:43 +0200 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2011-09-22 21:26:43 +0200 |
commit | 443b8ec3da541018f2979e3700bc8d4ee7095136 (patch) | |
tree | be3ff5bbf1771a4bf3be20c9d68a4972698b8e20 | |
parent | 8acd2e2148f64d0bda3353a136ae9178bce89963 (diff) | |
parent | 1767840160736c7a31bf432e6a850154d028f8ac (diff) |
Merge branch 'dbus-1.4'
Conflicts:
cmake/CMakeLists.txt
-rw-r--r-- | cmake/CMakeLists.txt | 27 | ||||
-rw-r--r-- | cmake/modules/Macros.cmake | 15 |
2 files changed, 27 insertions, 15 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 72c42318..21728a70 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -13,11 +13,6 @@ set (DBUS_VERSION ${DBUS_MAJOR_VERSION}.${DBUS_MINOR_VERSION}.${DBUS_MICRO_VERSI set (DBUS_VERSION_STRING "${DBUS_VERSION}") -if (NOT DBUS_BUILD_TIMESTAMP) - message(STATUS "FIXME set DBUS_BUILD_TIMESTAMP to current date or fix current time stamp generation for having actual build date in version file info") - set (DBUS_BUILD_TIMESTAMP 20091231) -endif (NOT DBUS_BUILD_TIMESTAMP) - # we need to be up to date CMAKE_MINIMUM_REQUIRED(VERSION 2.4.4 FATAL_ERROR) if(COMMAND cmake_policy) @@ -27,6 +22,9 @@ endif(COMMAND cmake_policy) # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules") +include(Macros) +TIMESTAMP(DBUS_BUILD_TIMESTAMP) + ########### basic vars ############### @@ -87,9 +85,8 @@ if (WIN32) include(Win32Macros) addExplorerWrapper(${CMAKE_PROJECT_NAME}) endif (WIN32) -find_package(LibXml2) -find_package(LibExpat) -find_package(X11) + +option (DBUS_USE_EXPAT "Use expat (== ON) or libxml2 (==OFF)" ON) if(NOT WIN32) option (DBUS_ENABLE_ABSTRACT_SOCKETS "enable support for abstract sockets" ON) @@ -102,6 +99,13 @@ option (DBUS_ENABLE_STATS "enable bus daemon usage statistics" OFF) option (DBUS_ENABLE_STATS "enable bus daemon usage statistics" OFF) +if (DBUS_USE_EXPAT) + find_package(LibExpat) +else () + find_package(LibXml2) +endif () +find_package(X11) + # analogous to AC_USE_SYSTEM_EXTENSIONS in configure.ac add_definitions(-D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE) @@ -116,7 +120,6 @@ include (MacroLibrary) if(VCS) set(DBUS_VERBOSE_C_S 1 CACHE STRING "verbose mode" FORCE) - set(DBUS_VERBOSE_C_S 1) endif(VCS) if(WIN32) @@ -301,12 +304,6 @@ if(NOT LIBXML2_FOUND AND NOT LIBEXPAT_FOUND) message(FATAL "Neither expat nor libxml2 found!") endif(NOT LIBXML2_FOUND AND NOT LIBEXPAT_FOUND) -if(LIBEXPAT_FOUND) - option (DBUS_USE_EXPAT "Use expat (== ON) or libxml2 (==OFF)" ON) -else(LIBEXPAT_FOUND) - option (DBUS_USE_EXPAT "Use expat (== ON) or libxml2 (==OFF)" OFF) -endif(LIBEXPAT_FOUND) - if(DBUS_USE_EXPAT) SET(XML_LIB "Expat") SET(XML_LIBRARY ${LIBEXPAT_LIBRARIES}) diff --git a/cmake/modules/Macros.cmake b/cmake/modules/Macros.cmake new file mode 100644 index 00000000..b6371568 --- /dev/null +++ b/cmake/modules/Macros.cmake @@ -0,0 +1,15 @@ + +MACRO(TIMESTAMP RESULT) + IF(WIN32) + EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE DATE) + string(REGEX REPLACE "(..)[/.](..)[/.](....).*" "\\3\\2\\1" DATE ${DATE}) + EXECUTE_PROCESS(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE TIME) + string(REGEX REPLACE "(..):(..)" "\\1\\2" TIME ${TIME}) + set (${RESULT} "${DATE}${TIME}") + ELSEIF(UNIX) + EXECUTE_PROCESS(COMMAND "date" "+%Y%m%d%H%M" OUTPUT_VARIABLE ${RESULT}) + ELSE() + MESSAGE(SEND_ERROR "date not implemented") + SET(${RESULT} 000000000000) + ENDIF() +ENDMACRO() |