diff options
27 files changed, 664 insertions, 139 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b25f694..b318a0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,19 +71,23 @@ MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES) CACHE BOOL "Use system-installed zlib" FORCE) SET(CMAKE_USE_SYSTEM_BZIP2 "${CMAKE_USE_SYSTEM_LIBRARIES}" CACHE BOOL "Use system-installed bzip2" FORCE) + SET(CMAKE_USE_SYSTEM_LIBARCHIVE "${CMAKE_USE_SYSTEM_LIBRARIES}" + CACHE BOOL "Use system-installed libarchive" FORCE) ENDIF(CMAKE_USE_SYSTEM_LIBRARIES_USER) # Optionally use system utility libraries. + OPTION(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" ${CMAKE_USE_SYSTEM_LIBRARIES}) CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl" ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CTEST_USE_XMLRPC" ON) CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat" ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CTEST_USE_XMLRPC" ON) CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib" - ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_CURL" ON) - OPTION(CMAKE_USE_SYSTEM_BZIP2 "Use system-installed bzip2" OFF) + ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_LIBARCHIVE;NOT CMAKE_USE_SYSTEM_CURL" ON) + CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_BZIP2 "Use system-installed bzip2" + ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON) # Mention to the user what system libraries are being used. - FOREACH(util BZIP2 CURL EXPAT ZLIB) + FOREACH(util BZIP2 CURL EXPAT LIBARCHIVE ZLIB) IF(CMAKE_USE_SYSTEM_${util}) MESSAGE(STATUS "Using system-installed ${util}") ENDIF(CMAKE_USE_SYSTEM_${util}) @@ -266,9 +270,20 @@ MACRO (CMAKE_BUILD_UTILITIES) SET(BZIP2_LIBRARIES cmbzip2) ADD_SUBDIRECTORY(Utilities/cmbzip2) ENDIF() + + #--------------------------------------------------------------------- + # Build or use system libarchive for CMake and CTest. IF(CMAKE_USE_SYSTEM_LIBARCHIVE) - FIND_PACKAGE(libarchive) - SET(CMAKE_TAR_LIBRARIES libarchive) + IF(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) + FIND_PACKAGE(LibArchive) + ELSE() + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR) + INCLUDE(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake) + ENDIF() + IF(NOT LibArchive_FOUND) + MESSAGE(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!") + ENDIF() + SET(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES}) ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE) SET(HAVE_LIBZ 1) SET(HAVE_ZLIB_H 1) diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index d9c41f4..4d3baf8 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -13,6 +13,7 @@ # set_bundle_key_values # get_bundle_keys # copy_resolved_item_into_bundle +# copy_resolved_framework_into_bundle # fixup_bundle_item # fixup_bundle # copy_and_fixup_bundle @@ -433,6 +434,59 @@ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item) endfunction(copy_resolved_item_into_bundle) +# copy_resolved_framework_into_bundle +# +# Copy a resolved framework into the bundle if necessary. Copy is not necessary +# if the resolved_item is "the same as" the resolved_embedded_item. +# +# By default, BU_COPY_FULL_FRAMEWORK_CONTENTS is not set. If you want full +# frameworks embedded in your bundles, set BU_COPY_FULL_FRAMEWORK_CONTENTS to +# ON before calling fixup_bundle. By default, +# copy_resolved_framework_into_bundle copies the framework dylib itself plus +# any framework Resources. +# +function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_item) + if(WIN32) + # ignore case on Windows + string(TOLOWER "${resolved_item}" resolved_item_compare) + string(TOLOWER "${resolved_embedded_item}" resolved_embedded_item_compare) + else() + set(resolved_item_compare "${resolved_item}") + set(resolved_embedded_item_compare "${resolved_embedded_item}") + endif() + + if("${resolved_item_compare}" STREQUAL "${resolved_embedded_item_compare}") + message(STATUS "warning: resolved_item == resolved_embedded_item - not copying...") + else() + if(BU_COPY_FULL_FRAMEWORK_CONTENTS) + # Full Framework (everything): + get_filename_component(resolved_dir "${resolved_item}" PATH) + get_filename_component(resolved_dir "${resolved_dir}/../.." ABSOLUTE) + get_filename_component(resolved_embedded_dir "${resolved_embedded_item}" PATH) + get_filename_component(resolved_embedded_dir "${resolved_embedded_dir}/../.." ABSOLUTE) + #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_dir}' '${resolved_embedded_dir}'") + execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_dir}" "${resolved_embedded_dir}") + else() + # Framework lib itself: + #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}") + execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}") + + # Plus Resources, if they exist: + string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Resources" resolved_resources "${resolved_item}") + string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Resources" resolved_embedded_resources "${resolved_embedded_item}") + if(EXISTS "${resolved_resources}") + #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_resources}' '${resolved_embedded_resources}'") + execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_resources}" "${resolved_embedded_resources}") + endif() + endif() + endif() + + if(UNIX AND NOT APPLE) + file(RPATH_REMOVE FILE "${resolved_embedded_item}") + endif(UNIX AND NOT APPLE) +endfunction(copy_resolved_framework_into_bundle) + + # fixup_bundle_item # # Get the direct/non-system prerequisites of the resolved embedded item. For each @@ -528,8 +582,14 @@ function(fixup_bundle app libs dirs) endif(show_status) if(${${key}_COPYFLAG}) - copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}" - "${${key}_RESOLVED_EMBEDDED_ITEM}") + set(item "${${key}_ITEM}") + if(item MATCHES "[^/]+\\.framework/") + copy_resolved_framework_into_bundle("${${key}_RESOLVED_ITEM}" + "${${key}_RESOLVED_EMBEDDED_ITEM}") + else() + copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}" + "${${key}_RESOLVED_EMBEDDED_ITEM}") + endif() endif(${${key}_COPYFLAG}) endforeach(key) diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index f5ca592..18acfb7 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -1,15 +1,18 @@ # - The builtin (binary) CPack Deb generator (Unix only) # CPackDeb may be used to create Deb package using CPack. # CPackDeb is a CPack generator thus it uses the CPACK_XXX variables -# used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration +# used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. +# CPackDeb generator should work on any linux host but it will +# produce better deb package when Debian specific tools 'dpkg-xxx' +# are usable on the build system. # -# However CPackRPM has specific features which are controlled by -# the specifics CPACK_RPM_XXX variables.You'll find a detailed usage on -# the wiki: +# CPackDeb has specific features which are controlled by +# the specifics CPACK_DEBIAN_XXX variables.You'll find a detailed usage on +# the wiki: # http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29 # However as a handy reminder here comes the list of specific variables: # -# CPACK_DEBIAN_PACKAGE_NAME +# CPACK_DEBIAN_PACKAGE_NAME # Mandatory : YES # Default : CPACK_PACKAGE_NAME (lower case) # The debian package summary @@ -19,12 +22,12 @@ # The debian package version # CPACK_DEBIAN_PACKAGE_ARCHITECTURE) # Mandatory : YES -# Default : Output of dpkg --print-architecture or i386 +# Default : Output of dpkg --print-architecture (or i386 if dpkg is not found) # The debian package architecture # CPACK_DEBIAN_PACKAGE_DEPENDS # Mandatory : NO # Default : - -# May be used to set deb dependencies. +# May be used to set deb dependencies. # CPACK_DEBIAN_PACKAGE_MAINTAINER # Mandatory : YES # Default : CPACK_PACKAGE_CONTACT @@ -41,6 +44,25 @@ # Mandatory : YES # Default : 'optional' # The debian package priority +# CPACK_DEBIAN_PACKAGE_HOMEPAGE +# Mandatory : NO +# Default : - +# The URL of the web site for this package +# CPACK_DEBIAN_PACKAGE_SHLIBDEPS +# Mandatory : NO +# Default : OFF +# May be set to ON in order to use dpkg-shlibdeps to generate +# better package dependency list. +# You may need set CMAKE_INSTALL_RPATH toi appropriate value +# if you use this feature, because if you don't dpkg-shlibdeps +# may fail to find your own shared libs. +# See http://www.cmake.org/Wiki/CMake_RPATH_handling. +# CPACK_DEBIAN_PACKAGE_DEBUG +# Mandatory : NO +# Default : - +# May be set when invoking cpack in order to trace debug informations +# during CPackDeb run. + #============================================================================= # Copyright 2007-2009 Kitware, Inc. @@ -69,6 +91,103 @@ IF(NOT UNIX) MESSAGE(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.") ENDIF(NOT UNIX) +# CPACK_DEBIAN_PACKAGE_SHLIBDEPS +# If specify OFF, only user depends are used +IF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS) + SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) +ENDIF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS) + +IF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) + # dpkg-shlibdeps is a Debian utility for generating dependency list + FIND_PROGRAM(SHLIBDEPS_EXECUTABLE dpkg-shlibdeps) + + # Check version of the dpkg-shlibdeps tool using CPackRPM method + IF(SHLIBDEPS_EXECUTABLE) + EXECUTE_PROCESS(COMMAND ${SHLIBDEPS_EXECUTABLE} --version + OUTPUT_VARIABLE _TMP_VERSION + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + STRING(REGEX MATCH "dpkg-shlibdeps version ([0-9]+\\.[0-9]+\\.[0-9]+)" + SHLIBDEPS_EXECUTABLE_VERSION + ${_TMP_VERSION}) + SET(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}") + IF(CPACK_DEBIAN_PACKAGE_DEBUG) + MESSAGE( "CPackDeb Debug: dpkg-shlibdeps version is <${SHLIBDEPS_EXECUTABLE_VERSION}>") + ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG) + + # Generating binary list - Get type of all install files + EXECUTE_PROCESS(COMMAND find -type f + COMMAND xargs file + WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" + OUTPUT_VARIABLE CPACK_DEB_INSTALL_FILES) + + # Convert to CMake list + STRING(REGEX REPLACE "\n" ";" CPACK_DEB_INSTALL_FILES ${CPACK_DEB_INSTALL_FILES}) + + # Only dynamically linked ELF files are included + # Extract only file name infront of ":" + FOREACH ( _FILE ${CPACK_DEB_INSTALL_FILES}) + IF ( ${_FILE} MATCHES "ELF.*dynamically linked") + STRING(REGEX MATCH "(^.*):" _FILE_NAME ${_FILE}) + LIST(APPEND CPACK_DEB_BINARY_FILES ${CMAKE_MATCH_1}) + ENDIF() + ENDFOREACH() + + MESSAGE( "CPackDeb: - Generating dependency list") + + # Create blank control file for running dpkg-shlibdeps + # There might be some other way to invoke dpkg-shlibdeps without creating this file + # but standard debian package should not have anything that can collide with this file or directory + FILE(MAKE_DIRECTORY ${CPACK_TEMPORARY_DIRECTORY}/debian) + FILE(WRITE ${CPACK_TEMPORARY_DIRECTORY}/debian/control "") + + # Execute dpkg-shlibdeps + # --ignore-missing-info : allow dpkg-shlibdeps to run even if some libs do not belong to a package + # -O : print to STDOUT + EXECUTE_PROCESS(COMMAND ${SHLIBDEPS_EXECUTABLE} --ignore-missing-info -O ${CPACK_DEB_BINARY_FILES} + WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" + OUTPUT_VARIABLE SHLIBDEPS_OUTPUT + RESULT_VARIABLE SHLIBDEPS_RESULT + ERROR_VARIABLE SHLIBDEPS_ERROR + OUTPUT_STRIP_TRAILING_WHITESPACE ) + IF(CPACK_DEBIAN_PACKAGE_DEBUG) + # dpkg-shlibdeps will throw some warnings if some input files are not binary + MESSAGE( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}") + ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG) + IF (NOT SHLIBDEPS_RESULT EQUAL 0) + MESSAGE (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}") + ENDIF (NOT SHLIBDEPS_RESULT EQUAL 0) + + #Get rid of prefix generated by dpkg-shlibdeps + string (REGEX REPLACE "^.*Depends=" "" CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS ${SHLIBDEPS_OUTPUT}) + + IF(CPACK_DEBIAN_PACKAGE_DEBUG) + MESSAGE( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}") + ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG) + + # Remove blank control file + # Might not be safe if package actual contain file or directory named debian + FILE(REMOVE_RECURSE "${CPACK_TEMPORARY_DIRECTORY}/debian") + + # Append user depend if set + IF (CPACK_DEBIAN_PACKAGE_DEPENDS) + SET (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}") + ELSE (CPACK_DEBIAN_PACKAGE_DEPENDS) + SET (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}") + ENDIF (CPACK_DEBIAN_PACKAGE_DEPENDS) + + ELSE (SHLIBDEPS_EXECUTABLE) + IF(CPACK_DEBIAN_PACKAGE_DEBUG) + MESSAGE( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.") + ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG) + ENDIF(SHLIBDEPS_EXECUTABLE) + +ELSE (CPACK_DEBIAN_PACKAGE_SHLIBDEPS) + IF(CPACK_DEBIAN_PACKAGE_DEBUG) + MESSAGE( "CPackDeb Debug: Using only user-provided depends") + ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG) +ENDIF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) + # Let's define the control file found in debian package: # Binary package: @@ -84,7 +203,7 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_NAME) # Version: (mandatory) IF(NOT CPACK_DEBIAN_PACKAGE_VERSION) IF(NOT CPACK_PACKAGE_VERSION) - MESSAGE(FATAL_ERROR "Debian package requires a package version") + MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a package version") ENDIF(NOT CPACK_PACKAGE_VERSION) SET(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION}) ENDIF(NOT CPACK_DEBIAN_PACKAGE_VERSION) @@ -95,7 +214,7 @@ IF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) # $ dpkg --print-architecture FIND_PROGRAM(DPKG_CMD dpkg) IF(NOT DPKG_CMD) - MESSAGE(STATUS "Can not find dpkg in your path, default to i386.") + MESSAGE(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.") SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386) ENDIF(NOT DPKG_CMD) EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture @@ -116,7 +235,7 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_DEPENDS) # Maintainer: (mandatory) IF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER) IF(NOT CPACK_PACKAGE_CONTACT) - MESSAGE(FATAL_ERROR "Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER") + MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER") ENDIF(NOT CPACK_PACKAGE_CONTACT) SET(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT}) ENDIF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER) @@ -124,7 +243,7 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER) # Description: (mandatory) IF(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION) IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) - MESSAGE(FATAL_ERROR "Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION") + MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION") ENDIF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}) ENDIF(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION) @@ -147,13 +266,13 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY ) # CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA # This variable allow advanced user to add custom script to the control.tar.gz (inside the .deb archive) -# Typical examples are: +# Typical examples are: # - conffiles # - postinst # - postrm # - prerm" # Usage: -# SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA +# SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA # "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm") diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index b4359c8..fcb5199 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -154,8 +154,8 @@ function(_ep_parse_arguments f name ns args) # correctly based on target properties. # # We loop through ARGN and consider the namespace starting with an - # upper-case letter followed by at least two more upper-case letters - # or underscores to be keywords. + # upper-case letter followed by at least two more upper-case letters, + # numbers or underscores to be keywords. set(key) foreach(arg IN LISTS args) @@ -166,14 +166,6 @@ function(_ep_parse_arguments f name ns args) NOT arg MATCHES "^(TRUE|FALSE)$") if(_ep_keywords_${f} AND arg MATCHES "${_ep_keywords_${f}}") set(is_value 0) - else() - if(NOT (key STREQUAL "COMMAND") - AND NOT (key STREQUAL "CVS_MODULE") - AND NOT (key STREQUAL "DEPENDS") - AND NOT (key STREQUAL "DOWNLOAD_COMMAND") - ) - message(AUTHOR_WARNING "unknown ${f} keyword: ${arg}") - endif() endif() endif() diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake index b604d0b..b1b5010 100644 --- a/Modules/FindBISON.cmake +++ b/Modules/FindBISON.cmake @@ -5,6 +5,9 @@ # BISON_VERSION - version of bison # BISON_FOUND - true if the program was found # +# The minimum required version of bison can be specified using the +# standard CMake syntax, e.g. find_package(BISON 2.1.3) +# # If bison is found, the module defines the macros: # BISON_TARGET(<Name> <YaccInput> <CodeOutput> [VERBOSE <file>] # [COMPILE_FLAGS <string>]) @@ -149,6 +152,7 @@ IF(BISON_EXECUTABLE) ENDIF(BISON_EXECUTABLE) INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON DEFAULT_MSG BISON_EXECUTABLE) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE + VERSION_VAR BISON_VERSION) # FindBISON.cmake ends here diff --git a/Modules/FindLibArchive.cmake b/Modules/FindLibArchive.cmake new file mode 100644 index 0000000..fab5160 --- /dev/null +++ b/Modules/FindLibArchive.cmake @@ -0,0 +1,63 @@ +# - Find libarchive library and headers +# The module defines the following variables: +# +# LibArchive_FOUND - true if libarchive was found +# LibArchive_INCLUDE_DIRS - include search path +# LibArchive_LIBRARIES - libraries to link +# LibArchive_VERSION - libarchive 3-component version number + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distributed this file outside of CMake, substitute the full +# License text for the above reference.) + +find_path(LibArchive_INCLUDE_DIR + NAMES archive.h + PATHS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\LibArchive;InstallPath]/include" + ) + +find_library(LibArchive_LIBRARY + NAMES archive libarchive + PATHS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\LibArchive;InstallPath]/lib" + ) + +mark_as_advanced(LibArchive_INCLUDE_DIR LibArchive_LIBRARY) + +# Extract the version number from the header. +if(LibArchive_INCLUDE_DIR AND EXISTS "${LibArchive_INCLUDE_DIR}/archive.h") + # The version string appears in one of two known formats in the header: + # #define ARCHIVE_LIBRARY_VERSION "libarchive 2.4.12" + # #define ARCHIVE_VERSION_STRING "libarchive 2.8.4" + # Match either format. + set(_LibArchive_VERSION_REGEX "^#define[ \t]+ARCHIVE[_A-Z]+VERSION[_A-Z]*[ \t]+\"libarchive +([0-9]+)\\.([0-9]+)\\.([0-9]+)[^\"]*\".*$") + file(STRINGS "${LibArchive_INCLUDE_DIR}/archive.h" _LibArchive_VERSION_STRING LIMIT_COUNT 1 REGEX "${_LibArchive_VERSION_REGEX}") + if(_LibArchive_VERSION_STRING) + string(REGEX REPLACE "${_LibArchive_VERSION_REGEX}" "\\1.\\2.\\3" LibArchive_VERSION "${_LibArchive_VERSION_STRING}") + endif() + unset(_LibArchive_VERSION_REGEX) + unset(_LibArchive_VERSION_STRING) +endif() + +# Handle the QUIETLY and REQUIRED arguments and set LIBARCHIVE_FOUND +# to TRUE if all listed variables are TRUE. +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LibArchive DEFAULT_MSG + LibArchive_LIBRARY LibArchive_INCLUDE_DIR + ) +set(LibArchive_FOUND ${LIBARCHIVE_FOUND}) +unset(LIBARCHIVE_FOUND) + +if(LibArchive_FOUND) + set(LibArchive_INCLUDE_DIRS ${LibArchive_INCLUDE_DIR}) + set(LibArchive_LIBRARIES ${LibArchive_LIBRARY}) +endif() diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 826ae09..bf47ab8 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -40,7 +40,7 @@ MARK_AS_ADVANCED(OPENSSL_ROOT_DIR) # Re-use the previous path: FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h - ${OPENSSL_ROOT_DIR}/include + PATHS ${OPENSSL_ROOT_DIR}/include ) IF(WIN32 AND NOT CYGWIN) @@ -61,16 +61,16 @@ IF(WIN32 AND NOT CYGWIN) # libeay32MD.lib is identical to ../libeay32.lib, and # ssleay32MD.lib is identical to ../ssleay32.lib FIND_LIBRARY(LIB_EAY_DEBUG NAMES libeay32MDd libeay32 - ${OPENSSL_ROOT_DIR}/lib/VC + PATHS ${OPENSSL_ROOT_DIR}/lib/VC ) FIND_LIBRARY(LIB_EAY_RELEASE NAMES libeay32MD libeay32 - ${OPENSSL_ROOT_DIR}/lib/VC + PATHS ${OPENSSL_ROOT_DIR}/lib/VC ) FIND_LIBRARY(SSL_EAY_DEBUG NAMES ssleay32MDd ssleay32 ssl - ${OPENSSL_ROOT_DIR}/lib/VC + PATHS ${OPENSSL_ROOT_DIR}/lib/VC ) FIND_LIBRARY(SSL_EAY_RELEASE NAMES ssleay32MD ssleay32 ssl - ${OPENSSL_ROOT_DIR}/lib/VC + PATHS ${OPENSSL_ROOT_DIR}/lib/VC ) if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) set( OPENSSL_LIBRARIES @@ -85,20 +85,20 @@ IF(WIN32 AND NOT CYGWIN) ELSEIF(MINGW) # same player, for MingW FIND_LIBRARY(LIB_EAY NAMES libeay32 - ${OPENSSL_ROOT_DIR}/lib/MinGW + PATHS ${OPENSSL_ROOT_DIR}/lib/MinGW ) FIND_LIBRARY(SSL_EAY NAMES ssleay32 - ${OPENSSL_ROOT_DIR}/lib/MinGW + PATHS ${OPENSSL_ROOT_DIR}/lib/MinGW ) MARK_AS_ADVANCED(SSL_EAY LIB_EAY) set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} ) ELSE(MSVC) # Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues: FIND_LIBRARY(LIB_EAY NAMES libeay32 - ${OPENSSL_ROOT_DIR}/lib + PATHS ${OPENSSL_ROOT_DIR}/lib ) FIND_LIBRARY(SSL_EAY NAMES ssleay32 - ${OPENSSL_ROOT_DIR}/lib + PATHS ${OPENSSL_ROOT_DIR}/lib ) MARK_AS_ADVANCED(SSL_EAY LIB_EAY) set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} ) diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index e17105c..389697e 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -1,21 +1,58 @@ -# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... ) -# This macro is intended to be used in FindXXX.cmake modules files. -# It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and -# it also sets the <UPPERCASED_NAME>_FOUND variable. -# The package is found if all variables listed are TRUE. -# Example: +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... ) # -# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR) +# This function is intended to be used in FindXXX.cmake modules files. +# It handles the REQUIRED, QUIET and version-related arguments to FIND_PACKAGE(). +# It also sets the <UPPERCASED_NAME>_FOUND variable. +# The package is considered found if all variables <var1>... listed contain +# valid results, e.g. valid filepaths. # -# LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and -# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE. -# If it is not found and REQUIRED was used, it fails with FATAL_ERROR, -# independent whether QUIET was used or not. -# If it is found, the location is reported using the VAR1 argument, so -# here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out. -# If the second argument is DEFAULT_MSG, the message in the failure case will -# be "Could NOT find LibXml2", if you don't like this message you can specify -# your own custom failure message there. +# There are two modes of this function. The first argument in both modes is +# the name of the Find-module where it is called (in original casing). +# +# The first simple mode looks like this: +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> ) +# If the variables <var1> to <varN> are all valid, then <UPPERCASED_NAME>_FOUND +# will be set to TRUE. +# If DEFAULT_MSG is given as second argument, then the function will generate +# itself useful success and error messages. You can also supply a custom error message +# for the failure case. This is not recommended. +# +# The second mode is more powerful and also supports version checking: +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>] +# [VERSION_VAR <versionvar> +# [FAIL_MESSAGE "Custom failure message"] ) +# +# As above, if <var1> through <varN> are all valid, <UPPERCASED_NAME>_FOUND +# will be set to TRUE. +# Via FAIL_MESSAGE a custom failure message can be specified, if this is not +# used, the default message will be displayed. +# Following VERSION_VAR the name of the variable can be specified which holds +# the version of the package which has been found. If this is done, this version +# will be checked against the (potentially) specified required version used +# in the find_package() call. The EXACT keyword is also handled. The default +# messages include information about the required version and the version +# which has been actually found, both if the version is ok or not. +# +# Example for mode 1: +# +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) +# +# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and +# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE. +# If it is not found and REQUIRED was used, it fails with FATAL_ERROR, +# independent whether QUIET was used or not. +# If it is found, success will be reported, including the content of <var1>. +# On repeated Cmake runs, the same message won't be printed again. +# +# Example for mode 2: +# +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE +# VERSION_VAR BISON_VERSION) +# In this case, BISON is considered to be found if the variable(s) listed +# after REQUIRED_VAR are all valid, i.e. BISON_EXECUTABLE in this case. +# Also the version of BISON will be checked by using the version contained +# in BISON_VERSION. +# Since no FAIL_MESSAGE is given, the default messages will be printed. #============================================================================= # Copyright 2007-2009 Kitware, Inc. @@ -31,13 +68,89 @@ # License text for the above reference.) INCLUDE(FindPackageMessage) -FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 ) - IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") +# Checks a list of strings (typically function/macro parameters) whether it contains a keyword +# (_keyword) and return the value(s) following this keyword in _outputVar. +# If _multipleValues is true, this can be more than one value. +# Then end of the values for a keyword is then determined by checking whether the +# next argument is contained in _allKeywordsList. +FUNCTION(FPHSA_GET_OPTION_VALUE _keyword _outputVar _allArgsList _allKeywordsList _multipleValues) + UNSET(${_outputVar}) + UNSET(_removeIndices) + + SET(_insideValues FALSE) + SET(_counter 0) + FOREACH(_currentArg ${${_allArgsList}}) + IF(NOT _insideValues) # first check that we find the keyword we are currently interested in... + IF("${_currentArg}" STREQUAL "${_keyword}") + SET(_insideValues TRUE) + LIST(APPEND _removeIndices ${_counter}) + ENDIF("${_currentArg}" STREQUAL "${_keyword}") + ELSE(NOT _insideValues) + + LIST(FIND ${_allKeywordsList} "${_currentArg}" _index) # ... then this marks the end of the arguments belonging to this keyword + IF(${_index} EQUAL -1) + LIST(APPEND _result ${_currentArg}) + LIST(APPEND _removeIndices ${_counter}) # collect the indices of the strings we found to remove them from the list afterwards + IF(NOT _multipleValues) + BREAK() + ENDIF(NOT _multipleValues) + ELSE(${_index} EQUAL -1) + SET(_insideValues FALSE) + BREAK() + ENDIF(${_index} EQUAL -1) + ENDIF(NOT _insideValues) + + MATH(EXPR _counter "${_counter} + 1") + + ENDFOREACH(_currentArg ${${_allArgsList}}) + + IF(DEFINED _removeIndices) + LIST(REMOVE_AT ${_allArgsList} ${_removeIndices}) + ENDIF(DEFINED _removeIndices) + + SET(${_outputVar} ${_result} PARENT_SCOPE) + SET(${_allArgsList} ${${_allArgsList}} PARENT_SCOPE) + +ENDFUNCTION(FPHSA_GET_OPTION_VALUE _keyword _outputVar _allArgsList _allKeywordsList _multipleValues) + + +FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1) + + SET(_KEYWORDS_FOR_EXTENDED_MODE FAIL_MESSAGE REQUIRED_VARS VERSION_VAR ) + LIST(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX) + + IF(${INDEX} EQUAL -1) + SET(_FAIL_MESSAGE ${_FIRST_ARG}) + SET(_REQUIRED_VARS ${_VAR1} ${ARGN}) + SET(_VERSION_VAR) + ELSE(${INDEX} EQUAL -1) + SET(ALL_ARGS ${_FIRST_ARG} ${_VAR1} ${ARGN}) + + FPHSA_GET_OPTION_VALUE("FAIL_MESSAGE" _FAIL_MESSAGE ALL_ARGS _KEYWORDS_FOR_EXTENDED_MODE FALSE) + FPHSA_GET_OPTION_VALUE("REQUIRED_VARS" _REQUIRED_VARS ALL_ARGS _KEYWORDS_FOR_EXTENDED_MODE TRUE) + FPHSA_GET_OPTION_VALUE("VERSION_VAR" _VERSION_VAR ALL_ARGS _KEYWORDS_FOR_EXTENDED_MODE FALSE) + + IF(ALL_ARGS) + MESSAGE(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${ALL_ARGS}\"") + ENDIF(ALL_ARGS) + + IF(NOT _FAIL_MESSAGE) + SET(_FAIL_MESSAGE "DEFAULT_MSG") + ENDIF(NOT _FAIL_MESSAGE) + ENDIF(${INDEX} EQUAL -1) + +# now that we collected all arguments, process them + + IF("${_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") SET(_FAIL_MESSAGE "Could NOT find ${_NAME}") - ELSE("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") - SET(_FAIL_MESSAGE "${_FAIL_MSG}") - ENDIF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") + ENDIF("${_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") + + IF(NOT _REQUIRED_VARS) + MESSAGE(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()") + ENDIF(NOT _REQUIRED_VARS) + + LIST(GET _REQUIRED_VARS 0 _FIRST_REQUIRED_VAR) STRING(TOUPPER ${_NAME} _NAME_UPPER) @@ -46,15 +159,8 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 ) SET(MISSING_VARS "") SET(DETAILS "") SET(${_NAME_UPPER}_FOUND TRUE) - IF(NOT ${_VAR1}) - SET(${_NAME_UPPER}_FOUND FALSE) - SET(MISSING_VARS " ${_VAR1}") - ELSE(NOT ${_VAR1}) - SET(DETAILS "${DETAILS}[${${_VAR1}}]") - ENDIF(NOT ${_VAR1}) - # check if all passed variables are valid - FOREACH(_CURRENT_VAR ${ARGN}) + FOREACH(_CURRENT_VAR ${_REQUIRED_VARS}) IF(NOT ${_CURRENT_VAR}) SET(${_NAME_UPPER}_FOUND FALSE) SET(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}") @@ -63,18 +169,84 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 ) ENDIF(NOT ${_CURRENT_VAR}) ENDFOREACH(_CURRENT_VAR) + + # version handling: + SET(VERSION_MSG "") + SET(VERSION_OK TRUE) + IF (${_NAME}_FIND_VERSION) + + # if the package was found, check for the version using <NAME>_FIND_VERSION + IF (${_NAME_UPPER}_FOUND) + SET(VERSION ${${_VERSION_VAR}} ) + + IF(VERSION) + + IF(${_NAME}_FIND_VERSION_EXACT) # exact version required + IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}") + SET(VERSION_MSG " Found version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"") + SET(VERSION_OK FALSE) + ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}") + SET(VERSION_MSG " (found exact version \"${VERSION}\")") + ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}") + + ELSE(${_NAME}_FIND_VERSION_EXACT) # minimum version specified: + IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}") + SET(VERSION_MSG " Found version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"") + SET(VERSION_OK FALSE) + ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}") + SET(VERSION_MSG " (found version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")") + ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}") + ENDIF(${_NAME}_FIND_VERSION_EXACT) + +# Uncomment the following two lines to see to which Find-modules the VERSION_VAR keywords still need to be added: +# ELSE(VERSION) +# SET(VERSION_MSG " (WARNING: Required version is \"${${_NAME}_FIND_VERSION}\", but version of ${_NAME} is unknown)") + ENDIF(VERSION) + + # if the package was not found, but a version was given, add that to the output: + ELSE (${_NAME_UPPER}_FOUND) + IF(${_NAME}_FIND_VERSION_EXACT) + SET(VERSION_MSG " (Required is exact version \"${${_NAME}_FIND_VERSION}\")") + ELSE(${_NAME}_FIND_VERSION_EXACT) + SET(VERSION_MSG " (Required is at least version \"${${_NAME}_FIND_VERSION}\")") + ENDIF(${_NAME}_FIND_VERSION_EXACT) + ENDIF (${_NAME_UPPER}_FOUND) + ENDIF (${_NAME}_FIND_VERSION) + + IF(VERSION_OK) + SET(DETAILS "${DETAILS}[v${${VERSION}}]") + ELSE(VERSION_OK) + SET(${_NAME_UPPER}_FOUND FALSE) + ENDIF(VERSION_OK) + + + # print the result: IF (${_NAME_UPPER}_FOUND) - FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_VAR1}}" "${DETAILS}") + FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG}" "${DETAILS}") ELSE (${_NAME_UPPER}_FOUND) - IF (${_NAME}_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE} (missing: ${MISSING_VARS})") - ELSE (${_NAME}_FIND_REQUIRED) - IF (NOT ${_NAME}_FIND_QUIETLY) - MESSAGE(STATUS "${_FAIL_MESSAGE} (missing: ${MISSING_VARS})") - ENDIF (NOT ${_NAME}_FIND_QUIETLY) - ENDIF (${_NAME}_FIND_REQUIRED) + IF(NOT VERSION_OK) + + IF (${_NAME}_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})") + ELSE (${_NAME}_FIND_REQUIRED) + IF (NOT ${_NAME}_FIND_QUIETLY) + MESSAGE(STATUS "${_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})") + ENDIF (NOT ${_NAME}_FIND_QUIETLY) + ENDIF (${_NAME}_FIND_REQUIRED) + + ELSE(NOT VERSION_OK) + + IF (${_NAME}_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}") + ELSE (${_NAME}_FIND_REQUIRED) + IF (NOT ${_NAME}_FIND_QUIETLY) + MESSAGE(STATUS "${_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}") + ENDIF (NOT ${_NAME}_FIND_QUIETLY) + ENDIF (${_NAME}_FIND_REQUIRED) + ENDIF(NOT VERSION_OK) + ENDIF (${_NAME_UPPER}_FOUND) SET(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE) -ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS) +ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG) diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake index 8711634..62cc5c5 100644 --- a/Modules/FindTIFF.cmake +++ b/Modules/FindTIFF.cmake @@ -22,7 +22,7 @@ FIND_PATH(TIFF_INCLUDE_DIR tiff.h) -SET(TIFF_NAMES ${TIFF_NAMES} tiff libtiff libtiff3) +SET(TIFF_NAMES ${TIFF_NAMES} tiff libtiff tiff3 libtiff3) FIND_LIBRARY(TIFF_LIBRARY NAMES ${TIFF_NAMES} ) # handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if diff --git a/Modules/MacroAddFileDependencies.cmake b/Modules/MacroAddFileDependencies.cmake index e4a82d1..785352e 100644 --- a/Modules/MacroAddFileDependencies.cmake +++ b/Modules/MacroAddFileDependencies.cmake @@ -1,6 +1,6 @@ # - MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) # Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged. There are usually -# better ways to specifiy the correct dependencies. +# better ways to specify the correct dependencies. # # MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a convenience # wrapper around the OBJECT_DEPENDS source file property. You can just diff --git a/Modules/Platform/GNU.cmake b/Modules/Platform/GNU.cmake index fe3d47b..e0ed86c 100644 --- a/Modules/Platform/GNU.cmake +++ b/Modules/Platform/GNU.cmake @@ -4,5 +4,8 @@ SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") +SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,") SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,") +SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic") + INCLUDE(Platform/UnixPaths) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index dbbb558..b098da1 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -350,7 +350,7 @@ ENDIF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) # CTestLib # INCLUDE_DIRECTORIES( - "${CMAKE_SOURCE_DIR}/Source/CTest" + "${CMake_SOURCE_DIR}/Source/CTest" ${CMAKE_XMLRPC_INCLUDES} ${CMAKE_CURL_INCLUDES} ) @@ -493,8 +493,8 @@ IF(BUILD_QtDialog) SUBDIRS(QtDialog) ENDIF(BUILD_QtDialog) -INCLUDE (${CMAKE_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL) -INCLUDE (${CMAKE_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL) +INCLUDE (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL) +INCLUDE (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL) INSTALL_TARGETS(/bin cmake) INSTALL_TARGETS(/bin ctest) diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index cee24ef..a8fed1d 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -87,10 +87,12 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName, // optional entries const char* debian_pkg_dep = this->GetOption("CPACK_DEBIAN_PACKAGE_DEPENDS"); - const char* debian_pkg_rec = + const char* debian_pkg_rec = this->GetOption("CPACK_DEBIAN_PACKAGE_RECOMMENDS"); - const char* debian_pkg_sug = + const char* debian_pkg_sug = this->GetOption("CPACK_DEBIAN_PACKAGE_SUGGESTS"); + const char* debian_pkg_url = + this->GetOption("CPACK_DEBIAN_PACKAGE_HOMEPAGE"); { // the scope is needed for cmGeneratedFileStream cmGeneratedFileStream out(ctlfilename.c_str()); @@ -111,6 +113,10 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName, { out << "Suggests: " << debian_pkg_sug << "\n"; } + if(debian_pkg_url) + { + out << "Homepage: " << debian_pkg_url << "\n"; + } unsigned long totalSize = 0; { std::string dirName = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); @@ -121,7 +127,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName, totalSize += cmSystemTools::FileLength(fileIt->c_str()); } } - out << "Installed-Size: " << totalSize << "\n"; + out << "Installed-Size: " << (totalSize + 1023) / 1024 << "\n"; out << "Maintainer: " << maintainer << "\n"; out << "Description: " << desc << "\n"; out << std::endl; diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index a49c852..a6f10ec 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -85,6 +85,75 @@ void cmCTestGIT::NoteNewRevision() } //---------------------------------------------------------------------------- +std::string cmCTestGIT::FindGitDir() +{ + std::string git_dir; + + // Run "git rev-parse --git-dir" to locate the real .git directory. + const char* git = this->CommandLineTool.c_str(); + char const* git_rev_parse[] = {git, "rev-parse", "--git-dir", 0}; + std::string git_dir_line; + OneLineParser rev_parse_out(this, "rev-parse-out> ", git_dir_line); + OutputLogger rev_parse_err(this->Log, "rev-parse-err> "); + if(this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err)) + { + git_dir = git_dir_line; + } + if(git_dir.empty()) + { + git_dir = ".git"; + } + + // Git reports a relative path only when the .git directory is in + // the current directory. + if(git_dir[0] == '.') + { + git_dir = this->SourceDirectory + "/" + git_dir; + } +#if defined(_WIN32) && !defined(__CYGWIN__) + else if(git_dir[0] == '/') + { + // Cygwin Git reports a full path that Cygwin understands, but we + // are a Windows application. Run "cygpath" to get Windows path. + std::string cygpath_exe = cmSystemTools::GetFilenamePath(git); + cygpath_exe += "/cygpath.exe"; + if(cmSystemTools::FileExists(cygpath_exe.c_str())) + { + char const* cygpath[] = {cygpath_exe.c_str(), "-w", git_dir.c_str(), 0}; + OneLineParser cygpath_out(this, "cygpath-out> ", git_dir_line); + OutputLogger cygpath_err(this->Log, "cygpath-err> "); + if(this->RunChild(cygpath, &cygpath_out, &cygpath_err)) + { + git_dir = git_dir_line; + } + } + } +#endif + return git_dir; +} + +//---------------------------------------------------------------------------- +std::string cmCTestGIT::FindTopDir() +{ + std::string top_dir = this->SourceDirectory; + + // Run "git rev-parse --show-cdup" to locate the top of the tree. + const char* git = this->CommandLineTool.c_str(); + char const* git_rev_parse[] = {git, "rev-parse", "--show-cdup", 0}; + std::string cdup; + OneLineParser rev_parse_out(this, "rev-parse-out> ", cdup); + OutputLogger rev_parse_err(this->Log, "rev-parse-err> "); + if(this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err) && + !cdup.empty()) + { + top_dir += "/"; + top_dir += cdup; + top_dir = cmSystemTools::CollapseFullPath(top_dir.c_str()); + } + return top_dir; +} + +//---------------------------------------------------------------------------- bool cmCTestGIT::UpdateByFetchAndReset() { const char* git = this->CommandLineTool.c_str(); @@ -121,11 +190,17 @@ bool cmCTestGIT::UpdateByFetchAndReset() // Identify the merge head that would be used by "git pull". std::string sha1; { - std::string fetch_head = this->SourceDirectory + "/.git/FETCH_HEAD"; + std::string fetch_head = this->FindGitDir() + "/FETCH_HEAD"; std::ifstream fin(fetch_head.c_str(), std::ios::in | std::ios::binary); + if(!fin) + { + this->Log << "Unable to open " << fetch_head << "\n"; + return false; + } std::string line; while(sha1.empty() && cmSystemTools::GetLineFromStream(fin, line)) { + this->Log << "FETCH_HEAD> " << line << "\n"; if(line.find("\tnot-for-merge\t") == line.npos) { std::string::size_type pos = line.find('\t'); @@ -135,6 +210,11 @@ bool cmCTestGIT::UpdateByFetchAndReset() } } } + if(sha1.empty()) + { + this->Log << "FETCH_HEAD has no upstream branch candidate!\n"; + return false; + } } // Reset the local branch to point at that tracked from upstream. @@ -181,11 +261,13 @@ bool cmCTestGIT::UpdateImpl() return false; } + std::string top_dir = this->FindTopDir(); const char* git = this->CommandLineTool.c_str(); char const* git_submodule[] = {git, "submodule", "update", 0}; OutputLogger submodule_out(this->Log, "submodule-out> "); OutputLogger submodule_err(this->Log, "submodule-err> "); - return this->RunChild(git_submodule, &submodule_out, &submodule_err); + return this->RunChild(git_submodule, &submodule_out, &submodule_err, + top_dir.c_str()); } //---------------------------------------------------------------------------- diff --git a/Source/CTest/cmCTestGIT.h b/Source/CTest/cmCTestGIT.h index d8681fe..1765340 100644 --- a/Source/CTest/cmCTestGIT.h +++ b/Source/CTest/cmCTestGIT.h @@ -32,6 +32,9 @@ private: virtual void NoteNewRevision(); virtual bool UpdateImpl(); + std::string FindGitDir(); + std::string FindTopDir(); + bool UpdateByFetchAndReset(); bool UpdateByCustom(std::string const& custom); bool UpdateInternal(); diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 86d58ef..d226eea 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -15,7 +15,7 @@ SET(KWSYS_DATE_STAMP_YEAR 2010) # KWSys version date month component. Format is MM. -SET(KWSYS_DATE_STAMP_MONTH 07) +SET(KWSYS_DATE_STAMP_MONTH 08) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 30) +SET(KWSYS_DATE_STAMP_DAY 03) diff --git a/Tests/CMakeInstall.cmake b/Tests/CMakeInstall.cmake index f141b53..dabc852 100644 --- a/Tests/CMakeInstall.cmake +++ b/Tests/CMakeInstall.cmake @@ -33,7 +33,7 @@ if(CMake_TEST_INSTALL) add_test(CMake.Install ${CMake_TEST_INSTALL_CTest} ${CMake_TEST_INSTALL_CONFIG} - --build-and-test ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} + --build-and-test ${CMake_SOURCE_DIR} ${CMake_BINARY_DIR} --build-generator ${CMAKE_GENERATOR} # Not CMAKE_TEST_GENERATOR --build-project CMake --build-makeprogram ${CMAKE_MAKE_PROGRAM} # Not CMAKE_TEST_MAKEPROGRAM diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 9865134..0743c5a 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -404,7 +404,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # --test-command t4 #--test-command "${CMAKE_COMMAND}" #"-DCONFIGURATION=\${CTEST_CONFIGURATION_TYPE}" - #-P "${CMAKE_BINARY_DIR}/Tests/SimpleExclude/run.cmake" + #-P "${CMake_BINARY_DIR}/Tests/SimpleExclude/run.cmake" #) # ADD_TEST(SameName ${CMAKE_CTEST_COMMAND} @@ -1051,7 +1051,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-target install # --build-target package --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${BundleTestInstallDir}" - "-DCMake_SOURCE_DIR:PATH=${CMAKE_SOURCE_DIR}" + "-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}" --test-command ${BundleTestInstallDir}/Applications/SecondBundleExe.app/Contents/MacOS/SecondBundleExe) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest") @@ -1436,6 +1436,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set(regex "${regex}|The requested URL returned error") set(regex "${regex}|libcurl was built with SSL disabled. https: not supported)") set(regex "${regex}|Submission method .xmlrpc. not compiled into CTest") + set(regex "${regex}|Submission problem") set(regex "${regex}|Submission successful)") set(ctest_coverage_labels_args "") @@ -1589,10 +1590,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ IF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) SET(CMAKE_SKIP_BOOTSTRAP_TEST 1) ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) - IF(EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt") + IF(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") # If there is CMakeLists.txt in the binary tree, assume in-source build SET(CMAKE_SKIP_BOOTSTRAP_TEST 1) - ENDIF(EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt") + ENDIF(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") SET(bootstrap "") IF(CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST) IF(UNIX) @@ -1764,14 +1765,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # If this is not an in-source build, provide a target to wipe out # all the test build directories. - IF(NOT EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt") + IF(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in ${CMake_BINARY_DIR}/Tests/test_clean.cmake @ONLY) ADD_CUSTOM_TARGET(test_clean COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake COMMENT "Removing test build directories." ) - ENDIF(NOT EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt") + ENDIF(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") ADD_TEST(CMakeWizardTest ${CMAKE_CMAKE_COMMAND} -D build_dir:STRING=${CMAKE_CURRENT_BINARY_DIR}/CMakeWizardTest diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in index f672a52..793b987 100644 --- a/Tests/CTestUpdateGIT.cmake.in +++ b/Tests/CTestUpdateGIT.cmake.in @@ -275,6 +275,11 @@ execute_process( WORKING_DIRECTORY \"${TOP}\" COMMAND \"${GIT}\" clone \"${REPO}\" dash-source ) + +# Test .git file. +file(RENAME \"${TOP}/dash-source/.git\" \"${TOP}/dash-source/repo.git\") +file(WRITE \"${TOP}/dash-source/.git\" \"gitdir: repo.git\n\") + execute_process( WORKING_DIRECTORY \"${TOP}/dash-source\" COMMAND \"${GIT}\" reset --hard ${revision1} diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt index 8888aba..5d076e0 100644 --- a/Utilities/Doxygen/CMakeLists.txt +++ b/Utilities/Doxygen/CMakeLists.txt @@ -27,15 +27,15 @@ IF (BUILD_DOCUMENTATION) ENDIF(NOT DOT_PATH) CONFIGURE_FILE( - ${CMAKE_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in - ${CMAKE_BINARY_DIR}/Utilities/Doxygen/doxyfile) + ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in + ${CMake_BINARY_DIR}/Utilities/Doxygen/doxyfile) CONFIGURE_FILE( - ${CMAKE_SOURCE_DIR}/Utilities/Doxygen/doc_makeall.sh.in - ${CMAKE_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh) + ${CMake_SOURCE_DIR}/Utilities/Doxygen/doc_makeall.sh.in + ${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh) ADD_CUSTOM_TARGET(DoxygenDoc ${BASH} - ${CMAKE_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh) + ${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh) ENDIF (BUILD_DOCUMENTATION) diff --git a/Utilities/Doxygen/doc_makeall.sh.in b/Utilities/Doxygen/doc_makeall.sh.in index e5cf240..a1b00e7 100755 --- a/Utilities/Doxygen/doc_makeall.sh.in +++ b/Utilities/Doxygen/doc_makeall.sh.in @@ -48,7 +48,7 @@ export PATH_TO_VTK_DOX_SCRIPTS="@VTK_SOURCE_DIR@/Utilities/Doxygen" # Example: # SOURCE_DIR=@VTK_SOURCE_DIR@ # -export SOURCE_DIR="@CMAKE_SOURCE_DIR@" +export SOURCE_DIR="@CMake_SOURCE_DIR@" # REL_PATH_TO_TOP: # Relative path from the top directory of the source files to the directory @@ -71,7 +71,7 @@ export REL_PATH_TO_TOP=. # DOXTEMP=DOXTEMP=@VTK_BINARY_DIR@/Utilities/Doxygen # INTERMEDIATE_DOX_DIR=$DOXTEMP/dox # -export DOXTEMP="@CMAKE_BINARY_DIR@/Utilities/Doxygen" +export DOXTEMP="@CMake_BINARY_DIR@/Utilities/Doxygen" export INTERMEDIATE_DOX_DIR="$DOXTEMP/dox" # DOXYFILE: diff --git a/Utilities/Doxygen/doxyfile.in b/Utilities/Doxygen/doxyfile.in index ad5e377..c3d3a38 100644 --- a/Utilities/Doxygen/doxyfile.in +++ b/Utilities/Doxygen/doxyfile.in @@ -31,19 +31,19 @@ GRAPHICAL_HIERARCHY = YES ALLEXTERNALS = NO -IMAGE_PATH = "@CMAKE_BINARY_DIR@/Utilities/Doxygen/contrib" +IMAGE_PATH = "@CMake_BINARY_DIR@/Utilities/Doxygen/contrib" -OUTPUT_DIRECTORY = "@CMAKE_BINARY_DIR@/Utilities/Doxygen/doc" +OUTPUT_DIRECTORY = "@CMake_BINARY_DIR@/Utilities/Doxygen/doc" INPUT = \ - "@CMAKE_SOURCE_DIR@/Source" \ - "@CMAKE_SOURCE_DIR@/Source/CPack" \ - "@CMAKE_SOURCE_DIR@/Source/CTest" \ - "@CMAKE_SOURCE_DIR@/Source/CursesDialog" \ - "@CMAKE_SOURCE_DIR@/Source/MFCDialog" \ - "@CMAKE_BINARY_DIR@/Source/kwsys" \ - "@CMAKE_BINARY_DIR@/Source/cmsys" \ - "@CMAKE_BINARY_DIR@/Utilities/Doxygen/dox/doc_CMake_contributors.dox" \ + "@CMake_SOURCE_DIR@/Source" \ + "@CMake_SOURCE_DIR@/Source/CPack" \ + "@CMake_SOURCE_DIR@/Source/CTest" \ + "@CMake_SOURCE_DIR@/Source/CursesDialog" \ + "@CMake_SOURCE_DIR@/Source/MFCDialog" \ + "@CMake_BINARY_DIR@/Source/kwsys" \ + "@CMake_BINARY_DIR@/Source/cmsys" \ + "@CMake_BINARY_DIR@/Utilities/Doxygen/dox/doc_CMake_contributors.dox" \ EXTRACT_ALL = YES EXTRACT_PRIVATE = NO diff --git a/Utilities/KWStyle/CMake.kws.xml.in b/Utilities/KWStyle/CMake.kws.xml.in index 9c5efee..c2b4429 100644 --- a/Utilities/KWStyle/CMake.kws.xml.in +++ b/Utilities/KWStyle/CMake.kws.xml.in @@ -2,7 +2,7 @@ <Description> <LineLength>79</LineLength> <!-- -<Header>"@CMAKE_SOURCE_DIR@/Utilities/KWStyle/Headers",false,true</Header> +<Header>"@CMake_SOURCE_DIR@/Utilities/KWStyle/Headers",false,true</Header> <Functions> <regex>[A-Z]</regex> <length>100</length> diff --git a/Utilities/KWStyle/CMakeFiles.txt.in b/Utilities/KWStyle/CMakeFiles.txt.in index aa4ee74..a95aac6 100644 --- a/Utilities/KWStyle/CMakeFiles.txt.in +++ b/Utilities/KWStyle/CMakeFiles.txt.in @@ -1,15 +1,15 @@ -"@CMAKE_SOURCE_DIR@/Source/*.txx" -"@CMAKE_SOURCE_DIR@/Source/*.cxx" -"@CMAKE_SOURCE_DIR@/Source/*.h*" -"@CMAKE_SOURCE_DIR@/Source/CPack/*.txx" -"@CMAKE_SOURCE_DIR@/Source/CPack/*.cxx" -"@CMAKE_SOURCE_DIR@/Source/CPack/*.h*" -"@CMAKE_SOURCE_DIR@/Source/CTest/*.txx" -"@CMAKE_SOURCE_DIR@/Source/CTest/*.cxx" -"@CMAKE_SOURCE_DIR@/Source/CTest/*.h*" -"@CMAKE_SOURCE_DIR@/Source/CurseDialog/*.h*" -"@CMAKE_SOURCE_DIR@/Source/CurseDialog/*.cxx" -"@CMAKE_SOURCE_DIR@/Source/CurseDialog/*.txx" +"@CMake_SOURCE_DIR@/Source/*.txx" +"@CMake_SOURCE_DIR@/Source/*.cxx" +"@CMake_SOURCE_DIR@/Source/*.h*" +"@CMake_SOURCE_DIR@/Source/CPack/*.txx" +"@CMake_SOURCE_DIR@/Source/CPack/*.cxx" +"@CMake_SOURCE_DIR@/Source/CPack/*.h*" +"@CMake_SOURCE_DIR@/Source/CTest/*.txx" +"@CMake_SOURCE_DIR@/Source/CTest/*.cxx" +"@CMake_SOURCE_DIR@/Source/CTest/*.h*" +"@CMake_SOURCE_DIR@/Source/CurseDialog/*.h*" +"@CMake_SOURCE_DIR@/Source/CurseDialog/*.cxx" +"@CMake_SOURCE_DIR@/Source/CurseDialog/*.txx" -f (Lexer\.h) -f (Lexer\.cxx) -f (Parser\.cxx) diff --git a/Utilities/KWStyle/CMakeLists.txt b/Utilities/KWStyle/CMakeLists.txt index d8269c6..4803ffa 100644 --- a/Utilities/KWStyle/CMakeLists.txt +++ b/Utilities/KWStyle/CMakeLists.txt @@ -36,27 +36,27 @@ IF(CMAKE_USE_KWSTYLE) SET(KWSTYLE_ARGUMENTS -msvc ${KWSTYLE_ARGUMENTS}) ENDIF(KWSTYLE_USE_MSVC_FORMAT) - CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMake.kws.xml.in - ${CMAKE_BINARY_DIR}/CMake.kws.xml) - CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in - ${CMAKE_BINARY_DIR}/CMakeMoreChecks.kws.xml) + CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMake.kws.xml.in + ${CMake_BINARY_DIR}/CMake.kws.xml) + CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in + ${CMake_BINARY_DIR}/CMakeMoreChecks.kws.xml) - CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMakeFiles.txt.in - ${CMAKE_BINARY_DIR}/CMakeKWSFiles.txt) + CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeFiles.txt.in + ${CMake_BINARY_DIR}/CMakeKWSFiles.txt) ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_BINARY_DIR}/KWStyleReport.txt + OUTPUT ${CMake_BINARY_DIR}/KWStyleReport.txt COMMAND ${KWSTYLE_EXECUTABLE} - ARGS -xml ${CMAKE_BINARY_DIR}/CMake.kws.xml -o ${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMAKE_BINARY_DIR}/CMakeKWSFiles.txt + ARGS -xml ${CMake_BINARY_DIR}/CMake.kws.xml -o ${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMake_BINARY_DIR}/CMakeKWSFiles.txt COMMENT "Coding Style Checker" ) ADD_CUSTOM_TARGET(MoreStyleChecks COMMAND ${KWSTYLE_EXECUTABLE} - -xml ${CMAKE_BINARY_DIR}/CMakeMoreChecks.kws.xml -html ${CMAKE_BINARY_DIR}/html -o ${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMAKE_BINARY_DIR}/CMakeKWSFiles.txt + -xml ${CMake_BINARY_DIR}/CMakeMoreChecks.kws.xml -html ${CMake_BINARY_DIR}/html -o ${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMake_BINARY_DIR}/CMakeKWSFiles.txt COMMENT "Coding Style Checker, more checks enabled" ) - ADD_CUSTOM_TARGET(StyleCheck DEPENDS ${CMAKE_BINARY_DIR}/KWStyleReport.txt) + ADD_CUSTOM_TARGET(StyleCheck DEPENDS ${CMake_BINARY_DIR}/KWStyleReport.txt) ENDIF(CMAKE_USE_KWSTYLE) diff --git a/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in b/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in index f47f8e8..b7078e0 100644 --- a/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in +++ b/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in @@ -2,7 +2,7 @@ <Description> <ErrorThreshold>10</ErrorThreshold> <LineLength>79</LineLength> - <Header>"@CMAKE_SOURCE_DIR@/Utilities/KWStyle/Headers",false,true</Header> + <Header>"@CMake_SOURCE_DIR@/Utilities/KWStyle/Headers",false,true</Header> <Functions> <regex>^(cm)?[A-Z]</regex> <length>200</length> diff --git a/Utilities/Release/dashmacmini2_release.cmake b/Utilities/Release/dashmacmini2_release.cmake index 12bfa6a..6deeb41 100644 --- a/Utilities/Release/dashmacmini2_release.cmake +++ b/Utilities/Release/dashmacmini2_release.cmake @@ -15,6 +15,6 @@ CPACK_SYSTEM_NAME:STRING=Darwin-universal BUILD_QtDialog:BOOL:=TRUE QT_QMAKE_EXECUTABLE:FILEPATH=/Users/kitware/Software/QtBinUniversal/bin/qmake ") -set(GIT_COMMAND /Users/kitware/.userroot/bin/git) +set(GIT_COMMAND /opt/local/bin/git) get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) include(${path}/release_cmake.cmake) |