diff options
38 files changed, 763 insertions, 327 deletions
diff --git a/Modules/CMakeTestWatcomVersion.c b/Modules/CMakeTestWatcomVersion.c new file mode 100644 index 0000000..0343fb1 --- /dev/null +++ b/Modules/CMakeTestWatcomVersion.c @@ -0,0 +1 @@ +VERSION=__WATCOMC__ diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index bf52b25..d82de93 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -322,7 +322,7 @@ cpack_set_if_not_set(CPACK_PACKAGE_FILE_NAME cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}") cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY - "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}") + "${CPACK_PACKAGE_INSTALL_DIRECTORY}") cpack_set_if_not_set(CPACK_PACKAGE_DEFAULT_LOCATION "/") cpack_set_if_not_set(CPACK_PACKAGE_RELOCATABLE "true") diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake index a03b64d..a390b38 100644 --- a/Modules/CheckCCompilerFlag.cmake +++ b/Modules/CheckCCompilerFlag.cmake @@ -27,6 +27,8 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT) SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}") CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT} # Some compilers do not fail with a bad flag + FAIL_REGEX "warning: command line option .* is valid for .* but not for C" + # Apple gcc FAIL_REGEX "unrecognized .*option" # GNU FAIL_REGEX "ignoring unknown option" # MSVC FAIL_REGEX "warning D9002" # MSVC, any lang @@ -36,4 +38,3 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT) ) SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") ENDMACRO (CHECK_C_COMPILER_FLAG) - diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake index a62aa70..be7d658 100644 --- a/Modules/CheckSymbolExists.cmake +++ b/Modules/CheckSymbolExists.cmake @@ -40,7 +40,6 @@ MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE) ENDMACRO(CHECK_SYMBOL_EXISTS) MACRO(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE) -message(STATUS "files: -${FILES}-") IF("${VARIABLE}" MATCHES "^${VARIABLE}$") SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n") SET(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS}) diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index f7bfe27..570fb7b 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -1,44 +1,57 @@ # - Macros for generating a summary of enabled/disabled features # -# This module provides the macros feature_summary(), set_package_info() and +# This module provides the macros feature_summary(), set_package_properties() and # add_feature_info(). -# For compatiblity it also still provides set_feature_info(), -# print_enabled_features() and print_disabled_features. +# For compatiblity it also still provides set_package_info(), set_feature_info(), +# print_enabled_features() and print_disabled_features(). # # These macros can be used to generate a summary of enabled and disabled # packages and/or feature for a build tree: # -# -- Enabled features: +# -- The following OPTIONAL packages have been found: # LibXml2 (required version >= 2.4) , XML processing library. , <http://xmlsoft.org> +# * Enables HTML-import in MyWordProcessor +# * Enables odt-export in MyWordProcessor # PNG , A PNG image library. , <http://www.libpng.org/pub/png/> -# -- Disabled features: +# * Enables saving screenshots +# -- The following OPTIONAL packages have not been found: # Lua51 , The Lua scripting language. , <http://www.lua.org> +# * Enables macros in MyWordProcessor # Foo , Foo provides cool stuff. # # # FEATURE_SUMMARY( [FILENAME <file>] # [APPEND] # [VAR <variable_name>] +# [INCLUDE_QUIET_PACKAGES] +# [FATAL_ON_MISSING_REQUIRED_PACKAGES] # [DESCRIPTION "Found packages:"] # WHAT (ALL | PACKAGES_FOUND | PACKAGES_NOT_FOUND # | ENABLED_FEATURES | DISABLED_FEATURES] # ) # # The FEATURE_SUMMARY() macro can be used to print information about enabled -# or disabled features or packages of a project. +# or disabled packages or features of a project. # By default, only the names of the features/packages will be printed and their -# required version when one was specified. Use SET_FEATURE_INFO() to add more -# useful information, like e.g. a download URL for the respective package. +# required version when one was specified. Use SET_PACKAGE_PROPERTIES() to add more +# useful information, like e.g. a download URL for the respective package or their +# purpose in the project. # # The WHAT option is the only mandatory option. Here you specify what information # will be printed: -# ENABLED_FEATURES: the list of all features and packages which are enabled, -# excluding the QUIET packages -# DISABLED_FEATURES: the list of all features and packages which are disabled, -# excluding the QUIET packages +# ALL: print everything +# ENABLED_FEATURES: the list of all features which are enabled +# DISABLED_FEATURES: the list of all features which are disabled # PACKAGES_FOUND: the list of all packages which have been found # PACKAGES_NOT_FOUND: the list of all packages which have not been found -# ALL: this will give all packages which have or have not been found +# OPTIONAL_PACKAGES_FOUND: only those packages which have been found which have the type OPTIONAL +# OPTIONAL_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type OPTIONAL +# RECOMMENDED_PACKAGES_FOUND: only those packages which have been found which have the type RECOMMENDED +# RECOMMENDED_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type RECOMMENDED +# REQUIRED_PACKAGES_FOUND: only those packages which have been found which have the type REQUIRED +# REQUIRED_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type REQUIRED +# RUNTIME_PACKAGES_FOUND: only those packages which have been found which have the type RUNTIME +# RUNTIME_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type RUNTIME # # If a FILENAME is given, the information is printed into this file. If APPEND # is used, it is appended to this file, otherwise the file is overwritten if @@ -48,19 +61,29 @@ # If FILENAME is not used, the information is printed to the terminal. # Using the DESCRIPTION option a description or headline can be set which will # be printed above the actual content. +# If INCLUDE_QUIET_PACKAGES is given, packages which have been searched with find_package(... QUIET) will +# also be listed. By default they are skipped. +# If FATAL_ON_MISSING_REQUIRED_PACKAGES is given, CMake will abort if a package which is marked as REQUIRED +# has not been found. # # Example 1, append everything to a file: # feature_summary(WHAT ALL # FILENAME ${CMAKE_BINARY_DIR}/all.log APPEND) # -# Example 2, print the enabled features into the variable enabledFeaturesText: +# Example 2, print the enabled features into the variable enabledFeaturesText, including QUIET packages: # feature_summary(WHAT ENABLED_FEATURES +# INCLUDE_QUIET_PACKAGES # DESCRIPTION "Enabled Features:" # VAR enabledFeaturesText) # message(STATUS "${enabledFeaturesText}") # # -# SET_PACKAGE_INFO(<name> <description> [<url> [<comment>] ] ) +# SET_PACKAGE_PROPERTIES(<name> PROPERTIES [ URL <url> ] +# [ DESCRIPTION <description> ] +# [ TYPE (RUNTIME|OPTIONAL|RECOMMENDED|REQUIRED) ] +# [ PURPOSE <purpose> ] +# ) +# # Use this macro to set up information about the named package, which can # then be displayed via FEATURE_SUMMARY(). # This can be done either directly in the Find-module or in the project @@ -68,10 +91,47 @@ # The features for which information can be set are added automatically by the # find_package() command. # +# URL: this should be the homepage of the package, or something similar. Ideally this is set +# already directly in the Find-module. +# +# DESCRIPTION: A short description what that package is, at most one sentence. +# Ideally this is set already directly in the Find-module. +# +# TYPE: What type of dependency has the using project on that package. Default is OPTIONAL. +# In this case it is a package which can be used by the project when available at buildtime, +# but it also work without. RECOMMENDED is similar to OPTIONAL, i.e. the project will build +# if the package is not present, but the functionality of the resulting binaries will be severly +# limited. If a REQUIRED package is not available at buildtime, the project may not even build. This +# can be combined with the FATAL_ON_MISSING_REQUIRED_PACKAGES argument for feature_summary(). +# Last, a RUNTIME package is a package which is actually not used at all during the build, but +# which is required for actually running the resulting binaries. So if such a package is missing, +# the project can still be built, but it may not work later on. If set_package_properties() is called +# multiple times for the same package with different TYPEs, the TYPE is only changed to higher +# TYPEs ( RUNTIME < OPTIONAL < RECOMMENDED < REQUIRED ), lower TYPEs are ignored. +# The TYPE property is project-specific, so it cannot be set by the Find-module, but must be set in the project. +# +# PURPOSE: This describes which features this package enables in the project, i.e. it tells the user +# what functionality he gets in the resulting binaries. +# If set_package_properties() is called multiple times for a package, all PURPOSE properties are appended +# to a list of purposes of the package in the project. +# As the TYPE property, also the PURPOSE property +# is project-specific, so it cannot be set by the Find-module, but must be set in the project. +# +# # Example for setting the info for a package: # find_package(LibXml2) -# set_package_info(LibXml2 "XML processing library." "http://xmlsoft.org/") +# set_package_properties(LibXml2 PROPERTIES DESCRIPTION "A XML processing library." +# URL "http://xmlsoft.org/") # +# set_package_properties(LibXml2 PROPERTIES TYPE RECOMMENDED +# PURPOSE "Enables HTML-import in MyWordProcessor") +# ... +# set_package_properties(LibXml2 PROPERTIES TYPE OPTIONAL +# PURPOSE "Enables odt-export in MyWordProcessor") +# +# find_package(DBUS) +# set_package_properties(LibXml2 PROPERTIES TYPE RUNTIME +# PURPOSE "Necessary to disable the screensaver during a presentation" ) # # ADD_FEATURE_INFO(<name> <enabled> <description>) # Use this macro to add information about a feature with the given <name>. @@ -87,14 +147,22 @@ # # The following macros are provided for compatibility with previous CMake versions: # +# SET_PACKAGE_INFO(<name> <description> [<url> [<purpose>] ] ) +# Use this macro to set up information about the named package, which can +# then be displayed via FEATURE_SUMMARY(). +# This can be done either directly in the Find-module or in the project +# which uses the module after the FIND_PACKAGE() call. +# The features for which information can be set are added automatically by the +# find_package() command. +# # PRINT_ENABLED_FEATURES() # Does the same as FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:") # # PRINT_DISABLED_FEATURES() # Does the same as FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:") # -# SET_FEATURE_INFO(<name> <description> [<url> [<comment>] ] ) -# Does the same as SET_PACKAGE_INFO(<name> <description> <url> <comment> ) +# SET_FEATURE_INFO(<name> <description> [<url>] ) +# Does the same as SET_PACKAGE_INFO(<name> <description> <url> ) #============================================================================= # Copyright 2007-2009 Kitware, Inc. @@ -123,64 +191,149 @@ FUNCTION(ADD_FEATURE_INFO _name _enabled _desc) ENDFUNCTION(ADD_FEATURE_INFO) -FUNCTION(SET_FEATURE_INFO) - SET_PACKAGE_INFO(${ARGN}) -ENDFUNCTION(SET_FEATURE_INFO) +FUNCTION(SET_PACKAGE_PROPERTIES _name _props) + IF(NOT "${_props}" STREQUAL "PROPERTIES") + MESSAGE(FATAL_ERROR "PROPERTIES keyword is missing in SET_PACKAGE_PROPERTIES() call.") + ENDIF() -FUNCTION(SET_PACKAGE_INFO _name _desc) - SET(_url "${ARGV2}") - SET(_comment "${ARGV3}") - SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" ) - IF(_url MATCHES ".+") - SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_url}" ) - ENDIF(_url MATCHES ".+") - IF(_comment MATCHES ".+") - SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_COMMENT "${_comment}" ) - ENDIF(_comment MATCHES ".+") -ENDFUNCTION(SET_PACKAGE_INFO) + SET(options ) # none + SET(oneValueArgs DESCRIPTION URL TYPE PURPOSE ) + SET(multiValueArgs ) # none + + CMAKE_PARSE_ARGUMENTS(_SPP "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + IF(_SPP_UNPARSED_ARGUMENTS) + MESSAGE(FATAL_ERROR "Unknown keywords given to SET_PACKAGE_PROPERTIES(): \"${_SPP_UNPARSED_ARGUMENTS}\"") + ENDIF() + + IF(_SPP_DESCRIPTION) + GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION) + IF(_info) + MESSAGE(STATUS "Warning: Property DESCRIPTION for package ${_name} already set to \"${_info}\", overriding it with \"${_SPP_DESCRIPTION}\"") + ENDIF() + + SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_SPP_DESCRIPTION}" ) + ENDIF() + + + IF(_SPP_URL) + GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_name}_URL) + IF(_info) + MESSAGE(STATUS "Warning: Property URL already set to \"${_info}\", overriding it with \"${_SPP_URL}\"") + ENDIF() + + SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_SPP_URL}" ) + ENDIF() + + + # handle the PURPOSE: use APPEND, since there can be multiple purposes for one package inside a project + IF(_SPP_PURPOSE) + SET_PROPERTY(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_SPP_PURPOSE}" ) + ENDIF() + + # handle the TYPE + IF(NOT _SPP_TYPE) + SET(_SPP_TYPE OPTIONAL) + ENDIF() + + # List the supported types, according to their priority + SET(validTypes "RUNTIME" "OPTIONAL" "RECOMMENDED" "REQUIRED" ) + LIST(FIND validTypes ${_SPP_TYPE} _typeIndexInList) + IF("${_typeIndexInList}" STREQUAL "-1" ) + MESSAGE(FATAL_ERROR "Bad package property type ${_SPP_TYPE} used in SET_PACKAGE_PROPERTIES(). " + "Valid types are OPTIONAL, RECOMMENDED, REQUIRED and RUNTIME." ) + ENDIF() + + GET_PROPERTY(_previousType GLOBAL PROPERTY _CMAKE_${_name}_TYPE) + LIST(FIND validTypes "${_previousType}" _prevTypeIndexInList) + + # make sure a previously set TYPE is not overridden with a lower new TYPE: + IF("${_typeIndexInList}" GREATER "${_prevTypeIndexInList}") + SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_TYPE "${_SPP_TYPE}" ) + ENDIF() + +ENDFUNCTION(SET_PACKAGE_PROPERTIES) + + + +FUNCTION(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet) + + SET(_type "ANY") + IF("${_property}" MATCHES "REQUIRED_") + SET(_type "REQUIRED") + ELSEIF("${_property}" MATCHES "RECOMMENDED_") + SET(_type "RECOMMENDED") + ELSEIF("${_property}" MATCHES "RUNTIME_") + SET(_type "RUNTIME") + ELSEIF("${_property}" MATCHES "OPTIONAL_") + SET(_type "OPTIONAL") + ENDIF() + + IF("${_property}" MATCHES "PACKAGES_FOUND") + SET(_property "PACKAGES_FOUND") + ELSEIF("${_property}" MATCHES "PACKAGES_NOT_FOUND") + SET(_property "PACKAGES_NOT_FOUND") + ENDIF() -FUNCTION(_FS_GET_FEATURE_SUMMARY _property _var) SET(_currentFeatureText "") GET_PROPERTY(_EnabledFeatures GLOBAL PROPERTY ${_property}) + FOREACH(_currentFeature ${_EnabledFeatures}) - SET(_currentFeatureText "${_currentFeatureText}\n${_currentFeature}") - GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_REQUIRED_VERSION) - IF(_info) - SET(_currentFeatureText "${_currentFeatureText} (required version ${_info})") - ENDIF(_info) - GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION) - IF(_info) - SET(_currentFeatureText "${_currentFeatureText} , ${_info}") - ENDIF(_info) - GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL) - IF(_info) - SET(_currentFeatureText "${_currentFeatureText} , <${_info}>") - ENDIF(_info) - GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_COMMENT) - IF(_info) - SET(_currentFeatureText "${_currentFeatureText} , ${_info}") - ENDIF(_info) - ENDFOREACH(_currentFeature) - SET(${_var} "${_currentFeatureText}" PARENT_SCOPE) -ENDFUNCTION(_FS_GET_FEATURE_SUMMARY) + # does this package belong to the type we currently want to list ? + GET_PROPERTY(_currentType GLOBAL PROPERTY _CMAKE_${_currentFeature}_TYPE) + IF(NOT _currentType) + SET(_currentType OPTIONAL) + ENDIF() -FUNCTION(PRINT_ENABLED_FEATURES) - FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:") -ENDFUNCTION(PRINT_ENABLED_FEATURES) + IF("${_type}" STREQUAL ANY OR "${_type}" STREQUAL "${_currentType}") + # check whether the current feature/package should be in the output depending on whether it was QUIET or not + SET(includeThisOne TRUE) + # skip QUIET packages, except if they are REQUIRED or INCLUDE_QUIET_PACKAGES has been set + IF((NOT "${_currentType}" STREQUAL "REQUIRED") AND NOT _includeQuiet) + GET_PROPERTY(_isQuiet GLOBAL PROPERTY _CMAKE_${_currentFeature}_QUIET) + IF(_isQuiet) + SET(includeThisOne FALSE) + ENDIF() + ENDIF() -FUNCTION(PRINT_DISABLED_FEATURES) - FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:") -ENDFUNCTION(PRINT_DISABLED_FEATURES) + IF(includeThisOne) + + SET(_currentFeatureText "${_currentFeatureText}\n${_currentFeature}") + GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_REQUIRED_VERSION) + IF(_info) + SET(_currentFeatureText "${_currentFeatureText} (required version ${_info})") + ENDIF(_info) + GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION) + IF(_info) + SET(_currentFeatureText "${_currentFeatureText} , ${_info}") + ENDIF(_info) + GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL) + IF(_info) + SET(_currentFeatureText "${_currentFeatureText} , <${_info}>") + ENDIF(_info) + + GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE) + FOREACH(_purpose ${_info}) + SET(_currentFeatureText "${_currentFeatureText}\n * ${_purpose}") + ENDFOREACH() + + ENDIF(includeThisOne) + + ENDIF("${_type}" STREQUAL ANY OR "${_type}" STREQUAL "${_currentType}") + + ENDFOREACH(_currentFeature) + SET(${_var} "${_currentFeatureText}" PARENT_SCOPE) +ENDFUNCTION(_FS_GET_FEATURE_SUMMARY) FUNCTION(FEATURE_SUMMARY) # CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...) - SET(options APPEND) + SET(options APPEND INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) SET(oneValueArgs FILENAME VAR DESCRIPTION WHAT) SET(multiValueArgs ) # none @@ -188,27 +341,70 @@ FUNCTION(FEATURE_SUMMARY) IF(_FS_UNPARSED_ARGUMENTS) MESSAGE(FATAL_ERROR "Unknown keywords given to FEATURE_SUMMARY(): \"${_FS_UNPARSED_ARGUMENTS}\"") - ENDIF(_FS_UNPARSED_ARGUMENTS) + ENDIF() IF(NOT _FS_WHAT) MESSAGE(FATAL_ERROR "The call to FEATURE_SUMMAY() doesn't set the required WHAT argument.") - ENDIF(NOT _FS_WHAT) + ENDIF() + + SET(validWhatParts "ENABLED_FEATURES" + "DISABLED_FEATURES" + "PACKAGES_FOUND" + "PACKAGES_NOT_FOUND" + "OPTIONAL_PACKAGES_FOUND" + "OPTIONAL_PACKAGES_NOT_FOUND" + "RECOMMENDED_PACKAGES_FOUND" + "RECOMMENDED_PACKAGES_NOT_FOUND" + "REQUIRED_PACKAGES_FOUND" + "REQUIRED_PACKAGES_NOT_FOUND" + "RUNTIME_PACKAGES_FOUND" + "RUNTIME_PACKAGES_NOT_FOUND") - IF( "${_FS_WHAT}" STREQUAL "ENABLED_FEATURES" - OR "${_FS_WHAT}" STREQUAL "DISABLED_FEATURES" - OR "${_FS_WHAT}" STREQUAL "PACKAGES_FOUND" - OR "${_FS_WHAT}" STREQUAL "PACKAGES_NOT_FOUND") - _FS_GET_FEATURE_SUMMARY( ${_FS_WHAT} _featureSummary) + LIST(FIND validWhatParts "${_FS_WHAT}" indexInList) + IF(NOT "${indexInList}" STREQUAL "-1") + _FS_GET_FEATURE_SUMMARY( ${_FS_WHAT} _featureSummary ${_FS_INCLUDE_QUIET_PACKAGES} ) SET(_fullText "${_FS_DESCRIPTION}${_featureSummary}\n") + IF (("${_FS_WHAT}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND") AND _featureSummary) + SET(requiredPackagesNotFound TRUE) + ENDIF() + ELSEIF("${_FS_WHAT}" STREQUAL "ALL") - _FS_GET_FEATURE_SUMMARY( PACKAGES_FOUND _tmp1) - _FS_GET_FEATURE_SUMMARY( PACKAGES_NOT_FOUND _tmp2) - SET(_featureSummary "${_tmp1}${_tmp2}") - IF(_FS_DESCRIPTION) - SET(_fullText "${_FS_DESCRIPTION}${_tmp1}${_tmp2}\n") - ELSE(_FS_DESCRIPTION) - SET(_fullText "-- Found the following packages:${_tmp1}\n-- Did not find the following packages:${_tmp2}\n") - ENDIF(_FS_DESCRIPTION) + + SET(allWhatParts "ENABLED_FEATURES" + "RUNTIME_PACKAGES_FOUND" + "OPTIONAL_PACKAGES_FOUND" + "RECOMMENDED_PACKAGES_FOUND" + "REQUIRED_PACKAGES_FOUND" + + "DISABLED_FEATURES" + "RUNTIME_PACKAGES_NOT_FOUND" + "OPTIONAL_PACKAGES_NOT_FOUND" + "RECOMMENDED_PACKAGES_NOT_FOUND" + "REQUIRED_PACKAGES_NOT_FOUND" + ) + + SET(title_ENABLED_FEATURES "The following features have been enabled:") + SET(title_DISABLED_FEATURES "The following features have been disabled:") + SET(title_OPTIONAL_PACKAGES_FOUND "The following OPTIONAL packages have been found:") + SET(title_OPTIONAL_PACKAGES_NOT_FOUND "The following OPTIONAL packages have not been found:") + SET(title_RECOMMENDED_PACKAGES_FOUND "The following RECOMMENDED packages have been found:") + SET(title_RECOMMENDED_PACKAGES_NOT_FOUND "The following RECOMMENDED packages have not been found:") + SET(title_REQUIRED_PACKAGES_FOUND "The following REQUIRED packages have been found:") + SET(title_REQUIRED_PACKAGES_NOT_FOUND "The following REQUIRED packages have not been found:") + SET(title_RUNTIME_PACKAGES_FOUND "The following RUNTIME packages have been found:") + SET(title_RUNTIME_PACKAGES_NOT_FOUND "The following RUNTIME packages have not been found:") + + SET(_fullText "${_FS_DESCRIPTION}") + FOREACH(part ${allWhatParts}) + SET(_tmp) + _FS_GET_FEATURE_SUMMARY( ${part} _tmp ${_FS_INCLUDE_QUIET_PACKAGES}) + IF(_tmp) + SET(_fullText "${_fullText}\n\n-- ${title_${part}}\n${_tmp}") + IF("${part}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND") + SET(requiredPackagesNotFound TRUE) + ENDIF() + ENDIF() + ENDFOREACH() ELSE() MESSAGE(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() is set to ${_FS_WHAT}, which is not a valid value.") ENDIF() @@ -218,16 +414,53 @@ FUNCTION(FEATURE_SUMMARY) FILE(APPEND "${_FS_FILENAME}" "${_fullText}") ELSE(_FS_APPEND) FILE(WRITE "${_FS_FILENAME}" "${_fullText}") - ENDIF(_FS_APPEND) + ENDIF() ELSE(_FS_FILENAME) IF(NOT _FS_VAR) MESSAGE(STATUS "${_fullText}") - ENDIF(NOT _FS_VAR) - ENDIF(_FS_FILENAME) + ENDIF() + ENDIF() IF(_FS_VAR) SET(${_FS_VAR} "${_fullText}" PARENT_SCOPE) - ENDIF(_FS_VAR) + ENDIF() + + IF(requiredPackagesNotFound AND _FS_FATAL_ON_MISSING_REQUIRED_PACKAGES) + MESSAGE(FATAL_ERROR "feature_summary() Error: REQUIRED package(s) are missing, aborting CMake run.") + ENDIF() ENDFUNCTION(FEATURE_SUMMARY) + + +# The stuff below is only kept for compatibility + +FUNCTION(SET_PACKAGE_INFO _name _desc) + SET(_url "${ARGV2}") + SET(_purpose "${ARGV3}") + SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" ) + IF(_url MATCHES ".+") + SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_url}" ) + ENDIF() + IF(_purpose MATCHES ".+") + SET_PROPERTY(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_purpose}" ) + ENDIF() +ENDFUNCTION(SET_PACKAGE_INFO) + + + +FUNCTION(SET_FEATURE_INFO) + SET_PACKAGE_INFO(${ARGN}) +ENDFUNCTION(SET_FEATURE_INFO) + + + +FUNCTION(PRINT_ENABLED_FEATURES) + FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:") +ENDFUNCTION(PRINT_ENABLED_FEATURES) + + + +FUNCTION(PRINT_DISABLED_FEATURES) + FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:") +ENDFUNCTION(PRINT_DISABLED_FEATURES) diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake index 96b6741..55f95c6 100644 --- a/Modules/FindPostgreSQL.cmake +++ b/Modules/FindPostgreSQL.cmake @@ -7,7 +7,6 @@ # ... # if( PostgreSQL_FOUND ) # include_directories(${PostgreSQL_INCLUDE_DIRS}) -# link_directories(${PostgreSQL_LIBRARY_DIRS}) # endif( PostgreSQL_FOUND ) # ... # Remember to include ${PostgreSQL_LIBRARIES} in the target_link_libraries() statement. @@ -113,12 +112,26 @@ find_path(PostgreSQL_INCLUDE_DIR # Look in other places. ${PostgreSQL_ROOT_DIRECTORIES} PATH_SUFFIXES + pgsql postgresql include # Help the user find it if we cannot. DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}" ) +find_path(PostgreSQL_TYPE_INCLUDE_DIR + NAMES catalog/pg_type.h + PATHS + # Look in other places. + ${PostgreSQL_ROOT_DIRECTORIES} + PATH_SUFFIXES + pgsql/server + postgresql/server + include/server + # Help the user find it if we cannot. + DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}" +) + # The PostgreSQL library. set (PostgreSQL_LIBRARY_TO_FIND pq) # Setting some more prefixes for the library @@ -138,42 +151,22 @@ find_library( PostgreSQL_LIBRARY get_filename_component(PostgreSQL_LIBRARY_DIR ${PostgreSQL_LIBRARY} PATH) # Did we find anything? -set( PostgreSQL_FOUND 0 ) -if ( EXISTS "${PostgreSQL_INCLUDE_DIR}" AND EXISTS "${PostgreSQL_LIBRARY_DIR}" ) - set( PostgreSQL_FOUND 1 ) -else ( EXISTS "${PostgreSQL_INCLUDE_DIR}" AND EXISTS "${PostgreSQL_LIBRARY_DIR}" ) - if ( POSTGRES_REQUIRED ) - message( FATAL_ERROR "PostgreSQL is required. ${PostgreSQL_ROOT_DIR_MESSAGE}" ) - endif ( POSTGRES_REQUIRED ) -endif (EXISTS "${PostgreSQL_INCLUDE_DIR}" AND EXISTS "${PostgreSQL_LIBRARY_DIR}" ) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PostgreSQL DEFAULT_MSG + PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR) + +set( PostgreSQL_FOUND ${POSTGRESQL_FOUND}) # Now try to get the include and library path. if(PostgreSQL_FOUND) - if(EXISTS "${PostgreSQL_INCLUDE_DIR}") - set(PostgreSQL_INCLUDE_DIRS - ${PostgreSQL_INCLUDE_DIR} - ) - endif(EXISTS "${PostgreSQL_INCLUDE_DIR}") - - if(EXISTS "${PostgreSQL_LIBRARY_DIR}") - set(PostgreSQL_LIBRARY_DIRS - ${PostgreSQL_LIBRARY_DIR} - ) - set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY_TO_FIND}) - endif(EXISTS "${PostgreSQL_LIBRARY_DIR}") + set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR} ${PostgreSQL_TYPE_INCLUDE_DIR} ) + set(PostgreSQL_LIBRARY_DIRS ${PostgreSQL_LIBRARY_DIR} ) + set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY_TO_FIND}) #message("Final PostgreSQL include dir: ${PostgreSQL_INCLUDE_DIRS}") #message("Final PostgreSQL library dir: ${PostgreSQL_LIBRARY_DIRS}") #message("Final PostgreSQL libraries: ${PostgreSQL_LIBRARIES}") endif(PostgreSQL_FOUND) -if(NOT PostgreSQL_FOUND) - if(NOT PostgreSQL_FIND_QUIETLY) - message(STATUS "PostgreSQL was not found. ${PostgreSQL_DIR_MESSAGE}") - else(NOT PostgreSQL_FIND_QUIETLY) - if(PostgreSQL_FIND_REQUIRED) - message(FATAL_ERROR "PostgreSQL was not found. ${PostgreSQL_DIR_MESSAGE}") - endif(PostgreSQL_FIND_REQUIRED) - endif(NOT PostgreSQL_FIND_QUIETLY) -endif(NOT PostgreSQL_FOUND) +mark_as_advanced(PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR PostgreSQL_LIBRARY ) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index e592438..1ebd69d 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -352,7 +352,7 @@ IF(QT_QT_LIBRARY) ENDIF(QT_QT_LIBRARY) -INCLUDE(CheckSymbolExists) +INCLUDE(CheckCXXSymbolExists) INCLUDE(MacroAddFileDependencies) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) @@ -715,19 +715,19 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) # Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}") # Check for Window system symbols (note: only one should end up being set) - CHECK_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11) - CHECK_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN) - CHECK_SYMBOL_EXISTS(Q_WS_QWS "QtCore/qglobal.h" Q_WS_QWS) - CHECK_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC) + CHECK_CXX_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11) + CHECK_CXX_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN) + CHECK_CXX_SYMBOL_EXISTS(Q_WS_QWS "QtCore/qglobal.h" Q_WS_QWS) + CHECK_CXX_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC) IF(Q_WS_MAC) IF(QT_QMAKE_CHANGED) UNSET(QT_MAC_USE_COCOA CACHE) ENDIF(QT_QMAKE_CHANGED) - CHECK_SYMBOL_EXISTS(QT_MAC_USE_COCOA "QtCore/qconfig.h" QT_MAC_USE_COCOA) + CHECK_CXX_SYMBOL_EXISTS(QT_MAC_USE_COCOA "QtCore/qconfig.h" QT_MAC_USE_COCOA) ENDIF(Q_WS_MAC) IF (QT_QTCOPY_REQUIRED) - CHECK_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY) + CHECK_CXX_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY) IF (NOT QT_IS_QTCOPY) MESSAGE(FATAL_ERROR "qt-copy is required, but hasn't been found") ENDIF (NOT QT_IS_QTCOPY) diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index 59e5ec1..b6735c1 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -330,6 +330,40 @@ IF(MSVC) ENDFOREACH(lib) ENDIF(MSVC) +IF(WATCOM) + GET_FILENAME_COMPONENT( CompilerPath ${CMAKE_C_COMPILER} PATH ) + IF(WATCOM17) + SET( __install__libs ${CompilerPath}/clbr17.dll + ${CompilerPath}/mt7r17.dll ${CompilerPath}/plbr17.dll ) + ENDIF() + IF(WATCOM18) + SET( __install__libs ${CompilerPath}/clbr18.dll + ${CompilerPath}/mt7r18.dll ${CompilerPath}/plbr18.dll ) + ENDIF() + IF(WATCOM19) + SET( __install__libs ${CompilerPath}/clbr19.dll + ${CompilerPath}/mt7r19.dll ${CompilerPath}/plbr19.dll ) + ENDIF() + FOREACH(lib + ${__install__libs} + ) + IF(EXISTS ${lib}) + SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS + ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib}) + ELSE() + IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) + MESSAGE(WARNING "system runtime library file does not exist: '${lib}'") + # This warning indicates an incomplete Watcom installation + # or a bug somewhere above here in this file. + # If you would like to avoid this warning, fix the real problem, or + # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including + # this file. + ENDIF() + ENDIF() + ENDFOREACH() +ENDIF() + + # Include system runtime libraries in the installation if any are # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS. IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS) diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in index df9d2d3..6259a5b 100644 --- a/Modules/NSIS.template.in +++ b/Modules/NSIS.template.in @@ -74,7 +74,7 @@ Var AR_RegFlags ClearErrors ;Reading component status from registry - ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" "Installed" + ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" "Installed" IfErrors "default_${SecName}" ;Status will stay default if registry value not found ;(component was never installed) @@ -107,13 +107,13 @@ Var AR_RegFlags ;Section is not selected: ;Calling Section uninstall macro and writing zero installed flag !insertmacro "Remove_${${SecName}}" - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \ + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" \ "Installed" 0 Goto "exit_${SecName}" "leave_${SecName}:" ;Section is selected: - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \ + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" \ "Installed" 1 "exit_${SecName}:" @@ -493,7 +493,7 @@ Function ConditionalAddToRegisty Pop $0 Pop $1 StrCmp "$0" "" ConditionalAddToRegisty_EmptyString - WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" \ + WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" \ "$1" "$0" ;MessageBox MB_OK "Set Registry: '$1' to '$0'" DetailPrint "Set install registry entry: '$1' to '$0'" @@ -804,17 +804,17 @@ FunctionEnd Section "Uninstall" ReadRegStr $START_MENU SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "StartMenu" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "StartMenu" ;MessageBox MB_OK "Start menu is in: $START_MENU" ReadRegStr $DO_NOT_ADD_TO_PATH SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "DoNotAddToPath" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "DoNotAddToPath" ReadRegStr $ADD_TO_PATH_ALL_USERS SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathAllUsers" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "AddToPathAllUsers" ReadRegStr $ADD_TO_PATH_CURRENT_USER SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathCurrentUser" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "AddToPathCurrentUser" ;MessageBox MB_OK "Add to path: $DO_NOT_ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS" ReadRegStr $INSTALL_DESKTOP SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "InstallToDesktop" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "InstallToDesktop" ;MessageBox MB_OK "Install to desktop: $INSTALL_DESKTOP " @CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS@ @@ -831,7 +831,7 @@ Section "Uninstall" ;Remove the uninstaller itself. Delete "$INSTDIR\Uninstall.exe" - DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" + DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" ;Remove the installation directory if it is empty. RMDir "$INSTDIR" diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake index e96ebb5..e1140df 100644 --- a/Modules/Platform/Windows-wcl386.cmake +++ b/Modules/Platform/Windows-wcl386.cmake @@ -39,7 +39,7 @@ SET (CMAKE_C_STANDARD_LIBRARIES_INIT "library clbrdll.lib library plbrdll.lib l SET (CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") SET(CMAKE_C_CREATE_IMPORT_LIBRARY - "wlib -q -n -b <TARGET_IMPLIB> +'<TARGET_UNQUOTED>'") + "wlib -c -q -n -b <TARGET_IMPLIB> +'<TARGET_UNQUOTED>'") SET(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY}) SET(CMAKE_C_LINK_EXECUTABLE @@ -77,7 +77,45 @@ SET(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_MODULE}) # create a C++ static library -SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -n -b '<TARGET_UNQUOTED>' <LINK_FLAGS> <OBJECTS> ") +SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -c -n -b '<TARGET_UNQUOTED>' <LINK_FLAGS> <OBJECTS> ") # create a C static library SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY}) + +IF(NOT CMAKE_WATCOM_COMPILER_TESTS_RUN) + SET(CMAKE_WATCOM_COMPILER_TESTS_RUN 1) + SET(testWatcomVersionFile + "${CMAKE_ROOT}/Modules/CMakeTestWatcomVersion.c") + STRING(REGEX REPLACE "/" "\\\\" testWatcomVersionFile "${testWatcomVersionFile}") + MESSAGE(STATUS "Check for Watcom compiler version") + SET(CMAKE_TEST_COMPILER ${CMAKE_C_COMPILER}) + IF (NOT CMAKE_C_COMPILER) + SET(CMAKE_TEST_COMPILER ${CMAKE_CXX_COMPILER}) + ENDIF() + EXECUTE_PROCESS(COMMAND ${CMAKE_TEST_COMPILER} + -q -pc \"${testWatcomVersionFile}\" + OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT + RESULT_VARIABLE CMAKE_COMPILER_RETURN + ) + STRING(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}") + STRING(REGEX REPLACE ".*VERSION=(.*)" "\\1" + compilerVersion "${compilerVersion}") + IF("${CMAKE_COMPILER_RETURN}" STREQUAL "0") + SET(WATCOM16) + SET(WATCOM17) + SET(WATCOM18) + SET(WATCOM19) + IF("${compilerVersion}" LESS 1270) + SET(WATCOM16 1) + ENDIF() + IF("${compilerVersion}" EQUAL 1270) + SET(WATCOM17 1) + ENDIF() + IF("${compilerVersion}" EQUAL 1280) + SET(WATCOM18 1) + ENDIF() + IF("${compilerVersion}" EQUAL 1290) + SET(WATCOM19 1) + ENDIF() + ENDIF() +ENDIF() diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 7e5b26d..0e4acd5 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -33,7 +33,7 @@ //---------------------------------------------------------------------- cmCPackGenerator::cmCPackGenerator() { - this->GeneratorVerbose = false; + this->GeneratorVerbose = cmSystemTools::OUTPUT_NONE; this->MakefileMap = 0; this->Logger = 0; this->componentPackageMethod = ONE_PACKAGE_PER_GROUP; diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 05d95b8..52def9d 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -14,6 +14,7 @@ #define cmCPackGenerator_h #include "cmObject.h" +#include "cmSystemTools.h" #include <map> #include <vector> @@ -57,7 +58,9 @@ public: /** * If verbose then more information is printed out */ - void SetVerbose(bool val) { this->GeneratorVerbose = val; } + void SetVerbose(bool val) + { this->GeneratorVerbose = val ? + cmSystemTools::OUTPUT_MERGE : cmSystemTools::OUTPUT_NONE; } /** * Do the actual whole package processing. @@ -194,7 +197,7 @@ protected: virtual cmCPackComponentGroup* GetComponentGroup(const char *projectName, const char* name); - bool GeneratorVerbose; + cmSystemTools::OutputOption GeneratorVerbose; std::string Name; std::string InstallPath; diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index e5fe575..2b94067 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -672,9 +672,6 @@ CreateComponentDescription(cmCPackComponent *component, } componentCode += " SetOutPath \"$INSTDIR\"\n"; - componentCode += " IntCmp $" + component->Name - + "_was_installed ${SF_SELECTED} noinstall_" + component->Name + "\n"; - // Create the actual installation commands if (component->IsDownloaded) { @@ -786,7 +783,8 @@ CreateComponentDescription(cmCPackComponent *component, std::string output; int retVal = -1; int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &retVal, - dirName.c_str(), false, 0); + dirName.c_str(), + cmSystemTools::OUTPUT_NONE, 0); if ( !res || retVal ) { std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); @@ -824,7 +822,6 @@ CreateComponentDescription(cmCPackComponent *component, componentCode += " File /r \"${INST_DIR}\\" + component->Name + "\\*.*\"\n"; } - componentCode += " noinstall_" + component->Name + ":\n"; componentCode += "SectionEnd\n"; // Macro used to remove the component diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index 8c3c22a..fd75e45 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -18,7 +18,7 @@ //---------------------------------------------------------------------- cmCTestGenericHandler::cmCTestGenericHandler() { - this->HandlerVerbose = false; + this->HandlerVerbose = cmSystemTools::OUTPUT_NONE; this->CTest = 0; this->SubmitIndex = 0; this->AppendXML = false; diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h index 7393145..18189ec 100644 --- a/Source/CTest/cmCTestGenericHandler.h +++ b/Source/CTest/cmCTestGenericHandler.h @@ -16,6 +16,7 @@ #include "cmObject.h" #include "cmCTest.h" +#include "cmSystemTools.h" //OutputOption class cmMakefile; class cmCTestCommand; @@ -31,7 +32,9 @@ public: /** * If verbose then more informaiton is printed out */ - void SetVerbose(bool val) { this->HandlerVerbose = val; } + void SetVerbose(bool val) + { this->HandlerVerbose = val ? + cmSystemTools::OUTPUT_MERGE : cmSystemTools::OUTPUT_NONE; } /** * Populate internals from CTest custom scripts @@ -91,7 +94,7 @@ protected: bool StartLogFile(const char* name, cmGeneratedFileStream& xofs); bool AppendXML; - bool HandlerVerbose; + cmSystemTools::OutputOption HandlerVerbose; cmCTest *CTest; t_StringToString Options; t_StringToString PersistentOptions; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index e3b81df..b824e47 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1301,7 +1301,8 @@ int cmCTestTestHandler::ExecuteCommands(std::vector<cmStdString>& vec) int retVal = 0; cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << *it << std::endl); - if ( !cmSystemTools::RunSingleCommand(it->c_str(), 0, &retVal, 0, true + if ( !cmSystemTools::RunSingleCommand(it->c_str(), 0, &retVal, 0, + cmSystemTools::OUTPUT_MERGE /*this->Verbose*/) || retVal != 0 ) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Problem running command: " diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index e3c33a2..c87b64d 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1603,6 +1603,18 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo() cmSystemTools::ExpandListArgument(implicitLinks, implicitDirVec); } + // Append library architecture to all implicit platform directories + // and add them to the set + if(const char* libraryArch = + this->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE")) + { + for (std::vector<std::string>::const_iterator i = implicitDirVec.begin(); + i != implicitDirVec.end(); ++i) + { + this->ImplicitLinkDirs.insert(*i + "/" + libraryArch); + } + } + // Get language-specific implicit directories. std::string implicitDirVar = "CMAKE_"; implicitDirVar += this->LinkLanguage; diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 4e75f9c..ebe2988 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -953,7 +953,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("WIN32", cmProperty::VARIABLE, "True on windows systems, including win64.", - "Set to true when the target system is Windows and on cygwin.",false, + "Set to true when the target system is Windows.",false, "Variables That Describe the System"); cm->DefineProperty diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 4f93067..28ea10a 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -266,10 +266,17 @@ void cmExtraCodeBlocksGenerator } // Convert + const char* cmakeRoot = mf->GetDefinition("CMAKE_ROOT"); for (std::vector<std::string>::const_iterator jt = listFiles.begin(); jt != listFiles.end(); ++jt) { + // don't put cmake's own files into the project (#12110): + if (jt->find(cmakeRoot) == 0) + { + continue; + } + const std::string &relative = cmSystemTools::RelativePath( it->second[0]->GetMakefile()->GetHomeDirectory(), jt->c_str()); diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 9d1c220..5aed5e2 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -1196,20 +1196,20 @@ void cmFindPackageCommand::AppendSuccessInformation() if ((cmSystemTools::IsOn(result)) || (cmSystemTools::IsOn(upperResult))) { this->AppendToProperty("PACKAGES_FOUND"); - if (!this->Quiet) - { - this->AppendToProperty("ENABLED_FEATURES"); - } } else { this->AppendToProperty("PACKAGES_NOT_FOUND"); - if (!this->Quiet) - { - this->AppendToProperty("DISABLED_FEATURES"); - } } + // Record whether the find was quiet or not, so this can be used + // e.g. in FeatureSummary.cmake + std::string quietInfoPropName = "_CMAKE_"; + quietInfoPropName += this->Name; + quietInfoPropName += "_QUIET"; + this->Makefile->GetCMakeInstance()->SetProperty(quietInfoPropName.c_str(), + this->Quiet ? "TRUE" : "FALSE"); + // set a global property to record the required version of this package std::string versionInfoPropName = "_CMAKE_"; versionInfoPropName += this->Name; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 6c8938e..2eae01e 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1136,7 +1136,7 @@ int cmGlobalGenerator::Build( const char *config, bool clean, bool fast, double timeout, - bool verbose, + cmSystemTools::OutputOption outputflag, const char* extraOptions, std::vector<std::string> const& nativeOptions) { @@ -1176,7 +1176,7 @@ int cmGlobalGenerator::Build( } if (!cmSystemTools::RunSingleCommand(cleanCommand.c_str(), outputPtr, - &retVal, 0, verbose, timeout)) + &retVal, 0, outputflag, timeout)) { cmSystemTools::SetRunCommandHideConsole(hideconsole); cmSystemTools::Error("Generator: execution of make clean failed."); @@ -1217,7 +1217,7 @@ int cmGlobalGenerator::Build( } if (!cmSystemTools::RunSingleCommand(command, outputPtr, - &retVal, 0, verbose, timeout)) + &retVal, 0, outputflag, timeout)) { cmSystemTools::SetRunCommandHideConsole(hideconsole); cmSystemTools::Error diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 5268731..b7b1bff 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -17,7 +17,7 @@ #include "cmTarget.h" // For cmTargets #include "cmTargetDepend.h" // For cmTargetDependSet - +#include "cmSystemTools.h" // for cmSystemTools::OutputOption class cmake; class cmMakefile; class cmLocalGenerator; @@ -102,7 +102,8 @@ public: std::string *output, const char *makeProgram, const char *config, bool clean, bool fast, - double timeout, bool verbose=false, + double timeout, + cmSystemTools::OutputOption outputflag=cmSystemTools::OUTPUT_NONE, const char* extraOptions = 0, std::vector<std::string> const& nativeOptions = std::vector<std::string>()); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 7a62b9c..3e76f59 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1279,7 +1279,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout, fout << "\t</Files>\n"; // Write the VCProj file's footer. - this->WriteVCProjFooter(fout); + this->WriteVCProjFooter(fout, target); } struct cmLVS7GFileConfig @@ -1880,10 +1880,28 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout, } -void cmLocalVisualStudio7Generator::WriteVCProjFooter(std::ostream& fout) +void cmLocalVisualStudio7Generator::WriteVCProjFooter(std::ostream& fout, + cmTarget &target) { - fout << "\t<Globals>\n" - << "\t</Globals>\n" + fout << "\t<Globals>\n"; + + cmPropertyMap const& props = target.GetProperties(); + for(cmPropertyMap::const_iterator i = props.begin(); i != props.end(); ++i) + { + if(i->first.find("VS_GLOBAL_") == 0) + { + std::string name = i->first.substr(10); + if(name != "") + { + fout << "\t\t<Global\n" + << "\t\t\tName=\"" << name << "\"\n" + << "\t\t\tValue=\"" << i->second.GetValue() << "\"\n" + << "\t\t/>\n"; + } + } + } + + fout << "\t</Globals>\n" << "</VisualStudioProject>\n"; } diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index 160e2d4..4fdbc58 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -84,7 +84,7 @@ private: void WriteProjectFiles(); void WriteVCProjHeader(std::ostream& fout, const char *libName, cmTarget &tgt, std::vector<cmSourceGroup> &sgs); - void WriteVCProjFooter(std::ostream& fout); + void WriteVCProjFooter(std::ostream& fout, cmTarget &target); void CreateSingleVCProj(const char *lname, cmTarget &tgt); void WriteVCProjFile(std::ostream& fout, const char *libName, cmTarget &tgt); diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h index 9e39401..feead00 100644 --- a/Source/cmSetTargetPropertiesCommand.h +++ b/Source/cmSetTargetPropertiesCommand.h @@ -143,6 +143,10 @@ public: "VS_SCC_PROJECTNAME, VS_SCC_LOCALPATH, VS_SCC_PROVIDER can be set " "to add support for source control bindings in a Visual Studio " "project file.\n" + "VS_GLOBAL_<variable> can be set to add a Visual Studio " + "project-specific global variable. " + "Qt integration works better if VS_GLOBAL_QtVersion is set to " + "the Qt version FindQt4.cmake found. For example, \"4.7.3\"\n" "The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the " "old way to specify CMake scripts to run before and after " "installing a target. They are used only when the old " diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 7b80c5c..04e357c 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -63,7 +63,7 @@ bool cmSiteNameCommand { std::string host; cmSystemTools::RunSingleCommand(hostname_cmd.c_str(), - &host, 0, 0, false); + &host, 0, 0, cmSystemTools::OUTPUT_NONE); // got the hostname if (host.length()) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index dbb2226..03364bd 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -12,7 +12,7 @@ #if defined(_MSC_VER) && _MSC_VER < 1300 # define _WIN32_WINNT 0x0400 /* for wincrypt.h */ #endif -#include "cmSystemTools.h" +#include "cmSystemTools.h" #include <ctype.h> #include <errno.h> #include <time.h> @@ -126,7 +126,7 @@ const char* cmSystemTools::GetWindows9xComspecSubstitute() return cmSystemTools::s_Windows9xComspecSubstitute.c_str(); } -void (*cmSystemTools::s_ErrorCallback)(const char*, const char*, +void (*cmSystemTools::s_ErrorCallback)(const char*, const char*, bool&, void*); void (*cmSystemTools::s_StdoutCallback)(const char*, int len, void*); void* cmSystemTools::s_ErrorCallbackClientData = 0; @@ -144,7 +144,7 @@ void cmSystemTools::ExpandRegistryValues(std::string& source, KeyWOW64 view) // a close square-bracket. The ']' character must be the first in the // list of characters inside the [^...] block of the expression. cmsys::RegularExpression regEntry("\\[(HKEY[^]]*)\\]"); - + // check for black line or comment while (regEntry.find(source)) { @@ -237,7 +237,7 @@ void cmSystemTools::Stdout(const char* s) { if(s_StdoutCallback) { - (*s_StdoutCallback)(s, static_cast<int>(strlen(s)), + (*s_StdoutCallback)(s, static_cast<int>(strlen(s)), s_StdoutCallbackClientData); } else @@ -247,6 +247,12 @@ void cmSystemTools::Stdout(const char* s) } } +void cmSystemTools::Stderr(const char* s, int length) +{ + std::cerr.write(s, length); + std::cerr.flush(); +} + void cmSystemTools::Stdout(const char* s, int length) { if(s_StdoutCallback) @@ -268,7 +274,7 @@ void cmSystemTools::Message(const char* m1, const char *title) } if(s_ErrorCallback) { - (*s_ErrorCallback)(m1, title, s_DisableMessages, + (*s_ErrorCallback)(m1, title, s_DisableMessages, s_ErrorCallbackClientData); return; } @@ -276,7 +282,7 @@ void cmSystemTools::Message(const char* m1, const char *title) { std::cerr << m1 << std::endl << std::flush; } - + } @@ -311,7 +317,7 @@ bool cmSystemTools::IsOn(const char* val) return false; } std::basic_string<char> v = val; - + for(std::basic_string<char>::iterator c = v.begin(); c != v.end(); c++) { @@ -344,13 +350,13 @@ bool cmSystemTools::IsOff(const char* val) return true; } std::basic_string<char> v = val; - + for(std::basic_string<char>::iterator c = v.begin(); c != v.end(); c++) { *c = static_cast<char>(toupper(*c)); } - return (v == "OFF" || v == "0" || v == "NO" || v == "FALSE" || + return (v == "OFF" || v == "0" || v == "NO" || v == "FALSE" || v == "N" || cmSystemTools::IsNOTFOUND(v.c_str()) || v == "IGNORE"); } @@ -569,15 +575,15 @@ std::vector<cmStdString> cmSystemTools::ParseArguments(const char* command) args.push_back(arg); } } - + return args; } bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command, std::string* output , - int* retVal , const char* dir , - bool verbose , + int* retVal , const char* dir , + OutputOption outputflag , double timeout ) { std::vector<const char*> argv; @@ -599,46 +605,62 @@ bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command, { cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1); } + cmsysProcess_SetTimeout(cp, timeout); cmsysProcess_Execute(cp); - + std::vector<char> tempOutput; char* data; int length; - if ( output || verbose ) - { - while(cmsysProcess_WaitForData(cp, &data, &length, 0)) + int pipe; + if ( output || outputflag != OUTPUT_NONE ) { - if(output || verbose) + while((pipe = cmsysProcess_WaitForData(cp, &data, &length, 0)) > 0) { - // Translate NULL characters in the output into valid text. - // Visual Studio 7 puts these characters in the output of its - // build process. - for(int i=0; i < length; ++i) + if(output || outputflag != OUTPUT_NONE) { - if(data[i] == '\0') + // Translate NULL characters in the output into valid text. + // Visual Studio 7 puts these characters in the output of its + // build process. + for(int i=0; i < length; ++i) { - data[i] = ' '; + if(data[i] == '\0') + { + data[i] = ' '; + } + } + } + if ( output ) + { + tempOutput.insert(tempOutput.end(), data, data+length); + } + if(outputflag != OUTPUT_NONE) + { + if(outputflag == OUTPUT_MERGE) + { + cmSystemTools::Stdout(data, length); + } + else + { + if(pipe == cmsysProcess_Pipe_STDERR) + { + cmSystemTools::Stderr(data, length); + } + else if(pipe == cmsysProcess_Pipe_STDOUT) + { + cmSystemTools::Stdout(data, length); + } } } - } - if ( output ) - { - tempOutput.insert(tempOutput.end(), data, data+length); - } - if(verbose) - { - cmSystemTools::Stdout(data, length); } } - } - + cmsysProcess_WaitForExit(cp, 0); if ( output && tempOutput.begin() != tempOutput.end()) { output->append(&*tempOutput.begin(), tempOutput.size()); } - + bool result = true; if(cmsysProcess_GetState(cp) == cmsysProcess_State_Exited) { @@ -657,7 +679,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command, else if(cmsysProcess_GetState(cp) == cmsysProcess_State_Exception) { const char* exception_str = cmsysProcess_GetExceptionString(cp); - if ( verbose ) + if ( outputflag != OUTPUT_NONE ) { std::cerr << exception_str << std::endl; } @@ -670,7 +692,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command, else if(cmsysProcess_GetState(cp) == cmsysProcess_State_Error) { const char* error_str = cmsysProcess_GetErrorString(cp); - if ( verbose ) + if ( outputflag != OUTPUT_NONE ) { std::cerr << error_str << std::endl; } @@ -683,7 +705,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command, else if(cmsysProcess_GetState(cp) == cmsysProcess_State_Expired) { const char* error_str = "Process terminated due to timeout\n"; - if ( verbose ) + if ( outputflag != OUTPUT_NONE ) { std::cerr << error_str << std::endl; } @@ -693,22 +715,22 @@ bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command, } result = false; } - + cmsysProcess_Delete(cp); return result; } bool cmSystemTools::RunSingleCommand( - const char* command, + const char* command, std::string* output, - int *retVal, + int *retVal, const char* dir, - bool verbose, + OutputOption outputflag, double timeout) { if(s_DisableRunCommandOutput) { - verbose = false; + outputflag = OUTPUT_NONE; } std::vector<cmStdString> args = cmSystemTools::ParseArguments(command); @@ -717,17 +739,17 @@ bool cmSystemTools::RunSingleCommand( { return false; } - return cmSystemTools::RunSingleCommand(args, output,retVal, - dir, verbose, timeout); + return cmSystemTools::RunSingleCommand(args, output,retVal, + dir, outputflag, timeout); } -bool cmSystemTools::RunCommand(const char* command, +bool cmSystemTools::RunCommand(const char* command, std::string& output, const char* dir, bool verbose, int timeout) { int dummy; - return cmSystemTools::RunCommand(command, output, dummy, + return cmSystemTools::RunCommand(command, output, dummy, dir, verbose, timeout); } @@ -742,11 +764,11 @@ bool RunCommandViaWin32(const char* command, int timeout) { #if defined(__BORLANDC__) - return + return cmWin32ProcessExecution:: - BorlandRunCommand(command, dir, output, - retVal, - verbose, timeout, + BorlandRunCommand(command, dir, output, + retVal, + verbose, timeout, cmSystemTools::GetRunCommandHideConsole()); #else // Visual studio ::SetLastError(ERROR_SUCCESS); @@ -760,7 +782,7 @@ bool RunCommandViaWin32(const char* command, { resProc.SetHideWindows(true); } - + if ( cmSystemTools::GetWindows9xComspecSubstitute() ) { resProc.SetConsoleSpawn(cmSystemTools::GetWindows9xComspecSubstitute() ); @@ -787,7 +809,7 @@ bool RunCommandViaSystem(const char* command, std::string& output, int& retVal, bool verbose) -{ +{ std::cout << "@@ " << command << std::endl; std::string commandInDir; @@ -987,9 +1009,9 @@ bool RunCommandViaPopen(const char* command, // run a command unix uses popen (easy) // windows uses system and ShortPath -bool cmSystemTools::RunCommand(const char* command, +bool cmSystemTools::RunCommand(const char* command, std::string& output, - int &retVal, + int &retVal, const char* dir, bool verbose, int timeout) @@ -998,7 +1020,7 @@ bool cmSystemTools::RunCommand(const char* command, { verbose = false; } - + #if defined(WIN32) && !defined(__CYGWIN__) // if the command does not start with a quote, then // try to find the program, and if the program can not be @@ -1017,9 +1039,9 @@ bool cmSystemTools::RunCommand(const char* command, { break; } - } + } } - // if there are more than two double quotes use + // if there are more than two double quotes use // GetShortPathName, the cmd.exe program in windows which // is used by system fails to execute if there are more than // one set of quotes in the arguments @@ -1043,16 +1065,16 @@ bool cmSystemTools::RunCommand(const char* command, shortCmd += " "; shortCmd += args; - //return RunCommandViaSystem(shortCmd.c_str(), dir, + //return RunCommandViaSystem(shortCmd.c_str(), dir, // output, retVal, verbose); - //return WindowsRunCommand(shortCmd.c_str(), dir, + //return WindowsRunCommand(shortCmd.c_str(), dir, //output, retVal, verbose); - return RunCommandViaWin32(shortCmd.c_str(), dir, + return RunCommandViaWin32(shortCmd.c_str(), dir, output, retVal, verbose, timeout); } else { - cmSystemTools::Error("Could not parse command line with quotes ", + cmSystemTools::Error("Could not parse command line with quotes ", command); } } @@ -1116,7 +1138,7 @@ bool cmSystemTools::cmCopyFile(const char* source, const char* destination) return Superclass::CopyFileAlways(source, destination); } -bool cmSystemTools::CopyFileIfDifferent(const char* source, +bool cmSystemTools::CopyFileIfDifferent(const char* source, const char* destination) { return Superclass::CopyFileIfDifferent(source, destination); @@ -1247,7 +1269,7 @@ void cmSystemTools::Glob(const char *directory, const char *regexp, { cmsys::Directory d; cmsys::RegularExpression reg(regexp); - + if (d.Load(directory)) { size_t numf; @@ -1300,7 +1322,7 @@ void cmSystemTools::GlobDirs(const char *fullPath, } -void cmSystemTools::ExpandList(std::vector<std::string> const& arguments, +void cmSystemTools::ExpandList(std::vector<std::string> const& arguments, std::vector<std::string>& newargs) { std::vector<std::string>::const_iterator i; @@ -1399,8 +1421,8 @@ void cmSystemTools::ExpandListArgument(const std::string& arg, } } -bool cmSystemTools::SimpleGlob(const cmStdString& glob, - std::vector<cmStdString>& files, +bool cmSystemTools::SimpleGlob(const cmStdString& glob, + std::vector<cmStdString>& files, int type /* = 0 */) { files.clear(); @@ -1440,8 +1462,8 @@ bool cmSystemTools::SimpleGlob(const cmStdString& glob, { continue; } - if ( sfname.size() >= ppath.size() && - sfname.substr(0, ppath.size()) == + if ( sfname.size() >= ppath.size() && + sfname.substr(0, ppath.size()) == ppath ) { files.push_back(fname); @@ -1461,10 +1483,10 @@ cmSystemTools::FileFormat cmSystemTools::GetFileFormat(const char* cext) } //std::string ext = cmSystemTools::LowerCase(cext); std::string ext = cext; - if ( ext == "c" || ext == ".c" || - ext == "m" || ext == ".m" + if ( ext == "c" || ext == ".c" || + ext == "m" || ext == ".m" ) { return cmSystemTools::C_FILE_FORMAT; } - if ( + if ( ext == "C" || ext == ".C" || ext == "M" || ext == ".M" || ext == "c++" || ext == ".c++" || @@ -1473,22 +1495,22 @@ cmSystemTools::FileFormat cmSystemTools::GetFileFormat(const char* cext) ext == "cxx" || ext == ".cxx" || ext == "mm" || ext == ".mm" ) { return cmSystemTools::CXX_FILE_FORMAT; } - if ( + if ( ext == "f" || ext == ".f" || ext == "F" || ext == ".F" || ext == "f77" || ext == ".f77" || ext == "f90" || ext == ".f90" || ext == "for" || ext == ".for" || - ext == "f95" || ext == ".f95" + ext == "f95" || ext == ".f95" ) { return cmSystemTools::FORTRAN_FILE_FORMAT; } if ( ext == "java" || ext == ".java" ) { return cmSystemTools::JAVA_FILE_FORMAT; } - if ( - ext == "H" || ext == ".H" || - ext == "h" || ext == ".h" || + if ( + ext == "H" || ext == ".H" || + ext == "h" || ext == ".h" || ext == "h++" || ext == ".h++" || - ext == "hm" || ext == ".hm" || - ext == "hpp" || ext == ".hpp" || + ext == "hm" || ext == ".hm" || + ext == "hpp" || ext == ".hpp" || ext == "hxx" || ext == ".hxx" || ext == "in" || ext == ".in" || ext == "txx" || ext == ".txx" @@ -1501,18 +1523,18 @@ cmSystemTools::FileFormat cmSystemTools::GetFileFormat(const char* cext) ext == "a" || ext == ".a") { return cmSystemTools::STATIC_LIBRARY_FILE_FORMAT; } if ( ext == "o" || ext == ".o" || - ext == "obj" || ext == ".obj") + ext == "obj" || ext == ".obj") { return cmSystemTools::OBJECT_FILE_FORMAT; } #ifdef __APPLE__ - if ( ext == "dylib" || ext == ".dylib" ) + if ( ext == "dylib" || ext == ".dylib" ) { return cmSystemTools::SHARED_LIBRARY_FILE_FORMAT; } - if ( ext == "so" || ext == ".so" || - ext == "bundle" || ext == ".bundle" ) - { return cmSystemTools::MODULE_FILE_FORMAT; } + if ( ext == "so" || ext == ".so" || + ext == "bundle" || ext == ".bundle" ) + { return cmSystemTools::MODULE_FILE_FORMAT; } #else // __APPLE__ - if ( ext == "so" || ext == ".so" || - ext == "sl" || ext == ".sl" || - ext == "dll" || ext == ".dll" ) + if ( ext == "so" || ext == ".so" || + ext == "sl" || ext == ".sl" || + ext == "dll" || ext == ".dll" ) { return cmSystemTools::SHARED_LIBRARY_FILE_FORMAT; } #endif // __APPLE__ return cmSystemTools::UNKNOWN_FILE_FORMAT; @@ -1708,7 +1730,7 @@ bool cmSystemTools::IsPathToFramework(const char* path) return false; } -bool cmSystemTools::CreateTar(const char* outFileName, +bool cmSystemTools::CreateTar(const char* outFileName, const std::vector<cmStdString>& files, bool gzip, bool bzip2, bool verbose) { @@ -1773,7 +1795,7 @@ namespace{ static time_t now; size_t u_width = 6; size_t gs_width = 13; - + /* * We avoid collecting the entire list in memory at once by * listing things as we see them. However, that also means we can't @@ -1788,7 +1810,7 @@ namespace{ fprintf(out, "%s %d ", archive_entry_strmode(entry), archive_entry_nlink(entry)); - + /* Use uname if it's present, else uid. */ p = archive_entry_uname(entry); if ((p == NULL) || (*p == '\0')) @@ -1809,7 +1831,7 @@ namespace{ { fprintf(out, "%s", p); w = strlen(p); - } + } else { sprintf(tmp, "%lu", @@ -1817,20 +1839,20 @@ namespace{ w = strlen(tmp); fprintf(out, "%s", tmp); } - + /* * Print device number or file size, right-aligned so as to make * total width of group and devnum/filesize fields be gs_width. * If gs_width is too small, grow it. */ if (archive_entry_filetype(entry) == AE_IFCHR - || archive_entry_filetype(entry) == AE_IFBLK) + || archive_entry_filetype(entry) == AE_IFBLK) { sprintf(tmp, "%lu,%lu", (unsigned long)archive_entry_rdevmajor(entry), (unsigned long)archive_entry_rdevminor(entry)); } - else + else { /* * Note the use of platform-dependent macros to format @@ -1851,7 +1873,7 @@ namespace{ #define HALF_YEAR (time_t)365 * 86400 / 2 #if defined(_WIN32) && !defined(__CYGWIN__) /* Windows' strftime function does not support %e format. */ -#define DAY_FMT "%d" +#define DAY_FMT "%d" #else #define DAY_FMT "%e" /* Day number without leading zeros */ #endif @@ -1881,15 +1903,15 @@ namespace{ #ifdef __BORLANDC__ # pragma warn -8066 /* unreachable code */ #endif - + long copy_data(struct archive *ar, struct archive *aw) { long r; const void *buff; size_t size; off_t offset; - - for (;;) + + for (;;) { r = archive_read_data_block(ar, &buff, &size, &offset); if (r == ARCHIVE_EOF) @@ -1901,7 +1923,7 @@ long copy_data(struct archive *ar, struct archive *aw) return (r); } r = archive_write_data_block(aw, buff, size, offset); - if (r != ARCHIVE_OK) + if (r != ARCHIVE_OK) { cmSystemTools::Message("archive_write_data_block()", archive_error_string(aw)); @@ -1911,7 +1933,7 @@ long copy_data(struct archive *ar, struct archive *aw) return r; } -bool extract_tar(const char* outFileName, bool verbose, +bool extract_tar(const char* outFileName, bool verbose, bool extract) { struct archive* a = archive_read_new(); @@ -1921,12 +1943,12 @@ bool extract_tar(const char* outFileName, bool verbose, struct archive_entry *entry; int r = archive_read_open_file(a, outFileName, 10240); if(r) - { + { cmSystemTools::Error("Problem with archive_read_open_file(): ", archive_error_string(a)); return false; } - for (;;) + for (;;) { r = archive_read_next_header(a, &entry); if (r == ARCHIVE_EOF) @@ -1969,7 +1991,7 @@ bool extract_tar(const char* outFileName, bool verbose, cmSystemTools::Error("Current file:", archive_entry_pathname(entry)); } - else + else { copy_data(a, ext); r = archive_write_finish_entry(ext); @@ -1991,9 +2013,9 @@ bool extract_tar(const char* outFileName, bool verbose, } } -#endif +#endif -bool cmSystemTools::ExtractTar(const char* outFileName, +bool cmSystemTools::ExtractTar(const char* outFileName, bool , bool verbose) { #if defined(CMAKE_BUILD_WITH_CMAKE) @@ -2005,7 +2027,7 @@ bool cmSystemTools::ExtractTar(const char* outFileName, #endif } -bool cmSystemTools::ListTar(const char* outFileName, +bool cmSystemTools::ListTar(const char* outFileName, bool , bool verbose) { @@ -2121,8 +2143,8 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line, } void cmSystemTools::DoNotInheritStdPipes() -{ -#ifdef _WIN32 +{ +#ifdef _WIN32 // Check to see if we are attached to a console // if so, then do not stop the inherited pipes // or stdout and stderr will not show up in dos diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index ce49959..641c89f 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -29,9 +29,9 @@ class cmSystemTools: public cmsys::SystemTools { public: typedef cmsys::SystemTools Superclass; - + /** Expand out any arguements in the vector that have ; separated - * strings into multiple arguements. A new vector is created + * strings into multiple arguements. A new vector is created * containing the expanded versions of all arguments in argsIn. */ static void ExpandList(std::vector<std::string> const& argsIn, @@ -52,7 +52,7 @@ public: typedef void (*ErrorCallback)(const char*, const char*, bool&, void*); /** * Set the function used by GUI's to display error messages - * Function gets passed: message as a const char*, + * Function gets passed: message as a const char*, * title as a const char*, and a reference to bool that when * set to false, will disable furthur messages (cancel). */ @@ -75,10 +75,13 @@ public: typedef void (*StdoutCallback)(const char*, int length, void*); static void SetStdoutCallback(StdoutCallback, void* clientData=0); + ///! Send a string to stderr. Stdout callbacks will not be invoced. + static void Stderr(const char* s, int length); + ///! Return true if there was an error at any point. - static bool GetErrorOccuredFlag() + static bool GetErrorOccuredFlag() { - return cmSystemTools::s_ErrorOccured || + return cmSystemTools::s_ErrorOccured || cmSystemTools::s_FatalErrorOccured; } ///! If this is set to true, cmake stops processing commands. @@ -91,7 +94,7 @@ public: cmSystemTools::s_ErrorOccured = true; } ///! Return true if there was an error at any point. - static bool GetFatalErrorOccured() + static bool GetFatalErrorOccured() { return cmSystemTools::s_FatalErrorOccured; } @@ -102,25 +105,25 @@ public: cmSystemTools::s_FatalErrorOccured = false; cmSystemTools::s_ErrorOccured = false; } - + /** * Does a string indicates that CMake/CPack/CTest internally * forced this value. This is not the same as On, but this * may be considered as "internally switched on". */ static bool IsInternallyOn(const char* val); - /** + /** * does a string indicate a true or on value ? This is not the same - * as ifdef. - */ + * as ifdef. + */ static bool IsOn(const char* val); - - /** + + /** * does a string indicate a false or off value ? Note that this is * not the same as !IsOn(...) because there are a number of * ambiguous values such as "/usr/local/bin" a path will result in * IsON and IsOff both returning false. Note that the special path - * NOTFOUND, *-NOTFOUND or IGNORE will cause IsOff to return true. + * NOTFOUND, *-NOTFOUND or IGNORE will cause IsOff to return true. */ static bool IsOff(const char* val); @@ -128,7 +131,7 @@ public: static bool IsNOTFOUND(const char* value); ///! Return true if the path is a framework static bool IsPathToFramework(const char* value); - + static bool DoesFileExistWithExtensions( const char *name, const std::vector<std::string>& sourceExts); @@ -154,13 +157,13 @@ public: * want to find. 0 means all files, -1 means directories, 1 means * files only. This method returns true if search was succesfull. */ - static bool SimpleGlob(const cmStdString& glob, - std::vector<cmStdString>& files, + static bool SimpleGlob(const cmStdString& glob, + std::vector<cmStdString>& files, int type = 0); - + ///! Copy a file. static bool cmCopyFile(const char* source, const char* destination); - static bool CopyFileIfDifferent(const char* source, + static bool CopyFileIfDifferent(const char* source, const char* destination); /** Rename a file or directory within a single disk volume (atomic @@ -184,45 +187,53 @@ public: * If timeout is specified, the command will be terminated after * timeout expires. */ - static bool RunCommand(const char* command, std::string& output, + static bool RunCommand(const char* command, std::string& output, const char* directory = 0, bool verbose = true, int timeout = 0); static bool RunCommand(const char* command, std::string& output, - int &retVal, const char* directory = 0, - bool verbose = true, int timeout = 0); + int &retVal, const char* directory = 0, + bool verbose = true, int timeout = 0); /** - * Run a single executable command and put the stdout and stderr - * in output. + * Run a single executable command * - * If verbose is false, no user-viewable output from the program - * being run will be generated. + * Output is controlled with outputflag. If outputflag is OUTPUT_NONE, no + * user-viewable output from the program being run will be generated. + * OUTPUT_MERGE is the legacy behaviour where stdout and stderr are merged + * into stdout. OUTPUT_NORMAL passes through the output to stdout/stderr as + * it was received. * * If timeout is specified, the command will be terminated after * timeout expires. Timeout is specified in seconds. * * Argument retVal should be a pointer to the location where the - * exit code will be stored. If the retVal is not specified and - * the program exits with a code other than 0, then the this + * exit code will be stored. If the retVal is not specified and + * the program exits with a code other than 0, then the this * function will return false. * * If the command has spaces in the path the caller MUST call * cmSystemTools::ConvertToRunCommandPath on the command before passing * it into this function or it will not work. The command must be correctly - * escaped for this to with spaces. + * escaped for this to with spaces. */ + enum OutputOption + { + OUTPUT_NONE = 0, + OUTPUT_MERGE, + OUTPUT_NORMAL + }; static bool RunSingleCommand(const char* command, std::string* output = 0, - int* retVal = 0, const char* dir = 0, - bool verbose = true, + int* retVal = 0, const char* dir = 0, + OutputOption outputflag = OUTPUT_MERGE, double timeout = 0.0); - /** + /** * In this version of RunSingleCommand, command[0] should be * the command to run, and each argument to the command should * be in comand[1]...command[command.size()] */ static bool RunSingleCommand(std::vector<cmStdString> const& command, std::string* output = 0, - int* retVal = 0, const char* dir = 0, - bool verbose = true, + int* retVal = 0, const char* dir = 0, + OutputOption outputflag = OUTPUT_MERGE, double timeout = 0.0); /** @@ -295,7 +306,7 @@ public: static const char* GetWindows9xComspecSubstitute(); /** Windows if this is true, the CreateProcess in RunCommand will - * not show new consol windows when running programs. + * not show new consol windows when running programs. */ static void SetRunCommandHideConsole(bool v){s_RunCommandHideConsole = v;} static bool GetRunCommandHideConsole(){ return s_RunCommandHideConsole;} @@ -303,16 +314,16 @@ public: * result of strerror(errno) */ static void ReportLastSystemError(const char* m); - + /** a general output handler for cmsysProcess */ static int WaitForLine(cmsysProcess* process, std::string& line, double timeout, std::vector<char>& out, std::vector<char>& err); - + /** Split a string on its newlines into multiple lines. Returns false only if the last line stored had no newline. */ - static bool Split(const char* s, std::vector<cmStdString>& l); + static bool Split(const char* s, std::vector<cmStdString>& l); static void SetForceUnixPaths(bool v) { s_ForceUnixPaths = v; @@ -327,14 +338,14 @@ public: static void ConvertToOutputSlashes(std::string& path); // ConvertToRunCommandPath does not use s_ForceUnixPaths and should - // be used when RunCommand is called from cmake, because the + // be used when RunCommand is called from cmake, because the // running cmake needs paths to be in its format static std::string ConvertToRunCommandPath(const char* path); //! Check if the first string ends with the second one. static bool StringEndsWith(const char* str1, const char* str2); - - /** compute the relative path from local to remote. local must - be a directory. remote can be a file or a directory. + + /** compute the relative path from local to remote. local must + be a directory. remote can be a file or a directory. Both remote and local must be full paths. Basically, if you are in directory local and you want to access the file in remote what is the relative path to do that. For example: @@ -385,7 +396,7 @@ public: static bool CreateTar(const char* outFileName, const std::vector<cmStdString>& files, bool gzip, bool bzip2, bool verbose); - static bool ExtractTar(const char* inFileName, bool gzip, + static bool ExtractTar(const char* inFileName, bool gzip, bool verbose); // This should be called first thing in main // it will keep child processes from inheriting the diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index e10ba4a..17a26cc 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -960,6 +960,14 @@ void cmTarget::DefineProperties(cmake *cm) "Visual Studio Source Code Control Project.", "Can be set to change the visual studio source code control " "project name property."); + cm->DefineProperty + ("VS_GLOBAL_<variable>", cmProperty::TARGET, + "Visual Studio project-specific global variable.", + "Tell the Visual Studio generator to set the global variable " + "'<variable>' to a given value in the generated Visual Studio " + "project. Ignored on other generators. Qt integration works " + "better if VS_GLOBAL_QtVersion is set to the version " + "FindQt4.cmake found. For example, \"4.7.3\""); #if 0 cm->DefineProperty diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 4d31a14..c9c4ed5 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -194,7 +194,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs, int timeout = 0; bool worked = cmSystemTools::RunSingleCommand(finalCommand.c_str(), out, &retVal, - 0, false, timeout); + 0, cmSystemTools::OUTPUT_NONE, timeout); // set the run var char retChar[1000]; if (worked) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index d710405..ac4296c 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -178,8 +178,23 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteString("<ProjectGUID>", 2); (*this->BuildFileStream) << "{" << this->GUID << "}</ProjectGUID>\n"; - this->WriteString("<SccProjectName />\n", 2); - this->WriteString("<SccLocalPath />\n", 2); + const char* vsProjectName = this->Target->GetProperty("VS_SCC_PROJECTNAME"); + const char* vsLocalPath = this->Target->GetProperty("VS_SCC_LOCALPATH"); + const char* vsProvider = this->Target->GetProperty("VS_SCC_PROVIDER"); + + if ( vsProjectName && vsLocalPath && vsProvider) + { + this->WriteString("<SccProjectName>", 2); + (*this->BuildFileStream) << cmVS10EscapeXML(vsProjectName) << + "</SccProjectName>\n"; + this->WriteString("<SccLocalPath>", 2); + (*this->BuildFileStream) << cmVS10EscapeXML(vsLocalPath) << + "</SccLocalPath>\n"; + this->WriteString("<SccProvider>", 2); + (*this->BuildFileStream) << cmVS10EscapeXML(vsProvider) << + "</SccProvider>\n"; + } + this->WriteString("<Keyword>Win32Proj</Keyword>\n", 2); this->WriteString("<Platform>", 2); (*this->BuildFileStream) << this->Platform << "</Platform>\n"; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index ec87ab6..51cc9d4 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1299,7 +1299,7 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args) int retval = 0; int timeout = 0; if ( cmSystemTools::RunSingleCommand(command.c_str(), 0, &retval, - directory.c_str(), true, timeout) ) + directory.c_str(), cmSystemTools::OUTPUT_MERGE, timeout) ) { return retval; } @@ -3984,7 +3984,7 @@ bool cmake::RunCommand(const char* comment, // use rc command to create .res file cmSystemTools::RunSingleCommand(command, &output, - &retCode, 0, false); + &retCode, 0, cmSystemTools::OUTPUT_NONE); // always print the output of the command, unless // it is the dumb rc command banner, but if the command // returned an error code then print the output anyway as @@ -4302,7 +4302,8 @@ int cmake::Build(const std::string& dir, const std::string& target, const std::string& config, const std::vector<std::string>& nativeOptions, - bool clean) + bool clean, + cmSystemTools::OutputOption outputflag) { if(!cmSystemTools::FileIsDirectory(dir.c_str())) { @@ -4344,7 +4345,7 @@ int cmake::Build(const std::string& dir, projName.c_str(), target.c_str(), &output, makeProgram.c_str(), - config.c_str(), clean, false, 0, true, + config.c_str(), clean, false, 0, outputflag, 0, nativeOptions); } diff --git a/Source/cmake.h b/Source/cmake.h index b791b7c..f2a2ae3 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -364,7 +364,8 @@ class cmake const std::string& target, const std::string& config, const std::vector<std::string>& nativeOptions, - bool clean); + bool clean, + cmSystemTools::OutputOption outputflag); void UnwatchUnusedCli(const char* var); void WatchUnusedCli(const char* var); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 663ce8f..1fe9e82 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -62,6 +62,7 @@ static const char * cmDocumentationDescription[][3] = " --config <cfg> = For multi-configuration tools, choose <cfg>.\n" \ " --clean-first = Build target 'clean' first, then build.\n" \ " (To clean only, use --target 'clean'.)\n" \ + " --use-stderr = Don't merge stdout/stderr.\n" \ " -- = Pass remaining options to the native tool.\n" //---------------------------------------------------------------------------- @@ -568,6 +569,7 @@ static int do_build(int ac, char** av) std::string dir; std::vector<std::string> nativeOptions; bool clean = false; + cmSystemTools::OutputOption outputflag = cmSystemTools::OUTPUT_MERGE; enum Doing { DoingNone, DoingDir, DoingTarget, DoingConfig, DoingNative}; Doing doing = DoingDir; @@ -590,6 +592,10 @@ static int do_build(int ac, char** av) clean = true; doing = DoingNone; } + else if(strcmp(av[i], "--use-stderr") == 0) + { + outputflag = cmSystemTools::OUTPUT_NORMAL; + } else if(strcmp(av[i], "--") == 0) { doing = DoingNative; @@ -635,6 +641,6 @@ static int do_build(int ac, char** av) } cmake cm; - return cm.Build(dir, target, config, nativeOptions, clean); + return cm.Build(dir, target, config, nativeOptions, clean, outputflag); #endif } diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 33cd79b..a4a6252 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -15,7 +15,7 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) # 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 27) +SET(KWSYS_DATE_STAMP_DAY 02) diff --git a/Tests/CMakeTestAllGenerators/RunCMake.cmake b/Tests/CMakeTestAllGenerators/RunCMake.cmake index dcf4a23..6d27d3b 100644 --- a/Tests/CMakeTestAllGenerators/RunCMake.cmake +++ b/Tests/CMakeTestAllGenerators/RunCMake.cmake @@ -60,6 +60,28 @@ message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)") message(STATUS "CMake generators='${generators}'") +# If we'll be testing any of the MinGW Makefiles generators, adjust the +# ENV{PATH} to make sure libgmp-10.dll can be loaded as needed. But only if +# the testing machine has a default MinGW install... (If you have a +# non-default install, append to the PATH before running the test...) +# +if(generators MATCHES "MinGW Makefiles") + if(EXISTS "C:/MinGW/bin/libgmp-10.dll") + string(TOLOWER "$ENV{PATH}" path) + if(NOT path MATCHES "/mingw/bin") + if(UNIX) + set(sep ":") + set(mingw_bin "/mingw/bin") + else() + set(sep ";") + set(mingw_bin "C:/MinGW/bin") + endif() + set(ENV{PATH} "$ENV{PATH}${sep}${mingw_bin}") + message(STATUS "info: appending '${sep}${mingw_bin}' to the PATH") + endif() + endif() +endif() + # First setup a source tree to run CMake on. # execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake index a52cb14..335d09e 100644 --- a/Tests/CTestUpdateCommon.cmake +++ b/Tests/CTestUpdateCommon.cmake @@ -29,11 +29,13 @@ function(check_updates build) endif(NOT UPDATE_XML_FILE) message(" found ${UPDATE_XML_FILE}") + set(max_update_xml_size 16384) + # Read entries from the Update.xml file set(types "Updated|Modified|Conflicting") file(STRINGS ${TOP}/${UPDATE_XML_FILE} UPDATE_XML_ENTRIES REGEX "<(${types}|FullName)>" - LIMIT_INPUT 4096 + LIMIT_INPUT ${max_update_xml_size} ) string(REGEX REPLACE "[ \t]*<(${types})>[ \t]*;[ \t]*<FullName>([^<]*)</FullName>" @@ -51,7 +53,7 @@ function(check_updates build) set(rev_regex "^\t<(${rev_regex})>[^<\n]+</(${rev_regex})>$") file(STRINGS ${TOP}/${UPDATE_XML_FILE} UPDATE_XML_REVISIONS REGEX "${rev_regex}" - LIMIT_INPUT 4096 + LIMIT_INPUT ${max_update_xml_size} ) foreach(r IN LISTS UPDATE_XML_REVISIONS) string(REGEX REPLACE "${rev_regex}" "\\1" element "${r}") @@ -94,7 +96,7 @@ function(check_updates build) file(GLOB UPDATE_LOG_FILE ${TOP}/${build}/Testing/Temporary/LastUpdate*.log) if(UPDATE_LOG_FILE) - file(READ ${UPDATE_LOG_FILE} UPDATE_LOG LIMIT 4096) + file(READ ${UPDATE_LOG_FILE} UPDATE_LOG LIMIT ${max_update_xml_size}) string(REGEX REPLACE "\n" "\n " UPDATE_LOG "${UPDATE_LOG}") set(MSG "${MSG}Update log:\n ${UPDATE_LOG}") else(UPDATE_LOG_FILE) diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt index 5d7d14e..c5cb336 100644 --- a/Tests/VSResource/CMakeLists.txt +++ b/Tests/VSResource/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.3.20110118) +cmake_minimum_required(VERSION 2.8.4) project(VSResource) string(REPLACE "/INCREMENTAL:YES" "" @@ -35,3 +35,6 @@ else() endif() add_executable(VSResource main.cpp test.rc) + +set_property(TARGET VSResource + PROPERTY VS_GLOBAL_CMakeTestVsGlobalVariable "test val") |