diff options
author | Stephen Kelly <steveire@gmail.com> | 2011-11-10 14:46:13 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2011-11-10 14:46:13 (GMT) |
commit | b8c8cab2428b10d5a1cb3af4ae72bc3c3f091f4d (patch) | |
tree | 4c3a7244ad733dc3d737f6d74164a2cef8edbcfe /Modules | |
parent | bafe5cc6e90ebb510dfe992c8a7a1eca55826813 (diff) | |
parent | 5675ec5e493e01e10d9ad8d8b60eac62033f31c2 (diff) | |
download | CMake-b8c8cab2428b10d5a1cb3af4ae72bc3c3f091f4d.zip CMake-b8c8cab2428b10d5a1cb3af4ae72bc3c3f091f4d.tar.gz CMake-b8c8cab2428b10d5a1cb3af4ae72bc3c3f091f4d.tar.bz2 |
Merge remote-tracking branch 'origin/master' into automoc_qt5
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/AutomocInfo.cmake.in | 1 | ||||
-rw-r--r-- | Modules/CPackRPM.cmake | 69 | ||||
-rw-r--r-- | Modules/DeployQt4.cmake | 15 | ||||
-rw-r--r-- | Modules/FindLibXslt.cmake | 23 |
4 files changed, 89 insertions, 19 deletions
diff --git a/Modules/AutomocInfo.cmake.in b/Modules/AutomocInfo.cmake.in index 5d440fb..8542ff6 100644 --- a/Modules/AutomocInfo.cmake.in +++ b/Modules/AutomocInfo.cmake.in @@ -3,6 +3,7 @@ set(AM_HEADERS "@_moc_headers@" ) set(AM_MOC_COMPILE_DEFINITIONS "@_moc_compile_defs@") set(AM_MOC_DEFINITIONS "@_moc_defs@") set(AM_MOC_INCLUDES "@_moc_incs@") +set(AM_MOC_OPTIONS "@_moc_options@") set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@") set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/") set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/") diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 51c8eac..bb1021b 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -4,7 +4,12 @@ # used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration # # However CPackRPM has specific features which are controlled by -# the specifics CPACK_RPM_XXX variables. +# the specifics CPACK_RPM_XXX variables. CPackRPM is a component aware +# generator so when CPACK_RPM_COMPONENT_INSTALL is ON some more +# CPACK_RPM_<ComponentName>_XXXX variables may be used in order +# to have component specific values. Note however that <componentName> +# refers to the **grouping name**. This may be either a component name +# or a component GROUP name. # Usually those vars correspond to RPM spec file entities, one may find # information about spec files here http://www.rpm.org/wiki/Docs. # You'll find a detailed usage of CPackRPM on the wiki: @@ -98,9 +103,11 @@ # If CPACK_SET_DESTDIR is set then you will get a warning message # but if there is file installed with absolute path you'll get # unexpected behavior. -# CPACK_RPM_SPEC_INSTALL_POST +# CPACK_RPM_SPEC_INSTALL_POST [deprecated] # Mandatory : NO # Default : - +# This way of specifying post-install script is deprecated use +# CPACK_RPM_POST_INSTALL_SCRIPT_FILE # May be used to set an RPM post-install command inside the spec file. # For example setting it to "/bin/true" may be used to prevent # rpmbuild to strip binaries. @@ -158,7 +165,7 @@ # Mandatory : NO # Default : - # May be used to embed a changelog in the spec file. -# The refered file will be read and directly put after the %changelog +# The refered file will be read and directly put after the %changelog # section. #============================================================================= @@ -388,9 +395,33 @@ if(CPACK_RPM_PACKAGE_RELOCATABLE) endif(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON")) endif(CPACK_RPM_PACKAGE_RELOCATABLE) -# check if additional fields for RPM spec header are given +# Check if additional fields for RPM spec header are given +# There may be some COMPONENT specific variables as well FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV) - IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}) + IF(CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}") + ENDIF(CPACK_RPM_PACKAGE_DEBUG) + if(CPACK_RPM_PACKAGE_COMPONENT) + if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}) + IF(CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: using CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}") + ENDIF(CPACK_RPM_PACKAGE_DEBUG) + set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}}) + else() + IF(CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER} not defined") + message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}") + ENDIF(CPACK_RPM_PACKAGE_DEBUG) + set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}) + endif() + else() + IF(CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}") + ENDIF(CPACK_RPM_PACKAGE_DEBUG) + set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}) + endif() + + IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) STRING(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH) MATH(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1") STRING(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL) @@ -398,10 +429,10 @@ FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLIC STRING(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME) SET(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}") IF(CPACK_RPM_PACKAGE_DEBUG) - MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}") + MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}") ENDIF(CPACK_RPM_PACKAGE_DEBUG) - SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}") - ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}) + SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}") +ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) ENDFOREACH(_RPM_SPEC_HEADER) # CPACK_RPM_SPEC_INSTALL_POST @@ -435,20 +466,31 @@ else(CPACK_RPM_PACKAGE_COMPONENT) set(CPACK_RPM_POST_INSTALL_READ_FILE ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE}) set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE}) endif(CPACK_RPM_PACKAGE_COMPONENT) + +# Handle post-install file if it has been specified if(CPACK_RPM_POST_INSTALL_READ_FILE) if(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE}) file(READ ${CPACK_RPM_POST_INSTALL_READ_FILE} CPACK_RPM_SPEC_POSTINSTALL) else(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE}) message("CPackRPM:Warning: CPACK_RPM_POST_INSTALL_SCRIPT_FILE <${CPACK_RPM_POST_INSTALL_READ_FILE}> does not exists - ignoring") endif(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE}) +else(CPACK_RPM_POST_INSTALL_READ_FILE) + # reset SPEC var value if no post install file has been specified + # (either globally or component-wise) + set(CPACK_RPM_SPEC_POSTINSTALL "") endif(CPACK_RPM_POST_INSTALL_READ_FILE) +# Handle post-uninstall file if it has been specified if(CPACK_RPM_POST_UNINSTALL_READ_FILE) if(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE}) file(READ ${CPACK_RPM_POST_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_POSTUNINSTALL) else(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE}) message("CPackRPM:Warning: CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_POST_UNINSTALL_READ_FILE}> does not exists - ignoring") endif(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE}) +else(CPACK_RPM_POST_UNINSTALL_READ_FILE) + # reset SPEC var value if no post uninstall file has been specified + # (either globally or component-wise) + set(CPACK_RPM_SPEC_POSTUNINSTALL "") endif(CPACK_RPM_POST_UNINSTALL_READ_FILE) # CPACK_RPM_PRE_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE) @@ -471,20 +513,31 @@ else(CPACK_RPM_PACKAGE_COMPONENT) set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE}) set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE}) endif(CPACK_RPM_PACKAGE_COMPONENT) + +# Handle pre-install file if it has been specified if(CPACK_RPM_PRE_INSTALL_READ_FILE) if(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE}) file(READ ${CPACK_RPM_PRE_INSTALL_READ_FILE} CPACK_RPM_SPEC_PREINSTALL) else(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE}) message("CPackRPM:Warning: CPACK_RPM_PRE_INSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_INSTALL_READ_FILE}> does not exists - ignoring") endif(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE}) +else(CPACK_RPM_PRE_INSTALL_READ_FILE) + # reset SPEC var value if no pre-install file has been specified + # (either globally or component-wise) + set(CPACK_RPM_SPEC_PREINSTALL "") endif(CPACK_RPM_PRE_INSTALL_READ_FILE) +# Handle pre-uninstall file if it has been specified if(CPACK_RPM_PRE_UNINSTALL_READ_FILE) if(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE}) file(READ ${CPACK_RPM_PRE_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_PREUNINSTALL) else(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE}) message("CPackRPM:Warning: CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_UNINSTALL_READ_FILE}> does not exists - ignoring") endif(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE}) +else(CPACK_RPM_PRE_UNINSTALL_READ_FILE) + # reset SPEC var value if no pre-uninstall file has been specified + # (either globally or component-wise) + set(CPACK_RPM_SPEC_PREUNINSTALL "") endif(CPACK_RPM_PRE_UNINSTALL_READ_FILE) # CPACK_RPM_CHANGELOG_FILE diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake index bdf8360..4bf1b6c 100644 --- a/Modules/DeployQt4.cmake +++ b/Modules/DeployQt4.cmake @@ -56,7 +56,7 @@ # (or <plugins_dir>) relative to <executable> and store the result in # <installed_plugin_path_var>. See documentation of INSTALL_QT4_PLUGIN_PATH. # -# INSTALL_QT4_EXECUTABLE(<executable> <qtplugins> [<libs> <dirs> <plugins_dir> <request_qt_conf>]) +# INSTALL_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>]) # Installs Qt plugins, writes a Qt configuration file (if needed) and fixes up # a Qt4 executable using BundleUtilities so it is standalone and can be # drag-and-drop copied to another machine as long as all of the system @@ -106,7 +106,8 @@ function(resolve_qt4_paths paths_var) set(${paths_var} ${paths_resolved} PARENT_SCOPE) endfunction() -function(fixup_qt4_executable executable qtplugins) +function(fixup_qt4_executable executable) + set(qtplugins ${ARGV1}) set(libs ${ARGV2}) set(dirs ${ARGV3}) set(plugins_dir ${ARGV4}) @@ -150,7 +151,6 @@ function(fixup_qt4_executable executable qtplugins) endforeach() resolve_qt4_paths(libs "${executable_path}") - resolve_qt4_paths(dirs "${executable_path}") if(write_qt_conf) set(qt_conf_contents "[Paths]\nPlugins = ${plugins_dir}") @@ -225,9 +225,11 @@ function(install_qt4_plugin plugin executable copy installed_plugin_path_var) else() string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var) endif() - set(plugin_release "${${plugin_var}_RELEASE}") - set(plugin_debug "${${plugin_var}_DEBUG}") - if(NOT EXISTS "${plugin_release}" AND NOT EXISTS "${plugin_debug}") + set(plugin_release_var "${plugin_var}_RELEASE") + set(plugin_debug_var "${plugin_var}_DEBUG") + set(plugin_release "${${plugin_release_var}}") + set(plugin_debug "${${plugin_debug_var}}") + if(DEFINED "${plugin_release_var}" AND DEFINED "${plugin_debug_var}" AND NOT EXISTS "${plugin_release}" AND NOT EXISTS "${plugin_debug}") message(WARNING "Qt plugin \"${plugin}\" not recognized or found.") endif() install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Release|RelWithDebInfo|MinSizeRel") @@ -264,7 +266,6 @@ function(install_qt4_executable executable) endforeach() resolve_qt4_paths(libs) - resolve_qt4_paths(dirs) install(CODE " INCLUDE( \"${DeployQt4_cmake_dir}/DeployQt4.cmake\" ) diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake index 462835a..1f49c3b 100644 --- a/Modules/FindLibXslt.cmake +++ b/Modules/FindLibXslt.cmake @@ -5,6 +5,9 @@ # LIBXSLT_INCLUDE_DIR - the LibXslt include directory # LIBXSLT_LIBRARIES - Link these to LibXslt # LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt +# Additionally, the following two variables are set (but not required for using xslt): +# LIBXSLT_EXSLT_LIBRARIES - Link to these if you need to link against the exslt library +# LIBXSLT_XSLTPROC_EXECUTABLE - Contains the full path to the xsltproc executable if found #============================================================================= # Copyright 2006-2009 Kitware, Inc. @@ -23,7 +26,7 @@ # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls FIND_PACKAGE(PkgConfig) -PKG_CHECK_MODULES(PC_LIBXSLT libxslt) +PKG_CHECK_MODULES(PC_LIBXSLT QUIET libxslt) SET(LIBXSLT_DEFINITIONS ${PC_LIBXSLT_CFLAGS_OTHER}) FIND_PATH(LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h @@ -38,10 +41,22 @@ FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt ${PC_LIBXSLT_LIBRARY_DIRS} ) -# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if +FIND_LIBRARY(LIBXSLT_EXSLT_LIBRARY NAMES exslt libexslt + HINTS + ${PC_LIBXSLT_LIBDIR} + ${PC_LIBXSLT_LIBRARY_DIRS} + ) + +SET(LIBXSLT_EXSLT_LIBRARIES ${LIBXSLT_EXSLT_LIBRARY} ) + +FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc) + +# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if # all listed variables are TRUE INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt DEFAULT_MSG LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR) -MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR LIBXSLT_LIBRARIES) - +MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR + LIBXSLT_LIBRARIES + LIBXSLT_EXSLT_LIBRARY + LIBXSLT_XSLTPROC_EXECUTABLE) |