Merge branch 'dbus-1.4' rejecting commit 4ebb275ab7b6f71d5
[platform/upstream/dbus.git] / cmake / CMakeLists.txt
index a0f7acd..ba44d57 100644 (file)
@@ -1,18 +1,5 @@
 project(dbus)
 
-#########################################################################
-# detect version
-#########################################################################
-file (READ ../configure.ac configure_ac)
-string (REGEX REPLACE ".*dbus_major_version], .([0-9]+).*" "\\1" DBUS_MAJOR_VERSION ${configure_ac})
-string (REGEX REPLACE ".*dbus_minor_version], .([0-9]+).*" "\\1" DBUS_MINOR_VERSION ${configure_ac})
-string (REGEX REPLACE ".*dbus_micro_version], .([0-9]+).*" "\\1" DBUS_MICRO_VERSION ${configure_ac})
-# used by file version info
-set (DBUS_PATCH_VERSION "0")
-set (DBUS_VERSION ${DBUS_MAJOR_VERSION}.${DBUS_MINOR_VERSION}.${DBUS_MICRO_VERSION})
-
-set (DBUS_VERSION_STRING "${DBUS_VERSION}")
-
 # we need to be up to date
 CMAKE_MINIMUM_REQUIRED(VERSION 2.4.4 FATAL_ERROR)
 if(COMMAND cmake_policy)
@@ -22,6 +9,12 @@ 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")
 
+# detect version
+include(MacrosAutotools)
+autoversion(../configure.ac dbus)
+# used by file version info
+set (DBUS_PATCH_VERSION "0")
+
 include(Macros)
 TIMESTAMP(DBUS_BUILD_TIMESTAMP)
 
@@ -358,8 +351,8 @@ endif(X11_FOUND)
 
 # test binary names
 if (WIN32)
-       set (EXT ".exe")
-       # compatible with Automake .in files
+       # Automake calls this EXEEXT, and CMake doesn't have a standard name
+       # for it; follow Automake's naming convention so we can share .in files
        set (EXEEXT ".exe")
 endif(WIN32)