X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=cmake%2FCMakeLists.txt;h=98f1d5c68a0d3db749cd4459f950c53a339c6406;hb=7aed4eb923b3c6a8aafcdb9a4e35a0924005c833;hp=7476975b84ec1ee01e473d49d261767d9c360ecb;hpb=90f36efbc33201fd2c8fe8c8cbe09f7460c1930b;p=platform%2Fupstream%2Fdbus.git diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 7476975..98f1d5c 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1,23 +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}") - -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 +9,15 @@ 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) + ########### basic vars ############### @@ -38,7 +29,7 @@ if ($ENV{DBUSDIR}) endif ($ENV{DBUSDIR}) if (DBUS_INSTALL_DIR) - set(CMAKE_INSTALL_PREFIX "${DBUS_INSTALL_DIR}" CACHE TYPE PATH FORCE) + set(CMAKE_INSTALL_PREFIX "${DBUS_INSTALL_DIR}" CACHE PATH "install prefix" FORCE) else (DBUS_INSTALL_DIR) set(DBUS_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}") endif (DBUS_INSTALL_DIR) @@ -87,9 +78,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) @@ -98,6 +88,18 @@ endif(NOT WIN32) #AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE) OPTION(DBUS_DISABLE_ASSERTS "Disable assertion checking" 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) + # do config checks INCLUDE(ConfigureChecks.cmake) @@ -108,8 +110,7 @@ SET(DBUS_SOURCE_DIR ${CMAKE_SOURCE_DIR}/..) include (MacroLibrary) if(VCS) - set(DBUS_VERBOSE_C_S 1 CACHE TYPE STRING FORCE) - set(DBUS_VERBOSE_C_S 1) + set(DBUS_VERBOSE_C_S 1 CACHE STRING "verbose mode" FORCE) endif(VCS) if(WIN32) @@ -126,8 +127,8 @@ if(WIN32) # Use the highest warning level if (WALL) - set(WALL 1 CACHE TYPE STRING FORCE) - set(CMAKE_CXX_WARNING_LEVEL 4 CACHE TYPE STRING FORCE) + set(WALL 1 CACHE STRING "all warnings" FORCE) + set(CMAKE_CXX_WARNING_LEVEL 4 CACHE STRING "warning level" FORCE) if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") STRING(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") @@ -141,7 +142,7 @@ if(WIN32) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") endif(CMAKE_C_FLAGS MATCHES "/W[0-4]") else (WALL) - set(CMAKE_CXX_WARNING_LEVEL 3 CACHE TYPE STRING FORCE) + set(CMAKE_CXX_WARNING_LEVEL 3 CACHE STRING "warning level" FORCE) endif (WALL) SET(MSVC_W_ERROR " /we4028 /we4013 /we4133 /we4047 /we4031 /we4002 /we4003 /we4114") @@ -285,7 +286,7 @@ STRING(TOUPPER ${CMAKE_SYSTEM_NAME} sysname) if("${sysname}" MATCHES ".*SOLARIS.*") OPTION(HAVE_CONSOLE_OWNER_FILE "enable console owner file (solaris only)" ON) if(HAVE_CONSOLE_OWNER_FILE) - SET(DBUS_CONSOLE_OWNER_FILE "/dev/console" CACHE STRING "Directory to check for console ownerhip") + set (DBUS_CONSOLE_OWNER_FILE "/dev/console" CACHE STRING "Directory to check for console ownerhip") endif(HAVE_CONSOLE_OWNER_FILE) endif("${sysname}" MATCHES ".*SOLARIS.*") @@ -294,12 +295,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}) @@ -345,8 +340,8 @@ if(CMAKE_COMPILER_IS_GNUCC AND NOT DBUS_ENABLE_ANSI) endif(UNAME_EXECUTABLE) endif(CMAKE_COMPILER_IS_GNUCC AND NOT DBUS_ENABLE_ANSI) -OPTION(DBUS_HAVE_ATOMIC_INT "Some atomic integer implementation present" ${atomic_int}) -OPTION(DBUS_USE_ATOMIC_INT_486 "Use atomic integer implementation for 486" ${atomic_int_486}) +set (DBUS_HAVE_ATOMIC_INT ${atomic_int} CACHE STRING "Some atomic integer implementation present") +set (DBUS_USE_ATOMIC_INT_486 ${atomic_int_486} CACHE STRING "Use atomic integer implementation for 486") if(X11_FOUND) OPTION(DBUS_BUILD_X11 "Build with X11 autolaunch support " ON) @@ -500,8 +495,12 @@ set (DBUS_INTERNAL_LIBRARY_DEFINITIONS "-DDBUS_STATIC_BUILD") set (DBUS_INTERNAL_CLIENT_DEFINITIONS "-DDBUS_STATIC_BUILD") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h ) + +if (WIN32) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dbus-env.bat.cmake ${CMAKE_BINARY_DIR}/bin/dbus-env.bat ) install_files(/bin FILES ${CMAKE_BINARY_DIR}/bin/dbus-env.bat) +endif() + add_definitions(-DHAVE_CONFIG_H=1) ########### subdirs ############### @@ -557,6 +556,7 @@ message(" Building unit tests: ${DBUS_BUILD_TESTS} " message(" Building verbose mode: ${DBUS_ENABLE_VERBOSE_MODE} ") message(" Building w/o assertions: ${DBUS_DISABLE_ASSERTS} ") message(" Building w/o checks: ${DBUS_DISABLE_CHECKS} ") +message(" Building bus stats API: ${DBUS_ENABLE_STATS} ") message(" installing system libs: ${DBUS_INSTALL_SYSTEM_LIBS} ") #message(" Building SELinux support: ${have_selinux} ") #message(" Building dnotify support: ${have_dnotify} ") @@ -611,3 +611,8 @@ endif(DBUS_DISABLE_CHECKS) MESSAGE(" ") INCLUDE(modules/CPackInstallConfig.cmake) + +add_custom_target(help-options + cmake -LH + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} +)