From 4d0924f6b019c28db9f986b77d026482b5f4c73b Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Sat, 19 Dec 2009 11:39:16 -0800 Subject: [PATCH] More work on CMake build system (possibly finished?). --- cmake/Conky.cmake | 7 +------ cmake/ConkyBuildOptions.cmake | 14 +++++++++++--- cmake/ConkyPlatformChecks.cmake | 31 +++++++++++++++++++++++++++++++ doc/CMakeLists.txt | 6 ++++++ 4 files changed, 49 insertions(+), 9 deletions(-) diff --git a/cmake/Conky.cmake b/cmake/Conky.cmake index 063aab16..d74b1ab9 100644 --- a/cmake/Conky.cmake +++ b/cmake/Conky.cmake @@ -75,12 +75,7 @@ if(NOT RELEASE) mark_as_advanced(APP_GIT) endif(NOT RELEASE) -# Used for doc generation -find_program(APP_DB2X_XSLTPROC db2x_xsltproc) -find_program(APP_DB2X_MANXML db2x_manxml) -find_program(APP_XSLTPROC xsltproc) - -mark_as_advanced(APP_GAWK APP_WC APP_DATE APP_UNAME APP_DB2X_XSLTPROC APP_DB2X_MANXML APP_XSLTPROC) +mark_as_advanced(APP_GAWK APP_WC APP_DATE APP_UNAME) # The version numbers are simply derived from the date and number of commits # since start of month diff --git a/cmake/ConkyBuildOptions.cmake b/cmake/ConkyBuildOptions.cmake index 88a586e0..5ed7ba02 100644 --- a/cmake/ConkyBuildOptions.cmake +++ b/cmake/ConkyBuildOptions.cmake @@ -1,9 +1,15 @@ # vim: ts=4 sw=4 noet ai cindent syntax=cmake if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING - "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." - FORCE) + if(MAINTAINER_MODE) + set(CMAKE_BUILD_TYPE Debug CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." + FORCE) + else(MAINTAINER_MODE) + set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." + FORCE) + endif(MAINTAINER_MODE) endif(NOT CMAKE_BUILD_TYPE) # -std options for all build types @@ -22,6 +28,8 @@ endif(CMAKE_BUILD_TYPE MATCHES "Debug") option(RELEASE "Build release package" false) mark_as_advanced(RELEASE) +option(MAINTAINER_MODE "Enable maintainer mode (builds docs)" false) + # Some standard options set(SYSTEM_CONFIG_FILE "/etc/conky/conky.conf" CACHE STRING "Default system-wide Conky configuration file") # use FORCE below to make sure this changes when CMAKE_INSTALL_PREFIX is modified diff --git a/cmake/ConkyPlatformChecks.cmake b/cmake/ConkyPlatformChecks.cmake index 14bd0559..4bdd9fae 100644 --- a/cmake/ConkyPlatformChecks.cmake +++ b/cmake/ConkyPlatformChecks.cmake @@ -268,5 +268,36 @@ if(WANT_TOLUA) else(TOLUA_INCLUDE_PATH AND TOLUA_LIBS) message(FATAL_ERROR "Unable to find tolua++ library") endif(TOLUA_INCLUDE_PATH AND TOLUA_LIBS) + mark_as_advanced(APP_TOLUA TOLUA_INCLUDE_PATH TOLUA_LIBS) endif(WANT_TOLUA) +# Look for doc generation programs +if(MAINTAINER_MODE) + # Used for doc generation + find_program(APP_DB2X_XSLTPROC db2x_xsltproc) + if(NOT APP_DB2X_XSLTPROC) + message(FATAL_ERROR "Unable to find program 'db2x_xsltproc'") + endif(NOT APP_DB2X_XSLTPROC) + find_program(APP_DB2X_MANXML db2x_manxml) + if(NOT APP_DB2X_MANXML) + message(FATAL_ERROR "Unable to find program 'db2x_manxml'") + endif(NOT APP_DB2X_MANXML) + find_program(APP_XSLTPROC xsltproc) + if(NOT APP_XSLTPROC) + message(FATAL_ERROR "Unable to find program 'xsltproc'") + endif(NOT APP_XSLTPROC) + find_program(APP_MAN man) + if(NOT APP_MAN) + message(FATAL_ERROR "Unable to find program 'man'") + endif(NOT APP_MAN) + find_program(APP_LESS less) + if(NOT APP_LESS) + message(FATAL_ERROR "Unable to find program 'less'") + endif(NOT APP_LESS) + find_program(APP_SED sed) + if(NOT APP_SED) + message(FATAL_ERROR "Unable to find program 'sed'") + endif(NOT APP_SED) + mark_as_advanced(APP_DB2X_XSLTPROC APP_DB2X_MANXML APP_XSLTPROC APP_MAN) +endif(MAINTAINER_MODE) + diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index e69de29b..e01d5831 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -0,0 +1,6 @@ +include(Docbook) + +if(MAINTAINER_MODE) + wrap_xsltproc(lua config_settings variables) + wrap_man(docs) +endif(MAINTAINER_MODE)