diff options
107 files changed, 697 insertions, 402 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 76561b9..3499da8 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -4,10 +4,10 @@ Contributing to CMake Community ========= -CMake is maintained by `Kitware, Inc.`_ and developed in +CMake is maintained and supported by `Kitware`_ and developed in collaboration with a productive community of contributors. -.. _`Kitware, Inc.`: http://www.kitware.com +.. _`Kitware`: http://www.kitware.com/cmake The preferred entry point for new contributors is the mailing list. Please subscribe and post to the `CMake Developers List`_ to offer diff --git a/CompileFlags.cmake b/CompileFlags.cmake index 24ac58d..5874031 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -19,7 +19,6 @@ endif() if(CMAKE_GENERATOR MATCHES "Visual Studio 6") set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) endif() -include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") set(_INTEL_WINDOWS 1) @@ -54,6 +53,18 @@ if(CMAKE_SYSTEM MATCHES "OSF1-V.*") endif() endif() +if(CMAKE_SYSTEM_NAME MATCHES "HP-UX" AND CMAKE_CXX_COMPILER_ID MATCHES "HP") + # HP aCC since version 3.80 supports the flag +hpxstd98 to get ANSI C++98 + # template support. It is known that version 6.25 doesn't need that flag. + # Versions prior to 3.80 will not be able to build CMake. Current assumption: + # it is needed for every version from 3.80 to 4 to get it working. + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4 AND + NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.80) + # use new C++ library and improved template support + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA +hpxstd98") + endif() +endif() + # use the ansi CXX compile flag for building cmake if (CMAKE_ANSI_CXXFLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") @@ -68,3 +79,5 @@ endif () if (CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_SYSTEM_PROCESSOR STREQUAL parisc) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--unique=.text._*") endif () + +include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst index 75f917d..581bace 100644 --- a/Help/command/target_include_directories.rst +++ b/Help/command/target_include_directories.rst @@ -40,3 +40,17 @@ Arguments to ``target_include_directories`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. + +Include directories usage requirements commonly differ between the build-tree +and the install-tree. The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE`` +generator expressions can be used to describe separate usage requirements +based on the usage location. Relative paths are allowed within the +``INSTALL_INTERFACE`` expression and are interpreted relative to the +installation prefix. For example: + +.. code-block:: cmake + + target_include_directories(mylib PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mylib> + $<INSTALL_INTERFACE:include/mylib> # <prefix>/include/mylib + ) diff --git a/Help/manual/OPTIONS_HELP.txt b/Help/manual/OPTIONS_HELP.txt index 631dfef..feeca7d 100644 --- a/Help/manual/OPTIONS_HELP.txt +++ b/Help/manual/OPTIONS_HELP.txt @@ -11,6 +11,12 @@ If a file is specified, the version is written into it. |file| +``--help-full [<f>]`` + Print all help manuals and exit. + + All manuals are printed in a human-readable text format. + |file| + ``--help-manual <man> [<f>]`` Print one help manual and exit. diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst index 501b924..f3a5770 100644 --- a/Help/manual/cmake-buildsystem.7.rst +++ b/Help/manual/cmake-buildsystem.7.rst @@ -578,9 +578,19 @@ expands to the installation prefix when imported by a consuming project. Include directories usage requirements commonly differ between the build-tree and the install-tree. The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE`` generator expressions can be used to describe separate usage requirements -based on the usage location. Relative paths are allowed within these -expressions, and are interpreted relative to the current source directory -or the installation prefix, as appropriate. +based on the usage location. Relative paths are allowed within the +``INSTALL_INTERFACE`` expression and are interpreted relative to the +installation prefix. For example: + +.. code-block:: cmake + + add_library(ClimbingStats climbingstats.cpp) + target_include_directories(ClimbingStats INTERFACE + $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/generated> + $<INSTALL_INTERFACE:/absolute/path> + $<INSTALL_INTERFACE:relative/path> + $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/$<CONFIG>/generated> + ) Two convenience APIs are provided relating to include directories usage requirements. The :variable:`CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE` variable diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst index e4c3246..cad4951 100644 --- a/Help/manual/cmake-qt.7.rst +++ b/Help/manual/cmake-qt.7.rst @@ -173,7 +173,7 @@ The Qt 4 and 5 :prop_tgt:`IMPORTED` targets for the QtGui libraries specify that the qtmain.lib static library shipped with Qt will be linked by all dependent executables which have the :prop_tgt:`WIN32_EXECUTABLE` enabled. -Do disable this behavior, enable the ``Qt5_NO_LINK_QTMAIN`` target property for +To disable this behavior, enable the ``Qt5_NO_LINK_QTMAIN`` target property for Qt 5 based targets or ``QT4_NO_LINK_QTMAIN`` target property for Qt 4 based targets. diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index d9d7a0c..f4b9666 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -131,6 +131,7 @@ Variables that Change Behavior /variable/CMAKE_MODULE_PATH /variable/CMAKE_NOT_USING_CONFIG_FLAGS /variable/CMAKE_POLICY_DEFAULT_CMPNNNN + /variable/CMAKE_POLICY_WARNING_CMPNNNN /variable/CMAKE_PREFIX_PATH /variable/CMAKE_PROGRAM_PATH /variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE diff --git a/Help/policy/CMP0025.rst b/Help/policy/CMP0025.rst index f3b39e3..8d19edf 100644 --- a/Help/policy/CMP0025.rst +++ b/Help/policy/CMP0025.rst @@ -1,21 +1,27 @@ CMP0025 ------- -Compiler id for Apple Clang is now AppleClang. +Compiler id for Apple Clang is now ``AppleClang``. -CMake >= 3.0 recognize that Apple Clang is a different compiler +CMake 3.0 and above recognize that Apple Clang is a different compiler than upstream Clang and that they have different version numbers. -CMake now prefers to present this to projects by setting -CMAKE_<LANG>_COMPILER_ID to "AppleClang" instead of "Clang". However, -existing projects may assume the compiler id for Apple Clang is just -"Clang" as it was in CMake < 3.0. Therefore this policy determines -for Apple Clang which compiler id to report in -CMAKE_<LANG>_COMPILER_ID after <LANG> is enabled by the project() or -enable_language() command. +CMake now prefers to present this to projects by setting the +:variable:`CMAKE_<LANG>_COMPILER_ID` variable to ``AppleClang`` instead +of ``Clang``. However, existing projects may assume the compiler id for +Apple Clang is just ``Clang`` as it was in CMake versions prior to 3.0. +Therefore this policy determines for Apple Clang which compiler id to +report in the :variable:`CMAKE_<LANG>_COMPILER_ID` variable after +language ``<LANG>`` is enabled by the :command:`project` or +:command:`enable_language` command. The policy must be set prior +to the invocation of either command. -The OLD behavior for this policy is to use compiler id "Clang". The -NEW behavior for this policy is to use compiler id "AppleClang". +The OLD behavior for this policy is to use compiler id ``Clang``. The +NEW behavior for this policy is to use compiler id ``AppleClang``. -This policy was introduced in CMake version 3.0. CMake version -|release| warns when the policy is not set and uses OLD behavior. Use -the cmake_policy command to set it to OLD or NEW explicitly. +This policy was introduced in CMake version 3.0. Use the +:command:`cmake_policy` command to set this policy to OLD or NEW explicitly. +Unlike most policies, CMake version |release| does *not* warn +by default when this policy is not set and simply uses OLD behavior. +See documentation of the +:variable:`CMAKE_POLICY_WARNING_CMP0025 <CMAKE_POLICY_WARNING_CMP<NNNN>>` +variable to control the warning. diff --git a/Help/policy/CMP0047.rst b/Help/policy/CMP0047.rst index c2d951b..26ae439 100644 --- a/Help/policy/CMP0047.rst +++ b/Help/policy/CMP0047.rst @@ -1,16 +1,28 @@ CMP0047 ------- -Use QCC compiler id for the qcc drivers on QNX. +Use ``QCC`` compiler id for the qcc drivers on QNX. -CMake 2.8.12 and lower assigned the QNX qcc and QCC compiler drivers the "GNU" -compiler id. +CMake 3.0 and above recognize that the QNX qcc compiler driver is +different from the GNU compiler. +CMake now prefers to present this to projects by setting the +:variable:`CMAKE_<LANG>_COMPILER_ID` variable to ``QCC`` instead +of ``GNU``. However, existing projects may assume the compiler id for +QNX qcc is just ``GNU`` as it was in CMake versions prior to 3.0. +Therefore this policy determines for QNX qcc which compiler id to +report in the :variable:`CMAKE_<LANG>_COMPILER_ID` variable after +language ``<LANG>`` is enabled by the :command:`project` or +:command:`enable_language` command. The policy must be set prior +to the invocation of either command. -The OLD behavior for this policy is to use the "GNU" compiler id for the qcc -and QCC compiler drivers. The NEW behavior for this policy is to use the "QCC" -compiler id for those drivers. +The OLD behavior for this policy is to use the ``GNU`` compiler id +for the qcc and QCC compiler drivers. The NEW behavior for this policy +is to use the ``QCC`` compiler id for those drivers. -This policy was introduced in CMake version 3.0. -CMake version |release| warns when the policy is not set and uses -OLD behavior. Use the cmake_policy command to set it to OLD or -NEW explicitly. +This policy was introduced in CMake version 3.0. Use the +:command:`cmake_policy` command to set this policy to OLD or NEW explicitly. +Unlike most policies, CMake version |release| does *not* warn +by default when this policy is not set and simply uses OLD behavior. +See documentation of the +:variable:`CMAKE_POLICY_WARNING_CMP0047 <CMAKE_POLICY_WARNING_CMP<NNNN>>` +variable to control the warning. diff --git a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst index bf4ab46..899e821 100644 --- a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst +++ b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst @@ -3,6 +3,10 @@ INTERFACE_INCLUDE_DIRECTORIES List of public include directories for a library. +The :command:`target_include_directories` command populates this property +with values given to the ``PUBLIC`` and ``INTERFACE`` keywords. Projects +may also get and set the property directly. + Targets may populate this property to publish the include directories required to compile against the headers for the target. Consuming targets can add entries to their own :prop_tgt:`INCLUDE_DIRECTORIES` @@ -13,3 +17,17 @@ Contents of ``INTERFACE_INCLUDE_DIRECTORIES`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. + +Include directories usage requirements commonly differ between the build-tree +and the install-tree. The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE`` +generator expressions can be used to describe separate usage requirements +based on the usage location. Relative paths are allowed within the +``INSTALL_INTERFACE`` expression and are interpreted relative to the +installation prefix. For example: + +.. code-block:: cmake + + set_property(TARGET mylib APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mylib> + $<INSTALL_INTERFACE:include/mylib> # <prefix>/include/mylib + ) diff --git a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst new file mode 100644 index 0000000..b563aea --- /dev/null +++ b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst @@ -0,0 +1,17 @@ +CMAKE_POLICY_WARNING_CMP<NNNN> +------------------------------ + +Explicitly enable or disable the warning when CMake Policy ``CMP<NNNN>`` +is not set. This is meaningful only for the few policies that do not +warn by default: + +* ``CMAKE_POLICY_WARNING_CMP0025`` controls the warning for + policy :policy:`CMP0025`. +* ``CMAKE_POLICY_WARNING_CMP0047`` controls the warning for + policy :policy:`CMP0047`. + +This variable should not be set by a project in CMake code. Project +developers running CMake may set this variable in their cache to +enable the warning (e.g. ``-DCMAKE_POLICY_WARNING_CMP<NNNN>=ON``). +Alternatively, running :manual:`cmake(1)` with the ``--debug-output`` +or ``--trace`` option will also enable the warning. diff --git a/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake b/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake index 9d8ba9e..abbcda4 100644 --- a/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake +++ b/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake @@ -32,7 +32,7 @@ macro (CHECK_COMPILER_FLAG_COMMON_PATTERNS _VAR) FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro FAIL_REGEX "command option .* is not recognized" # XL FAIL_REGEX "command option .* contains an incorrect subargument" # XL - FAIL_REGEX "not supported in this configuration; ignored" # AIX + FAIL_REGEX "not supported in this configuration. ignored" # AIX FAIL_REGEX "File with unknown suffix passed to linker" # PGI FAIL_REGEX "WARNING: unknown flag:" # Open64 FAIL_REGEX "Incorrect command line option:" # Borland diff --git a/Modules/CMakeDetermineVSServicePack.cmake b/Modules/CMakeDetermineVSServicePack.cmake index 353aed6..2854387 100644 --- a/Modules/CMakeDetermineVSServicePack.cmake +++ b/Modules/CMakeDetermineVSServicePack.cmake @@ -2,15 +2,15 @@ # CMakeDetermineVSServicePack # --------------------------- # -# Determine the Visual Studio service pack of the 'cl' in use. +# Deprecated. Do not use. # -# The functionality of this module has been superseded by the platform -# variable CMAKE_<LANG>_COMPILER_VERSION that contains the compiler -# version number. +# The functionality of this module has been superseded by the +# :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable that contains +# the compiler version number. # -# Usage: +# Determine the Visual Studio service pack of the 'cl' in use. # -# :: +# Usage:: # # if(MSVC) # include(CMakeDetermineVSServicePack) @@ -21,14 +21,12 @@ # endif() # # Function DetermineVSServicePack sets the given variable to one of the -# following values or an empty string if unknown: -# -# :: +# following values or an empty string if unknown:: # # vc80, vc80sp1 # vc90, vc90sp1 # vc100, vc100sp1 -# vc110, vc110sp1, vc110sp2 +# vc110, vc110sp1, vc110sp2, vc110sp3, vc110sp4 #============================================================================= # Copyright 2009-2013 Kitware, Inc. @@ -68,6 +66,8 @@ function(_DetermineVSServicePackFromCompiler _OUT_VAR _cl_version) set(_version "vc110sp2") elseif(${_cl_version} VERSION_EQUAL "17.00.60610.1") set(_version "vc110sp3") + elseif(${_cl_version} VERSION_EQUAL "17.00.61030") + set(_version "vc110sp4") else() set(_version "") endif() @@ -86,27 +86,14 @@ function(_DetermineVSServicePack_FastCheckVersionWithCompiler _SUCCESS_VAR _VER OUTPUT_QUIET ) - string(REGEX MATCH "Compiler Version [0-9]+.[0-9]+.[0-9]+.[0-9]+" - _cl_version "${_output}") - - if(_cl_version) - string(REGEX MATCHALL "[0-9]+" - _cl_version_list "${_cl_version}") - list(GET _cl_version_list 0 _major) - list(GET _cl_version_list 1 _minor) - list(GET _cl_version_list 2 _patch) - list(GET _cl_version_list 3 _tweak) - + if(_output MATCHES "Compiler Version (([0-9]+)\\.([0-9]+)\\.([0-9]+)(\\.([0-9]+))?)") + set(_cl_version ${CMAKE_MATCH_1}) + set(_major ${CMAKE_MATCH_2}) + set(_minor ${CMAKE_MATCH_3}) if("${_major}${_minor}" STREQUAL "${MSVC_VERSION}") - set(_cl_version ${_major}.${_minor}.${_patch}.${_tweak}) - else() - unset(_cl_version) - endif() - endif() - - if(_cl_version) set(${_SUCCESS_VAR} true PARENT_SCOPE) set(${_VERSION_VAR} ${_cl_version} PARENT_SCOPE) + endif() endif() endif() endfunction() @@ -127,20 +114,9 @@ function(_DetermineVSServicePack_CheckVersionWithTryCompile _SUCCESS_VAR _VERSI file(REMOVE "${CMAKE_BINARY_DIR}/return0.cc") - string(REGEX MATCH "Compiler Version [0-9]+.[0-9]+.[0-9]+.[0-9]+" - _cl_version "${_output}") - - if(_cl_version) - string(REGEX MATCHALL "[0-9]+" - _cl_version_list "${_cl_version}") - - list(GET _cl_version_list 0 _major) - list(GET _cl_version_list 1 _minor) - list(GET _cl_version_list 2 _patch) - list(GET _cl_version_list 3 _tweak) - + if(_output MATCHES "Compiler Version (([0-9]+)\\.([0-9]+)\\.([0-9]+)(\\.([0-9]+))?)") set(${_SUCCESS_VAR} true PARENT_SCOPE) - set(${_VERSION_VAR} ${_major}.${_minor}.${_patch}.${_tweak} PARENT_SCOPE) + set(${_VERSION_VAR} "${CMAKE_MATCH_1}" PARENT_SCOPE) endif() endfunction() diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake index 0752e04..b6ab7ef 100644 --- a/Modules/CMakeExpandImportedTargets.cmake +++ b/Modules/CMakeExpandImportedTargets.cmake @@ -71,7 +71,11 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT ) set(_CCSR_NEW_REQ_LIBS ) set(_CHECK_FOR_IMPORTED_TARGETS FALSE) foreach(_CURRENT_LIB ${_CCSR_REQ_LIBS}) - get_target_property(_importedConfigs "${_CURRENT_LIB}" IMPORTED_CONFIGURATIONS) + if(TARGET "${_CURRENT_LIB}") + get_target_property(_importedConfigs "${_CURRENT_LIB}" IMPORTED_CONFIGURATIONS) + else() + set(_importedConfigs "") + endif() if (_importedConfigs) # message(STATUS "Detected imported target ${_CURRENT_LIB}") # Ok, so this is an imported target. @@ -123,7 +127,11 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT ) # all remaining imported target names (there shouldn't be any left anyway). set(_CCSR_NEW_REQ_LIBS ) foreach(_CURRENT_LIB ${_CCSR_REQ_LIBS}) - get_target_property(_importedConfigs "${_CURRENT_LIB}" IMPORTED_CONFIGURATIONS) + if(TARGET "${_CURRENT_LIB}") + get_target_property(_importedConfigs "${_CURRENT_LIB}" IMPORTED_CONFIGURATIONS) + else() + set(_importedConfigs "") + endif() if (NOT _importedConfigs) list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" ) # message(STATUS "final: appending ${_CURRENT_LIB}") diff --git a/Modules/CMakeFortranCompilerABI.F b/Modules/CMakeFortranCompilerABI.F index 21ca7ff..b34c284 100644 --- a/Modules/CMakeFortranCompilerABI.F +++ b/Modules/CMakeFortranCompilerABI.F @@ -10,11 +10,15 @@ PRINT *, 'INFO:sizeof_dptr[8]' #elif defined(_M_AMD64) PRINT *, 'INFO:sizeof_dptr[8]' +#elif defined(__x86_64__) + PRINT *, 'INFO:sizeof_dptr[8]' #elif defined(_ILP32) PRINT *, 'INFO:sizeof_dptr[4]' #elif defined(_M_IX86) PRINT *, 'INFO:sizeof_dptr[4]' +#elif defined(__i386__) + PRINT *, 'INFO:sizeof_dptr[4]' #elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8 PRINT *, 'INFO:sizeof_dptr[8]' diff --git a/Modules/CMakeRCInformation.cmake b/Modules/CMakeRCInformation.cmake index 8ffe50a..6bb2636 100644 --- a/Modules/CMakeRCInformation.cmake +++ b/Modules/CMakeRCInformation.cmake @@ -13,15 +13,16 @@ # License text for the above reference.) -# This file sets the basic flags for the Fortran language in CMake. +# This file sets the basic flags for the Windows Resource Compiler. # It also loads the available platform file for the system-compiler # if it exists. # make sure we don't use CMAKE_BASE_NAME from somewhere else set(CMAKE_BASE_NAME) -get_filename_component(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE) -if("${CMAKE_BASE_NAME}" MATCHES "windres") - set(CMAKE_BASE_NAME "windres") +if(CMAKE_RC_COMPILER MATCHES "windres[^/]*$") + set(CMAKE_BASE_NAME "windres") +else() + get_filename_component(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE) endif() set(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) @@ -30,7 +31,7 @@ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL) set (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING - "Flags for Fortran compiler.") + "Flags for Windows Resource Compiler.") # These are the only types of flags that should be passed to the rc # command, if COMPILE_FLAGS is used on a target this will be used diff --git a/Modules/Compiler/QCC-C.cmake b/Modules/Compiler/QCC-C.cmake new file mode 100644 index 0000000..ae4a2f4 --- /dev/null +++ b/Modules/Compiler/QCC-C.cmake @@ -0,0 +1,2 @@ +include(Compiler/QCC) +__compiler_qcc(C) diff --git a/Modules/Compiler/QCC-CXX.cmake b/Modules/Compiler/QCC-CXX.cmake new file mode 100644 index 0000000..a676bbe --- /dev/null +++ b/Modules/Compiler/QCC-CXX.cmake @@ -0,0 +1,12 @@ +include(Compiler/QCC) +__compiler_qcc(CXX) + +# If the toolchain uses qcc for CMAKE_CXX_COMPILER instead of QCC, the +# default for the driver is not c++. +set(CMAKE_CXX_COMPILE_OBJECT + "<CMAKE_CXX_COMPILER> -lang-c++ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>") + +set(CMAKE_CXX_LINK_EXECUTABLE + "<CMAKE_CXX_COMPILER> -lang-c++ <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") + +set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") diff --git a/Modules/Compiler/QCC.cmake b/Modules/Compiler/QCC.cmake new file mode 100644 index 0000000..76477e4 --- /dev/null +++ b/Modules/Compiler/QCC.cmake @@ -0,0 +1,24 @@ + +#============================================================================= +# Copyright 2002-2014 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 distribute this file outside of CMake, substitute the full +# License text for the above reference.) +include(Compiler/GNU) + +macro(__compiler_qcc lang) + __compiler_gnu(${lang}) + + # http://www.qnx.com/developers/docs/6.4.0/neutrino/utilities/q/qcc.html#examples + set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "-V") + + set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-Wp,-isystem,") + set(CMAKE_DEPFILE_FLAGS_${lang} "-Wc,-MMD,<DEPFILE>,-MT,<OBJECT>,-MF,<DEPFILE>") +endmacro() diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 0df51a8..17cb866 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -605,7 +605,7 @@ does not match expected value Retrying download. \") file(REMOVE \"\${file}\") - execute_process(COMMAND ${CMAKE_COMMAND} -P \"${download_script}\") + execute_process(COMMAND \${CMAKE_COMMAND} -P \"${download_script}\") endif() endwhile() diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 7bc8d49..d50e960 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1418,15 +1418,24 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 ) list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"") endif() + # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} + set(config_specific_flags) set(flags) foreach(config ${CUDA_configuration_types}) string(TOUPPER ${config} config_upper) + # Add config specific flags + foreach(f ${CUDA_NVCC_FLAGS_${config_upper}}) + list(APPEND config_specific_flags $<$<CONFIG:${config}>:${f}>) + endforeach() set(important_host_flags) _cuda_get_important_host_flags(important_host_flags ${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}) foreach(f ${important_host_flags}) list(APPEND flags $<$<CONFIG:${config}>:-Xcompiler> $<$<CONFIG:${config}>:${f}>) endforeach() endforeach() + # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags + set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags}) + file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}") # Some generators don't handle the multiple levels of custom command diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake index 971edb7..a453a67 100644 --- a/Modules/FindCurses.cmake +++ b/Modules/FindCurses.cmake @@ -40,7 +40,7 @@ find_library(CURSES_CURSES_LIBRARY NAMES curses ) find_library(CURSES_NCURSES_LIBRARY NAMES ncurses ) set(CURSES_USE_NCURSES FALSE) -if(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY) +if(CURSES_NCURSES_LIBRARY AND ((NOT CURSES_CURSES_LIBRARY) OR CURSES_NEED_NCURSES)) set(CURSES_USE_NCURSES TRUE) endif() # http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html @@ -135,10 +135,20 @@ else() CACHE FILEPATH "The curses library" ${FORCE_IT}) endif() + CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}" + cbreak "" CURSES_NCURSES_HAS_CBREAK) + if(NOT CURSES_NCURSES_HAS_CBREAK) + find_library(CURSES_EXTRA_LIBRARY tinfo HINTS "${_cursesLibDir}") + find_library(CURSES_EXTRA_LIBRARY tinfo ) + CHECK_LIBRARY_EXISTS("${CURSES_EXTRA_LIBRARY}" + cbreak "" CURSES_TINFO_HAS_CBREAK) + endif() endif() -find_library(CURSES_EXTRA_LIBRARY cur_colr HINTS "${_cursesLibDir}") -find_library(CURSES_EXTRA_LIBRARY cur_colr ) +if (NOT CURSES_TINFO_HAS_CBREAK) + find_library(CURSES_EXTRA_LIBRARY cur_colr HINTS "${_cursesLibDir}") + find_library(CURSES_EXTRA_LIBRARY cur_colr ) +endif() find_library(CURSES_FORM_LIBRARY form HINTS "${_cursesLibDir}") find_library(CURSES_FORM_LIBRARY form ) @@ -182,5 +192,7 @@ mark_as_advanced( CURSES_INCLUDE_DIR CURSES_CURSES_HAS_WSYNCUP CURSES_NCURSES_HAS_WSYNCUP + CURSES_NCURSES_HAS_CBREAK + CURSES_TINFO_HAS_CBREAK ) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index d0515c6..99e574e 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1190,14 +1190,14 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) set( QT_PLUGIN_TYPES accessible bearer codecs decorations designer gfxdrivers graphicssystems iconengines imageformats inputmethods mousedrivers phonon_backend script sqldrivers ) set( QT_ACCESSIBLE_PLUGINS qtaccessiblecompatwidgets qtaccessiblewidgets ) - set( QT_BEARER_PLUGINS qcorewlanbearer qgenericbearer ) + set( QT_BEARER_PLUGINS qcorewlanbearer qgenericbearer qnativewifibearer ) set( QT_CODECS_PLUGINS qcncodecs qjpcodecs qkrcodecs qtwcodecs ) set( QT_DECORATIONS_PLUGINS qdecorationdefault qdecorationwindows ) set( QT_DESIGNER_PLUGINS arthurplugin containerextension customwidgetplugin phononwidgets qdeclarativeview qt3supportwidgets qwebview taskmenuextension worldtimeclockplugin ) set( QT_GRAPHICSDRIVERS_PLUGINS qgfxtransformed qgfxvnc qscreenvfb ) set( QT_GRAPHICSSYSTEMS_PLUGINS qglgraphicssystem qtracegraphicssystem ) set( QT_ICONENGINES_PLUGINS qsvgicon ) - set( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff ) + set( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff qtga ) set( QT_INPUTMETHODS_PLUGINS qimsw_multi ) set( QT_MOUSEDRIVERS_PLUGINS qwstslibmousehandler ) if(APPLE) @@ -1211,7 +1211,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) set( QT_PHONON_PLUGINS ${QT_PHONON_BACKEND_PLUGINS} ) set( QT_QT3SUPPORT_PLUGINS qtaccessiblecompatwidgets ) set( QT_QTCORE_PLUGINS ${QT_BEARER_PLUGINS} ${QT_CODECS_PLUGINS} ) - set( QT_QTGUI_PLUGINS qtaccessiblewidgets qgif qjpeg qmng qico qtiff ${QT_DECORATIONS_PLUGINS} ${QT_GRAPHICSDRIVERS_PLUGINS} ${QT_GRAPHICSSYSTEMS_PLUGINS} ${QT_INPUTMETHODS_PLUGINS} ${QT_MOUSEDRIVERS_PLUGINS} ) + set( QT_QTGUI_PLUGINS qtaccessiblewidgets ${QT_IMAGEFORMATS_PLUGINS} ${QT_DECORATIONS_PLUGINS} ${QT_GRAPHICSDRIVERS_PLUGINS} ${QT_GRAPHICSSYSTEMS_PLUGINS} ${QT_INPUTMETHODS_PLUGINS} ${QT_MOUSEDRIVERS_PLUGINS} ) set( QT_QTSCRIPT_PLUGINS ${QT_SCRIPT_PLUGINS} ) set( QT_QTSQL_PLUGINS ${QT_SQLDRIVERS_PLUGINS} ) set( QT_QTSVG_PLUGINS qsvg qsvgicon ) diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index 013a028..86033e6 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -295,25 +295,42 @@ if(MSVC) macro(MFC_FILES_FOR_VERSION version) set(v "${version}") + # Multi-Byte Character Set versions of MFC are available as optional + # addon since Visual Studio 12. So for version 12 or higher, check + # whether they are available and exclude them if they are not. + if("${v}" LESS 12 OR EXISTS "${MSVC${v}_MFC_DIR}/mfc${v}0d.dll") + set(mbcs ON) + else() + set(mbcs OFF) + endif() + if(CMAKE_INSTALL_DEBUG_LIBRARIES) set(MSVC${v}_MFC_DIR "${MSVC${v}_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.DebugMFC") set(__install__libs ${__install__libs} - "${MSVC${v}_MFC_DIR}/mfc${v}0d.dll" "${MSVC${v}_MFC_DIR}/mfc${v}0ud.dll" - "${MSVC${v}_MFC_DIR}/mfcm${v}0d.dll" "${MSVC${v}_MFC_DIR}/mfcm${v}0ud.dll" ) + if(mbcs) + set(__install__libs ${__install__libs} + "${MSVC${v}_MFC_DIR}/mfc${v}0d.dll" + "${MSVC${v}_MFC_DIR}/mfcm${v}0d.dll" + ) + endif() endif() set(MSVC${v}_MFC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFC") if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) set(__install__libs ${__install__libs} - "${MSVC${v}_MFC_DIR}/mfc${v}0.dll" "${MSVC${v}_MFC_DIR}/mfc${v}0u.dll" - "${MSVC${v}_MFC_DIR}/mfcm${v}0.dll" "${MSVC${v}_MFC_DIR}/mfcm${v}0u.dll" ) + if(mbcs) + set(__install__libs ${__install__libs} + "${MSVC${v}_MFC_DIR}/mfc${v}0.dll" + "${MSVC${v}_MFC_DIR}/mfcm${v}0.dll" + ) + endif() endif() # include the language dll's as well as the actuall dll's diff --git a/Modules/Platform/QNX-QCC-C.cmake b/Modules/Platform/QNX-QCC-C.cmake deleted file mode 100644 index e5721a7..0000000 --- a/Modules/Platform/QNX-QCC-C.cmake +++ /dev/null @@ -1,4 +0,0 @@ - -include(Platform/QNX) - -__compiler_qcc(C) diff --git a/Modules/Platform/QNX-QCC-CXX.cmake b/Modules/Platform/QNX-QCC-CXX.cmake deleted file mode 100644 index e490bbe..0000000 --- a/Modules/Platform/QNX-QCC-CXX.cmake +++ /dev/null @@ -1,4 +0,0 @@ - -include(Platform/QNX) - -__compiler_qcc(CXX) diff --git a/Modules/Platform/QNX.cmake b/Modules/Platform/QNX.cmake index cc551bd..ebc4609 100644 --- a/Modules/Platform/QNX.cmake +++ b/Modules/Platform/QNX.cmake @@ -1,5 +1,8 @@ set(QNXNTO 1) +include(Platform/GNU) +unset(CMAKE_LIBRARY_ARCHITECTURE_REGEX) + set(CMAKE_DL_LIBS "") # Shared libraries with no builtin soname may not be linked safely by @@ -14,22 +17,3 @@ foreach(type SHARED_LIBRARY SHARED_MODULE EXE) set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic") set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic") endforeach() - -include(Platform/GNU) -unset(CMAKE_LIBRARY_ARCHITECTURE_REGEX) - -macro(__compiler_qcc lang) - # http://www.qnx.com/developers/docs/6.4.0/neutrino/utilities/q/qcc.html#examples - set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "-V") - - set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-Wp,-isystem,") - set(CMAKE_DEPFILE_FLAGS_${lang} "-Wc,-MMD,<DEPFILE>,-MT,<OBJECT>,-MF,<DEPFILE>") - - if (lang STREQUAL CXX) - # If the toolchain uses qcc for CMAKE_CXX_COMPILER instead of QCC, the - # default for the driver is not c++. - set(CMAKE_CXX_COMPILE_OBJECT - "<CMAKE_CXX_COMPILER> -lang-c++ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>") - endif() - -endmacro() diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake index eca3280..20ee1d1 100644 --- a/Modules/Platform/UnixPaths.cmake +++ b/Modules/Platform/UnixPaths.cmake @@ -83,7 +83,7 @@ list(APPEND CMAKE_SYSTEM_PROGRAM_PATH ) list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES - /lib /usr/lib /usr/lib32 /usr/lib64 + /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64 ) list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index 2bb7a20..872755c 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -151,6 +151,7 @@ macro(__windows_compiler_gnu_abi lang) find_program(CMAKE_GNUtoMS_VCVARS NAMES vcvars32.bat DOC "Visual Studio vcvars32.bat" PATHS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0\\Setup\\VC;ProductDir]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VC;ProductDir]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir]/bin" @@ -160,9 +161,10 @@ macro(__windows_compiler_gnu_abi lang) ) set(CMAKE_GNUtoMS_ARCH x86) elseif("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) - find_program(CMAKE_GNUtoMS_VCVARS NAMES vcvarsamd64.bat + find_program(CMAKE_GNUtoMS_VCVARS NAMES vcvars64.bat vcvarsamd64.bat DOC "Visual Studio vcvarsamd64.bat" PATHS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0\\Setup\\VC;ProductDir]/bin/amd64" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VC;ProductDir]/bin/amd64" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/bin/amd64" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir]/bin/amd64" diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index e29aaf4..cfef536 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -39,12 +39,14 @@ endif() set(WIN32 1) if(CMAKE_SYSTEM_NAME MATCHES "WindowsCE") - set(CMAKE_CREATE_WIN32_EXE "/subsystem:windowsce /entry:WinMainCRTStartup") - set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /entry:mainACRTStartup") + set(CMAKE_CREATE_WIN32_EXE "/entry:WinMainCRTStartup") + set(CMAKE_CREATE_CONSOLE_EXE "/entry:mainACRTStartup") + set(_PLATFORM_LINK_FLAGS " /subsystem:windowsce") set(WINCE 1) else() set(CMAKE_CREATE_WIN32_EXE "/subsystem:windows") set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:console") + set(_PLATFORM_LINK_FLAGS "") endif() if(CMAKE_GENERATOR MATCHES "Visual Studio 6") @@ -235,7 +237,7 @@ macro(__windows_compiler_msvc lang) set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe ") endif() set(CMAKE_${lang}_CREATE_SHARED_LIBRARY - "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") + "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}) set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") @@ -249,7 +251,7 @@ macro(__windows_compiler_msvc lang) set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1) set(CMAKE_${lang}_LINK_EXECUTABLE - "${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") + "${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_FLAGS_INIT "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} /D_WINDOWS /W3${_FLAGS_${lang}}") set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}") diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 8baf896..5ada030 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -103,7 +103,7 @@ endmacro() # helper macro to set up a moc rule -macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target) +function (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target) # For Windows, create a parameters file to work around command line length limit # Pass the parameters in a file. Set the working directory to # be that containing the parameters file and reference it by @@ -144,7 +144,7 @@ macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target) DEPENDS ${infile} ${_moc_working_dir} VERBATIM) -endmacro () +endfunction () macro (QT4_GENERATE_MOC infile outfile ) diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index 11ca205..f8eeef6 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -57,7 +57,7 @@ macro(SWIG_MODULE_INITIALIZE name language) set(SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG "${swig_lowercase_language}") set(SWIG_MODULE_${name}_REAL_NAME "${name}") - if (CMAKE_SWIG_FLAGS MATCHES "-noproxy") + if (";${CMAKE_SWIG_FLAGS};" MATCHES ";-noproxy;") set (SWIG_MODULE_${name}_NOPROXY TRUE) endif () if("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "UNKNOWN") @@ -11,10 +11,10 @@ For full documentation visit the `CMake Home Page`_ and the .. _`CMake Home Page`: http://www.cmake.org .. _`CMake Documentation Page`: http://www.cmake.org/cmake/help/documentation.html -CMake is maintained by `Kitware, Inc.`_ and developed in +CMake is maintained and supported by `Kitware`_ and developed in collaboration with a productive community of contributors. -.. _`Kitware, Inc.`: http://www.kitware.com +.. _`Kitware`: http://www.kitware.com/cmake License ======= diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index b61fe08..4caa608 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 0) -set(CMake_VERSION_PATCH 0) -set(CMake_VERSION_RC 2) +set(CMake_VERSION_PATCH 1) +#set(CMake_VERSION_RC 0) diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index 12ff718..b250fc3 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -113,6 +113,15 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() this->GlobalGenerator = this->Makefile->GetCMakeInstance()->CreateGlobalGenerator( cmakeGeneratorName); + if(!this->GlobalGenerator) + { + std::string e = "could not create generator named \""; + e += cmakeGeneratorName; + e += "\""; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e); + cmSystemTools::SetFatalErrorOccured(); + return 0; + } } if(strlen(cmakeBuildConfiguration) == 0) { diff --git a/Source/QtDialog/CMake.desktop b/Source/QtDialog/CMake.desktop index 645eb76..7be495f 100644 --- a/Source/QtDialog/CMake.desktop +++ b/Source/QtDialog/CMake.desktop @@ -3,7 +3,7 @@ Version=1.0 Name=CMake Comment=Cross-platform buildsystem Exec=cmake-gui %f -Icon=CMakeSetup32.png +Icon=CMakeSetup32 Terminal=false X-MultipleArgs=false Type=Application diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index f62afd6..10879c0 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -812,7 +812,7 @@ void CMakeSetupDialog::doAbout() { QString msg = tr( "CMake %1 (cmake.org).\n" - "CMake suite maintained by Kitware, Inc. (kitware.com).\n" + "CMake suite maintained and supported by Kitware (kitware.com/cmake).\n" "Distributed under terms of the BSD 3-Clause License.\n" "\n" "CMake GUI maintained by csimsoft,\n" diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index ef62523..e27d830 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -165,10 +165,13 @@ bool cmAddCustomTargetCommand if (!nameOk) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; + cmOStringStream e; bool issueMessage = false; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { case cmPolicies::WARN: + e << (this->Makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0037)) << "\n"; issueMessage = true; case cmPolicies::OLD: break; @@ -180,9 +183,6 @@ bool cmAddCustomTargetCommand } if (issueMessage) { - cmOStringStream e; - e << (this->Makefile->GetPolicies() - ->GetPolicyWarning(cmPolicies::CMP0037)) << "\n"; e << "The target name \"" << targetName << "\" is reserved or not valid for certain " "CMake features, such as generator expressions, and may result " diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx index 62b6667..3f9400e 100644 --- a/Source/cmAddExecutableCommand.cxx +++ b/Source/cmAddExecutableCommand.cxx @@ -79,10 +79,13 @@ bool cmAddExecutableCommand if (!nameOk) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; + cmOStringStream e; bool issueMessage = false; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { case cmPolicies::WARN: + e << (this->Makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0037)) << "\n"; issueMessage = true; case cmPolicies::OLD: break; @@ -94,9 +97,6 @@ bool cmAddExecutableCommand } if (issueMessage) { - cmOStringStream e; - e << (this->Makefile->GetPolicies() - ->GetPolicyWarning(cmPolicies::CMP0037)) << "\n"; e << "The target name \"" << exename << "\" is reserved or not valid for certain " "CMake features, such as generator expressions, and may result " diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index 009b1ca..e62a40e 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -214,11 +214,17 @@ bool cmAddLibraryCommand if (!nameOk) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; + cmOStringStream e; bool issueMessage = false; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { case cmPolicies::WARN: - issueMessage = type != cmTarget::INTERFACE_LIBRARY; + if(type != cmTarget::INTERFACE_LIBRARY) + { + e << (this->Makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0037)) << "\n"; + issueMessage = true; + } case cmPolicies::OLD: break; case cmPolicies::NEW: @@ -229,9 +235,6 @@ bool cmAddLibraryCommand } if (issueMessage) { - cmOStringStream e; - e << (this->Makefile->GetPolicies() - ->GetPolicyWarning(cmPolicies::CMP0037)) << "\n"; e << "The target name \"" << libName << "\" is reserved or not valid for certain " "CMake features, such as generator expressions, and may result " diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index d5dcd6a..58f7573 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -18,6 +18,13 @@ #include <cm_libarchive.h> //---------------------------------------------------------------------------- +static std::string cm_archive_error_string(struct archive* a) +{ + const char* e = archive_error_string(a); + return e? e : "unknown error"; +} + +//---------------------------------------------------------------------------- class cmArchiveWrite::Entry { struct archive_entry* Object; @@ -60,7 +67,7 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): if(archive_write_set_compression_none(this->Archive) != ARCHIVE_OK) { this->Error = "archive_write_set_compression_none: "; - this->Error += archive_error_string(this->Archive); + this->Error += cm_archive_error_string(this->Archive); return; } break; @@ -68,7 +75,7 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): if(archive_write_set_compression_compress(this->Archive) != ARCHIVE_OK) { this->Error = "archive_write_set_compression_compress: "; - this->Error += archive_error_string(this->Archive); + this->Error += cm_archive_error_string(this->Archive); return; } break; @@ -76,7 +83,7 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): if(archive_write_set_compression_gzip(this->Archive) != ARCHIVE_OK) { this->Error = "archive_write_set_compression_gzip: "; - this->Error += archive_error_string(this->Archive); + this->Error += cm_archive_error_string(this->Archive); return; } break; @@ -84,7 +91,7 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): if(archive_write_set_compression_bzip2(this->Archive) != ARCHIVE_OK) { this->Error = "archive_write_set_compression_bzip2: "; - this->Error += archive_error_string(this->Archive); + this->Error += cm_archive_error_string(this->Archive); return; } break; @@ -92,7 +99,7 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): if(archive_write_set_compression_lzma(this->Archive) != ARCHIVE_OK) { this->Error = "archive_write_set_compression_lzma: "; - this->Error += archive_error_string(this->Archive); + this->Error += cm_archive_error_string(this->Archive); return; } break; @@ -100,7 +107,7 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): if(archive_write_set_compression_xz(this->Archive) != ARCHIVE_OK) { this->Error = "archive_write_set_compression_xz: "; - this->Error += archive_error_string(this->Archive); + this->Error += cm_archive_error_string(this->Archive); return; } break; @@ -109,7 +116,7 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): if (archive_read_disk_set_standard_lookup(this->Disk) != ARCHIVE_OK) { this->Error = "archive_read_disk_set_standard_lookup: "; - this->Error += archive_error_string(this->Archive); + this->Error += cm_archive_error_string(this->Archive); return;; } #endif @@ -119,7 +126,7 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): if(archive_write_set_format_zip(this->Archive) != ARCHIVE_OK) { this->Error = "archive_write_set_format_zip: "; - this->Error += archive_error_string(this->Archive); + this->Error += cm_archive_error_string(this->Archive); return; } break; @@ -127,7 +134,7 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): if(archive_write_set_format_pax_restricted(this->Archive) != ARCHIVE_OK) { this->Error = "archive_write_set_format_pax_restricted: "; - this->Error += archive_error_string(this->Archive); + this->Error += cm_archive_error_string(this->Archive); return; } break; @@ -137,7 +144,7 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): if (archive_write_set_bytes_in_last_block(this->Archive, 1)) { this->Error = "archive_write_set_bytes_in_last_block: "; - this->Error += archive_error_string(this->Archive); + this->Error += cm_archive_error_string(this->Archive); return; } @@ -147,7 +154,7 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): 0) != ARCHIVE_OK) { this->Error = "archive_write_open: "; - this->Error += archive_error_string(this->Archive); + this->Error += cm_archive_error_string(this->Archive); return; } } @@ -235,7 +242,7 @@ bool cmArchiveWrite::AddFile(const char* file, if(archive_read_disk_entry_from_file(this->Disk, e, -1, 0) != ARCHIVE_OK) { this->Error = "archive_read_disk_entry_from_file: "; - this->Error += archive_error_string(this->Disk); + this->Error += cm_archive_error_string(this->Disk); return false; } // Clear acl and xattr fields not useful for distribution. @@ -245,7 +252,7 @@ bool cmArchiveWrite::AddFile(const char* file, if(archive_write_header(this->Archive, e) != ARCHIVE_OK) { this->Error = "archive_write_header: "; - this->Error += archive_error_string(this->Archive); + this->Error += cm_archive_error_string(this->Archive); return false; } @@ -292,7 +299,7 @@ bool cmArchiveWrite::AddData(const char* file, size_t size) if(archive_write_data(this->Archive, buffer, nnext) != nnext_s) { this->Error = "archive_write_data: "; - this->Error += archive_error_string(this->Archive); + this->Error += cm_archive_error_string(this->Archive); return false; } nleft -= nnext; diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 9e0064e..cc9fa57 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -750,11 +750,7 @@ void cmCacheManager::AddCacheEntry(const char* key, } e.SetProperty("HELPSTRING", helpString? helpString : "(This variable does not exist and should not be used)"); - if (this->Cache[key].Value == e.Value) - { - this->CMakeInstance->UnwatchUnusedCli(key); - } - this->Cache[key] = e; + this->CMakeInstance->UnwatchUnusedCli(key); } bool cmCacheManager::CacheIterator::IsAtEnd() const diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 7870564..9136869 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -349,9 +349,12 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, cmMakefile *makefile = depender->GetMakefile(); cmake::MessageType messageType = cmake::AUTHOR_WARNING; bool issueMessage = false; + cmOStringStream e; switch(depender->GetPolicyStatusCMP0046()) { case cmPolicies::WARN: + e << (makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0046)) << "\n"; issueMessage = true; case cmPolicies::OLD: break; @@ -364,9 +367,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, if(issueMessage) { cmake* cm = this->GlobalGenerator->GetCMakeInstance(); - cmOStringStream e; - e << (makefile->GetPolicies() - ->GetPolicyWarning(cmPolicies::CMP0046)) << "\n"; + e << "The dependency target \"" << dependee_name << "\" of target \"" << depender->GetName() << "\" does not exist."; diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index d5472a1..e4a146c 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -765,7 +765,11 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile, const char* compilerId) { /* - gnu: + gnu >= 4.9: + A mod file is an ascii file compressed with gzip. + Compiling twice produces identical modules. + + gnu < 4.9: A mod file is an ascii file. <bar.mod> FORTRAN module created from /path/to/foo.f90 on Sun Dec 30 22:47:58 2007 @@ -821,21 +825,30 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile, */ if (strcmp(compilerId, "GNU") == 0 ) { - const char seq[1] = {'\n'}; - const int seqlen = 1; - - if(!cmDependsFortranStreamContainsSequence(finModFile, seq, seqlen)) + // GNU Fortran 4.9 and later compress .mod files with gzip + // but also do not include a date so we can fall through to + // compare them without skipping any prefix. + unsigned char hdr[2]; + bool okay = finModFile.read(reinterpret_cast<char*>(hdr), 2)? true:false; + finModFile.seekg(0); + if(!(okay && hdr[0] == 0x1f && hdr[1] == 0x8b)) { - // The module is of unexpected format. Assume it is different. - std::cerr << compilerId << " fortran module " << modFile - << " has unexpected format." << std::endl; - return true; - } + const char seq[1] = {'\n'}; + const int seqlen = 1; - if(!cmDependsFortranStreamContainsSequence(finStampFile, seq, seqlen)) - { - // The stamp must differ if the sequence is not contained. - return true; + if(!cmDependsFortranStreamContainsSequence(finModFile, seq, seqlen)) + { + // The module is of unexpected format. Assume it is different. + std::cerr << compilerId << " fortran module " << modFile + << " has unexpected format." << std::endl; + return true; + } + + if(!cmDependsFortranStreamContainsSequence(finStampFile, seq, seqlen)) + { + // The stamp must differ if the sequence is not contained. + return true; + } } } else if(strcmp(compilerId, "Intel") == 0) diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 9c27fc1..9df1e79 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -30,6 +30,8 @@ static const char *cmDocumentationStandardOptions[][2] = "Print usage information and exit."}, {"--version,-version,/V [<f>]", "Print version number and exit."}, + {"--help-full [<f>]", + "Print all help manuals and exit."}, {"--help-manual <man> [<f>]", "Print one help manual and exit."}, {"--help-manual-list [<f>]", @@ -100,7 +102,7 @@ bool cmDocumentation::PrintVersion(std::ostream& os) this->GetNameString() << " version " << cmVersion::GetCMakeVersion() << "\n" "\n" - "CMake suite maintained by Kitware, Inc. (kitware.com).\n" + "CMake suite maintained and supported by Kitware (kitware.com/cmake).\n" ; return true; } @@ -112,6 +114,8 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os) { case cmDocumentation::Usage: return this->PrintDocumentationUsage(os); + case cmDocumentation::Full: + return this->PrintHelpFull(os); case cmDocumentation::OneManual: return this->PrintHelpOneManual(os); case cmDocumentation::OneCommand: @@ -364,9 +368,9 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv, } else if(strcmp(argv[i], "--help-full") == 0) { + help.HelpType = cmDocumentation::Full; GET_OPT_ARGUMENT(help.Filename); - cmSystemTools::Message("Warning: --help-full no longer supported"); - return true; + this->WarnFormFromFilename(help, result); } else if(strcmp(argv[i], "--help-html") == 0) { @@ -678,6 +682,12 @@ bool cmDocumentation::PrintFiles(std::ostream& os, } //---------------------------------------------------------------------------- +bool cmDocumentation::PrintHelpFull(std::ostream& os) +{ + return this->PrintFiles(os, "index"); +} + +//---------------------------------------------------------------------------- bool cmDocumentation::PrintHelpOneManual(std::ostream& os) { std::string mname = this->CurrentArgument; diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index d5a7dd5..cc16eb7 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -102,6 +102,7 @@ private: bool PrintFiles(std::ostream& os, std::string const& pattern); bool PrintVersion(std::ostream& os); + bool PrintHelpFull(std::ostream& os); bool PrintHelpOneManual(std::ostream& os); bool PrintHelpOneCommand(std::ostream& os); bool PrintHelpOneModule(std::ostream& os); diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h index 118f03d..61766b9 100644 --- a/Source/cmDocumentationFormatter.h +++ b/Source/cmDocumentationFormatter.h @@ -26,7 +26,7 @@ public: /** Types of help provided. */ enum Type { - None, Version, Usage, ListManuals, + None, Version, Usage, Full, ListManuals, ListCommands, ListModules, ListProperties, ListVariables, ListPolicies, OneManual, OneCommand, OneModule, OneProperty, OneVariable, OnePolicy, OldCustomModules diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 33c43ca..810802a 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -302,7 +302,8 @@ bool cmGetPropertyCommand::HandleTargetMode() } if(cmTarget* target = this->Makefile->FindTargetToUse(this->Name)) { - return this->StoreResult(target->GetProperty(this->PropertyName.c_str())); + return this->StoreResult(target->GetProperty(this->PropertyName.c_str(), + this->Makefile)); } else { diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index 4aa49fe..272607e 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -38,7 +38,7 @@ bool cmGetTargetPropertyCommand else if(cmTarget* tgt = this->Makefile->FindTargetToUse(targetName)) { cmTarget& target = *tgt; - prop = target.GetProperty(args[2].c_str()); + prop = target.GetProperty(args[2].c_str(), this->Makefile); } else { diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 4f3328d..beb10da 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -759,7 +759,8 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf, switch(mf->GetPolicyStatus(cmPolicies::CMP0025)) { case cmPolicies::WARN: - if(!this->CMakeInstance->GetIsInTryCompile()) + if(!this->CMakeInstance->GetIsInTryCompile() && + mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0025")) { cmOStringStream w; w << policies->GetPolicyWarning(cmPolicies::CMP0025) << "\n" @@ -790,7 +791,8 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf, switch(mf->GetPolicyStatus(cmPolicies::CMP0047)) { case cmPolicies::WARN: - if(!this->CMakeInstance->GetIsInTryCompile()) + if(!this->CMakeInstance->GetIsInTryCompile() && + mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0047")) { cmOStringStream w; w << policies->GetPolicyWarning(cmPolicies::CMP0047) << "\n" diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 731bc00..60643ac 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -972,7 +972,16 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) { knownDependencies.insert( ng->ConvertToNinjaPath( j->c_str() ) ); } + //get list files which are implicit dependencies as well and will be phony + //for rebuild manifest + std::vector<std::string> const& lf = (*i)->GetMakefile()->GetListFiles(); + typedef std::vector<std::string>::const_iterator vect_it; + for(vect_it j = lf.begin(); j != lf.end(); ++j) + { + knownDependencies.insert( ng->ConvertToNinjaPath( j->c_str() ) ); + } } + knownDependencies.insert( "CMakeCache.txt" ); for(std::vector<cmGeneratorExpressionEvaluationFile*>::const_iterator li = this->EvaluationFiles.begin(); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 484b28f..3503e19 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2298,7 +2298,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, } } - buildSettings->AddAttribute("OTHER_LDFLAGS", + buildSettings->AddAttribute(this->GetTargetLinkFlagsVar(target), this->CreateString(extraLinkOptions.c_str())); buildSettings->AddAttribute("OTHER_REZFLAGS", this->CreateString("")); @@ -2522,6 +2522,22 @@ std::string cmGlobalXCodeGenerator::AddConfigurations(cmXCodeObject* target, } //---------------------------------------------------------------------------- +const char* +cmGlobalXCodeGenerator::GetTargetLinkFlagsVar(cmTarget const& cmtarget) const +{ + if(this->XcodeVersion >= 60 && + (cmtarget.GetType() == cmTarget::STATIC_LIBRARY || + cmtarget.GetType() == cmTarget::OBJECT_LIBRARY)) + { + return "OTHER_LIBTOOLFLAGS"; + } + else + { + return "OTHER_LDFLAGS"; + } +} + +//---------------------------------------------------------------------------- const char* cmGlobalXCodeGenerator::GetTargetFileType(cmTarget& cmtarget) { switch(cmtarget.GetType()) @@ -2834,8 +2850,9 @@ void cmGlobalXCodeGenerator sep = " "; linkObjs += this->XCodeEscapePath(oi->c_str()); } - this->AppendBuildSettingAttribute(target, "OTHER_LDFLAGS", - linkObjs.c_str(), configName); + this->AppendBuildSettingAttribute( + target, this->GetTargetLinkFlagsVar(*cmtarget), + linkObjs.c_str(), configName); } // Skip link information for object libraries. @@ -2913,8 +2930,9 @@ void cmGlobalXCodeGenerator target->AddDependTarget(configName, li->Target->GetName()); } } - this->AppendBuildSettingAttribute(target, "OTHER_LDFLAGS", - linkLibs.c_str(), configName); + this->AppendBuildSettingAttribute( + target, this->GetTargetLinkFlagsVar(*cmtarget), + linkLibs.c_str(), configName); } } } diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index c9d20c2..a7b54e9 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -141,6 +141,7 @@ private: cmXCodeObject* buildPhases); void ForceLinkerLanguages(); void ForceLinkerLanguage(cmTarget& cmtarget); + const char* GetTargetLinkFlagsVar(cmTarget const& cmtarget) const; const char* GetTargetFileType(cmTarget& cmtarget); const char* GetTargetProductType(cmTarget& cmtarget); std::string AddConfigurations(cmXCodeObject* target, cmTarget& cmtarget); diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index e8ee33f..fbcbc75 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -98,11 +98,14 @@ bool cmIncludeCommand if (gg->IsExportedTargetsFile(fname_abs)) { const char *modal = 0; + cmOStringStream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0024)) { case cmPolicies::WARN: + e << (this->Makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0024)) << "\n"; modal = "should"; case cmPolicies::OLD: break; @@ -114,9 +117,6 @@ bool cmIncludeCommand } if (modal) { - cmOStringStream e; - e << (this->Makefile->GetPolicies() - ->GetPolicyWarning(cmPolicies::CMP0024)) << "\n"; e << "The file\n " << fname_abs << "\nwas generated by the export() " "command. It " << modal << " not be used as the argument to the " "include() command. Use ALIAS targets instead to refer to targets " diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 7a39f45..38d369e 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -213,6 +213,20 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os, filesFrom.push_back(from1); filesTo.push_back(to1); } + else if(this->Target->IsCFBundleOnApple()) + { + // Install the whole app bundle directory. + type = cmInstallType_DIRECTORY; + literal_args += " USE_SOURCE_PERMISSIONS"; + + std::string targetNameBase = targetName.substr(0, targetName.find('/')); + + std::string from1 = fromDirConfig + targetNameBase; + std::string to1 = toDir + targetName; + + filesFrom.push_back(from1); + filesTo.push_back(to1); + } else { bool haveNamelink = false; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 10137ec..27ce999 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -893,9 +893,12 @@ cmMakefile::AddCustomCommandToTarget(const char* target, { cmake::MessageType messageType = cmake::AUTHOR_WARNING; bool issueMessage = false; + cmOStringStream e; switch(this->GetPolicyStatus(cmPolicies::CMP0040)) { case cmPolicies::WARN: + e << (this->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0040)) << "\n"; issueMessage = true; case cmPolicies::OLD: break; @@ -908,9 +911,6 @@ cmMakefile::AddCustomCommandToTarget(const char* target, if(issueMessage) { - cmOStringStream e; - e << (this->GetPolicies() - ->GetPolicyWarning(cmPolicies::CMP0040)) << "\n"; e << "The target name \"" << target << "\" is unknown in this context."; IssueMessage(messageType, e.str().c_str()); } @@ -4350,6 +4350,22 @@ cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const return this->GetPolicies()->GetPolicyStatus(id); } +//---------------------------------------------------------------------------- +bool cmMakefile::PolicyOptionalWarningEnabled(std::string const& var) +{ + // Check for an explicit CMAKE_POLICY_WARNING_CMP<NNNN> setting. + if(!var.empty()) + { + if(const char* val = this->GetDefinition(var.c_str())) + { + return cmSystemTools::IsOn(val); + } + } + // Enable optional policy warnings with --debug-output or --trace. + cmake* cm = this->GetCMakeInstance(); + return cm->GetDebugOutput() || cm->GetTrace(); +} + bool cmMakefile::SetPolicy(const char *id, cmPolicies::PolicyStatus status) { diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 45f3b9f..f00fd20 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -875,6 +875,8 @@ public: std::set<cmStdString> const & GetSystemIncludeDirectories() const { return this->SystemIncludeDirectories; } + bool PolicyOptionalWarningEnabled(std::string const& var); + protected: // add link libraries and directories to the target void AddGlobalLinkInformation(const char* name, cmTarget& target); diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 900af8d..3220fba 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -369,8 +369,10 @@ cmNinjaTargetGenerator const std::string cId = mf->GetDefinition("CMAKE_C_COMPILER_ID") ? mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") : mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID"); - - const bool usingMSVC = (cId == "MSVC" || cId == "Intel"); + const std::string sId = mf->GetDefinition("CMAKE_C_SIMULATE_ID") + ? mf->GetSafeDefinition("CMAKE_C_SIMULATE_ID") + : mf->GetSafeDefinition("CMAKE_CXX_SIMULATE_ID"); + const bool usingMSVC = (cId == "MSVC" || sId == "MSVC"); // Tell ninja dependency format so all deps can be loaded into a database std::string deptype; diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx index 9a340dc..448d77c 100644 --- a/Source/cmOSXBundleGenerator.cxx +++ b/Source/cmOSXBundleGenerator.cxx @@ -178,7 +178,7 @@ void cmOSXBundleGenerator::CreateCFBundle(const std::string& targetName, // Configure the Info.plist file. Note that it needs the executable name // to be set. - std::string plist = + std::string plist = root + "/" + this->Target->GetCFBundleDirectory(this->ConfigName, true); plist += "/Info.plist"; this->LocalGenerator->GenerateAppleInfoPList(this->Target, diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index ff05975..575b973 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -917,8 +917,10 @@ bool cmSystemTools::RenameFile(const char* oldname, const char* newname) cmsys::Encoding::ToWide(newname).c_str(), MOVEFILE_REPLACE_EXISTING) && --retry.Count) { - // Try again only if failure was due to access permissions. - if(GetLastError() != ERROR_ACCESS_DENIED) + DWORD last_error = GetLastError(); + // Try again only if failure was due to access/sharing permissions. + if(last_error != ERROR_ACCESS_DENIED && + last_error != ERROR_SHARING_VIOLATION) { return false; } @@ -2161,6 +2163,11 @@ void cmSystemTools::FindCMakeResources(const char* argv0) cmSystemToolsCMakeCommand = exe_dir; cmSystemToolsCMakeCommand += "/cmake"; cmSystemToolsCMakeCommand += cmSystemTools::GetExecutableExtension(); +#ifndef CMAKE_BUILD_WITH_CMAKE + // The bootstrap cmake does not provide the other tools, + // so use the directory where they are about to be built. + exe_dir = CMAKE_BOOTSTRAP_BINARY_DIR "/bin"; +#endif cmSystemToolsCTestCommand = exe_dir; cmSystemToolsCTestCommand += "/ctest"; cmSystemToolsCTestCommand += cmSystemTools::GetExecutableExtension(); @@ -2213,7 +2220,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0) } #else // Bootstrap build knows its source. - cmSystemToolsCMakeRoot = CMAKE_ROOT_DIR; + cmSystemToolsCMakeRoot = CMAKE_BOOTSTRAP_SOURCE_DIR; #endif } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 0c89656..63c5908 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2624,23 +2624,20 @@ const char* cmTarget::GetFeature(const char* feature, const char* config) const } //---------------------------------------------------------------------------- -const char *cmTarget::GetProperty(const char* prop) const -{ - return this->GetProperty(prop, cmProperty::TARGET); -} - -//---------------------------------------------------------------------------- -bool cmTarget::HandleLocationPropertyPolicy() const +bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const { if (this->IsImported()) { return true; } + cmOStringStream e; const char *modal = 0; cmake::MessageType messageType = cmake::AUTHOR_WARNING; - switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0026)) + switch (context->GetPolicyStatus(cmPolicies::CMP0026)) { case cmPolicies::WARN: + e << (this->Makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0026)) << "\n"; modal = "should"; case cmPolicies::OLD: break; @@ -2653,22 +2650,25 @@ bool cmTarget::HandleLocationPropertyPolicy() const if (modal) { - cmOStringStream e; - e << (this->Makefile->GetPolicies() - ->GetPolicyWarning(cmPolicies::CMP0026)) << "\n"; e << "The LOCATION property " << modal << " not be read from target \"" << this->GetName() << "\". Use the target name directly with " "add_custom_command, or use the generator expression $<TARGET_FILE>, " "as appropriate.\n"; - this->Makefile->IssueMessage(messageType, e.str().c_str()); + context->IssueMessage(messageType, e.str().c_str()); } return messageType != cmake::FATAL_ERROR; } //---------------------------------------------------------------------------- +const char *cmTarget::GetProperty(const char* prop) const +{ + return this->GetProperty(prop, this->Makefile); +} + +//---------------------------------------------------------------------------- const char *cmTarget::GetProperty(const char* prop, - cmProperty::ScopeType scope) const + cmMakefile* context) const { if(!prop) { @@ -2681,7 +2681,7 @@ const char *cmTarget::GetProperty(const char* prop, cmOStringStream e; e << "INTERFACE_LIBRARY targets may only have whitelisted properties. " "The property \"" << prop << "\" is not allowed."; - this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); + context->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); return 0; } @@ -2700,7 +2700,7 @@ const char *cmTarget::GetProperty(const char* prop, { if(strcmp(prop,"LOCATION") == 0) { - if (!this->HandleLocationPropertyPolicy()) + if (!this->HandleLocationPropertyPolicy(context)) { return 0; } @@ -2721,7 +2721,7 @@ const char *cmTarget::GetProperty(const char* prop, // Support "LOCATION_<CONFIG>". if(cmHasLiteralPrefix(prop, "LOCATION_")) { - if (!this->HandleLocationPropertyPolicy()) + if (!this->HandleLocationPropertyPolicy(context)) { return 0; } @@ -2736,7 +2736,7 @@ const char *cmTarget::GetProperty(const char* prop, std::string configName(prop, strlen(prop) - 9); if(configName != "IMPORTED") { - if (!this->HandleLocationPropertyPolicy()) + if (!this->HandleLocationPropertyPolicy(context)) { return 0; } @@ -2857,10 +2857,10 @@ const char *cmTarget::GetProperty(const char* prop, } bool chain = false; const char *retVal = - this->Properties.GetPropertyValue(prop, scope, chain); + this->Properties.GetPropertyValue(prop, cmProperty::TARGET, chain); if (chain) { - return this->Makefile->GetProperty(prop,scope); + return this->Makefile->GetProperty(prop, cmProperty::TARGET); } return retVal; } @@ -5515,11 +5515,6 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface, } } } - if(this->LinkLanguagePropagatesToDependents()) - { - // Targets using this archive need its language runtime libraries. - iface.Languages = impl->Languages; - } } } } @@ -5536,11 +5531,6 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface, iface.ImplementationIsInterface = true; iface.Libraries = impl->Libraries; iface.WrongConfigLibraries = impl->WrongConfigLibraries; - if(this->LinkLanguagePropagatesToDependents()) - { - // Targets using this archive need its language runtime libraries. - iface.Languages = impl->Languages; - } if(this->PolicyStatusCMP0022 == cmPolicies::WARN && !this->Internal->PolicyWarnedCMP0022) @@ -5607,6 +5597,16 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface, } } + if(this->LinkLanguagePropagatesToDependents()) + { + // Targets using this archive need its language runtime libraries. + if(LinkImplementation const* impl = + this->GetLinkImplementation(config, headTarget)) + { + iface.Languages = impl->Languages; + } + } + if(this->GetType() == cmTarget::STATIC_LIBRARY) { // How many repetitions are needed if this library has cyclic diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 0e9d682..a305caa 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -257,7 +257,7 @@ public: void SetProperty(const char *prop, const char *value); void AppendProperty(const char* prop, const char* value,bool asString=false); const char *GetProperty(const char *prop) const; - const char *GetProperty(const char *prop, cmProperty::ScopeType scope) const; + const char *GetProperty(const char *prop, cmMakefile* context) const; bool GetPropertyAsBool(const char *prop) const; void CheckProperty(const char* prop, cmMakefile* context) const; @@ -580,7 +580,7 @@ public: const std::string &compatibilityType) const; private: - bool HandleLocationPropertyPolicy() const; + bool HandleLocationPropertyPolicy(cmMakefile* context) const; // The set of include directories that are marked as system include // directories. diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 02da933..95a2cba 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -103,11 +103,14 @@ bool cmTargetLinkLibrariesCommand if (this->Target->GetType() == cmTarget::UTILITY) { + cmOStringStream e; const char *modal = 0; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0039)) { case cmPolicies::WARN: + e << this->Makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0039) << "\n"; modal = "should"; case cmPolicies::OLD: break; @@ -119,9 +122,7 @@ bool cmTargetLinkLibrariesCommand } if (modal) { - cmOStringStream e; - e << this->Makefile->GetPolicies() - ->GetPolicyWarning(cmPolicies::CMP0039) << "\n" + e << "Utility target \"" << this->Target->GetName() << "\" " << modal << " not be used as the target of a target_link_libraries call."; this->Makefile->IssueMessage(messageType, e.str().c_str()); @@ -373,11 +374,14 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib, ? cmTarget::KeywordTLLSignature : cmTarget::PlainTLLSignature; if (!this->Target->PushTLLCommandTrace(sig)) { + cmOStringStream e; const char *modal = 0; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0023)) { case cmPolicies::WARN: + e << this->Makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0023) << "\n"; modal = "should"; case cmPolicies::OLD: break; @@ -390,14 +394,12 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib, if(modal) { - cmOStringStream e; // If the sig is a keyword form and there is a conflict, the existing // form must be the plain form. const char *existingSig = (sig == cmTarget::KeywordTLLSignature ? "plain" : "keyword"); - e << this->Makefile->GetPolicies() - ->GetPolicyWarning(cmPolicies::CMP0023) << "\n" + e << "The " << existingSig << " signature for target_link_libraries " "has already been used with the target \"" << this->Target->GetName() << "\". All uses of " diff --git a/Source/cmVS10LinkFlagTable.h b/Source/cmVS10LinkFlagTable.h index 5d15620..f6b758d 100644 --- a/Source/cmVS10LinkFlagTable.h +++ b/Source/cmVS10LinkFlagTable.h @@ -191,10 +191,7 @@ static cmVS7FlagTable cmVS10LinkFlagTable[] = {"LinkDLL", "DLL", "", "true", 0}, //Bool Properties With Argument - {"EnableUAC", "MANIFESTUAC:NO", "", "false", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue}, - {"EnableUAC", "MANIFESTUAC:NO", "Enable User Account Control (UAC)", "", - cmVS7FlagTable::UserValueRequired}, + {"EnableUAC", "MANIFESTUAC:NO", "", "false", 0}, {"EnableUAC", "MANIFESTUAC:", "", "true", cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue}, {"UACUIAccess", "MANIFESTUAC:", "Enable User Account Control (UAC)", "", diff --git a/Source/cmVS11LinkFlagTable.h b/Source/cmVS11LinkFlagTable.h index b4587a8..0f641e4 100644 --- a/Source/cmVS11LinkFlagTable.h +++ b/Source/cmVS11LinkFlagTable.h @@ -217,10 +217,7 @@ static cmVS7FlagTable cmVS11LinkFlagTable[] = {"LinkDLL", "DLL", "", "true", 0}, //Bool Properties With Argument - {"EnableUAC", "MANIFESTUAC:NO", "", "false", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue}, - {"EnableUAC", "MANIFESTUAC:NO", "Enable User Account Control (UAC)", "", - cmVS7FlagTable::UserValueRequired}, + {"EnableUAC", "MANIFESTUAC:NO", "", "false", 0}, {"EnableUAC", "MANIFESTUAC:", "", "true", cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue}, {"UACUIAccess", "MANIFESTUAC:", "Enable User Account Control (UAC)", "", diff --git a/Source/cmVS12LinkFlagTable.h b/Source/cmVS12LinkFlagTable.h index 73d450a..e5a570e 100644 --- a/Source/cmVS12LinkFlagTable.h +++ b/Source/cmVS12LinkFlagTable.h @@ -217,10 +217,7 @@ static cmVS7FlagTable cmVS12LinkFlagTable[] = {"LinkDLL", "DLL", "", "true", 0}, //Bool Properties With Argument - {"EnableUAC", "MANIFESTUAC:NO", "", "false", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue}, - {"EnableUAC", "MANIFESTUAC:NO", "Enable User Account Control (UAC)", "", - cmVS7FlagTable::UserValueRequired}, + {"EnableUAC", "MANIFESTUAC:NO", "", "false", 0}, {"EnableUAC", "MANIFESTUAC:", "", "true", cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue}, {"UACUIAccess", "MANIFESTUAC:", "Enable User Account Control (UAC)", "", diff --git a/Source/cmake.cxx b/Source/cmake.cxx index abbabe7..fafcca8 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -339,16 +339,24 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args) // The value is transformed if it is a filepath for example, so // we can't compare whether the value is already in the cache until // after we call AddCacheEntry. - const char *cachedValue = - this->CacheManager->GetCacheValue(var.c_str()); + bool haveValue = false; + std::string cachedValue; + if(this->WarnUnusedCli) + { + if(const char *v = this->CacheManager->GetCacheValue(var.c_str())) + { + haveValue = true; + cachedValue = v; + } + } this->CacheManager->AddCacheEntry(var.c_str(), value.c_str(), "No help, variable specified on the command line.", type); + if(this->WarnUnusedCli) { - if (!cachedValue - || strcmp(this->CacheManager->GetCacheValue(var.c_str()), - cachedValue) != 0) + if (!haveValue || + cachedValue != this->CacheManager->GetCacheValue(var.c_str())) { this->WatchUnusedCli(var.c_str()); } @@ -1231,7 +1239,10 @@ int cmake::HandleDeleteCacheVariables(const char* var) if(ci.Find(save.key.c_str())) { save.type = ci.GetType(); - save.help = ci.GetProperty("HELPSTRING"); + if(const char* help = ci.GetProperty("HELPSTRING")) + { + save.help = help; + } } saved.push_back(save); } @@ -2664,11 +2675,17 @@ int cmake::Build(const std::string& dir, } if(!it.Find("CMAKE_GENERATOR")) { - std::cerr << "Error: could find generator in Cache\n"; + std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n"; return 1; } cmsys::auto_ptr<cmGlobalGenerator> gen( this->CreateGlobalGenerator(it.GetValue())); + if(!gen.get()) + { + std::cerr << "Error: could create CMAKE_GENERATOR \"" + << it.GetValue() << "\"\n"; + return 1; + } std::string output; std::string projName; if(!it.Find("CMAKE_PROJECT_NAME")) diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 3eb5551..b6b3d31 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -44,7 +44,8 @@ static const char * cmDocumentationOptions[][2] = {"-V,--verbose", "Enable verbose output from tests."}, {"-VV,--extra-verbose", "Enable more verbose output from tests."}, {"--debug", "Displaying more verbose internals of CTest."}, - {"--output-on-failure"}, + {"--output-on-failure", "Output anything outputted by the test program " + "if the test should fail."}, {"-F", "Enable failover."}, {"-j <jobs>, --parallel <jobs>", "Run the tests in parallel using the" "given number of jobs."}, diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c index faeb967..241e295 100644 --- a/Source/kwsys/ProcessUNIX.c +++ b/Source/kwsys/ProcessUNIX.c @@ -2413,6 +2413,12 @@ static void kwsysProcessKill(pid_t process_id) /* Suspend the process to be sure it will not create more children. */ kill(process_id, SIGSTOP); +#if defined(__CYGWIN__) + /* Some Cygwin versions seem to need help here. Give up our time slice + so that the child can process SIGSTOP before we send SIGKILL. */ + usleep(1); +#endif + /* Kill all children if we can find them. */ #if defined(__linux__) || defined(__CYGWIN__) /* First try using the /proc filesystem. */ diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 5f20853..a03b39c 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -88,15 +88,6 @@ typedef int siginfo_t; # include <ifaddrs.h> # define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN # endif -# if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE) -# include <execinfo.h> -# if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE) -# include <cxxabi.h> -# endif -# if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP) -# include <dlfcn.h> -# endif -# endif #endif #if defined(__OpenBSD__) || defined(__NetBSD__) @@ -126,16 +117,8 @@ typedef int siginfo_t; # include <ifaddrs.h> # define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN # endif -# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 >= 1050 -# if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE) -# include <execinfo.h> -# if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE) -# include <cxxabi.h> -# endif -# if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP) -# include <dlfcn.h> -# endif -# endif +# if !(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 >= 1050) +# undef KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE # endif #endif @@ -150,15 +133,6 @@ typedef int siginfo_t; # define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN # endif # endif -# if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE) -# include <execinfo.h> -# if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE) -# include <cxxabi.h> -# endif -# if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP) -# include <dlfcn.h> -# endif -# endif # if defined(KWSYS_CXX_HAS_RLIMIT64) typedef struct rlimit64 ResourceLimitType; # define GetResourceLimit getrlimit64 @@ -178,6 +152,19 @@ typedef struct rlimit ResourceLimitType; # include <OS.h> #endif +#if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE) +# include <execinfo.h> +# if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE) +# include <cxxabi.h> +# endif +# if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP) +# include <dlfcn.h> +# endif +#else +# undef KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE +# undef KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP +#endif + #include <memory.h> #include <stdlib.h> #include <stdio.h> @@ -3709,7 +3696,10 @@ void SystemInformationImplementation::SetStackTraceOnError(int enable) // install ours struct sigaction sa; sa.sa_sigaction=(SigAction)StacktraceSignalHandler; - sa.sa_flags=SA_SIGINFO|SA_RESTART|SA_RESETHAND; + sa.sa_flags=SA_SIGINFO|SA_RESETHAND; +# ifdef SA_RESTART + sa.sa_flags|=SA_RESTART; +# endif sigemptyset(&sa.sa_mask); sigaction(SIGABRT,&sa,0); diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index f4a443f..e5d8bde 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -92,7 +92,7 @@ extern char **environ; #endif #ifdef __CYGWIN__ -extern "C" void cygwin_conv_to_win32_path(const char *path, char *win32_path); +# include <sys/cygwin.h> #endif // getpwnam doesn't exist on Windows and Cray Xt3/Catamount @@ -1110,7 +1110,10 @@ bool SystemTools::PathCygwinToWin32(const char *path, char *win32_path) } else { - cygwin_conv_to_win32_path(path, win32_path); + if(cygwin_conv_path(CCP_POSIX_TO_WIN_A, path, win32_path, MAX_PATH) != 0) + { + win32_path[0] = 0; + } SystemToolsTranslationMap::value_type entry(path, win32_path); SystemTools::Cyg2Win32Map->insert(entry); } diff --git a/Templates/TestDriver.cxx.in b/Templates/TestDriver.cxx.in index 82537ef..0e0a872 100644 --- a/Templates/TestDriver.cxx.in +++ b/Templates/TestDriver.cxx.in @@ -58,7 +58,7 @@ static char* lowercase(const char *string) int main(int ac, char *av[]) { - int i, NumTests, testNum, partial_match; + int i, NumTests, testNum = 0, partial_match; char *arg, *test_name; int count; int testToRun = -1; @@ -81,7 +81,6 @@ int main(int ac, char *av[]) } printf("To run a test, enter the test number: "); fflush(stdout); - testNum = 0; if( scanf("%d", &testNum) != 1 ) { printf("Couldn't parse that input as a number\n"); diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 8074a01..c903103 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2245,6 +2245,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ PASS_REGULAR_EXPRESSION "${CTestTestBadExe_REGEX}") configure_file( + "${CMake_SOURCE_DIR}/Tests/CTestTestBadGenerator/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestTestBadGenerator/test.cmake" + @ONLY ESCAPE_QUOTES) + add_test(CTestTestBadGenerator ${CMAKE_CTEST_COMMAND} + -C "\${CTestTest_CONFIG}" + -S "${CMake_BINARY_DIR}/Tests/CTestTestBadGenerator/test.cmake" -V + --output-log "${CMake_BINARY_DIR}/Tests/CTestTestBadGenerator/testOutput.log" + ) + set_property(TEST CTestTestBadGenerator PROPERTY + PASS_REGULAR_EXPRESSION "could not create generator named \"Bad Generator\"") + + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestParallel/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestParallel/test.cmake" @ONLY ESCAPE_QUOTES) diff --git a/Tests/CTestTestBadGenerator/CMakeLists.txt b/Tests/CTestTestBadGenerator/CMakeLists.txt new file mode 100644 index 0000000..d46d9bf --- /dev/null +++ b/Tests/CTestTestBadGenerator/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(CTestTestDepends NONE) +include(CTest) diff --git a/Tests/CTestTestBadGenerator/CTestConfig.cmake b/Tests/CTestTestBadGenerator/CTestConfig.cmake new file mode 100644 index 0000000..ef98189 --- /dev/null +++ b/Tests/CTestTestBadGenerator/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestBadGenerator") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestBadGenerator/test.cmake.in b/Tests/CTestTestBadGenerator/test.cmake.in new file mode 100644 index 0000000..fe4fba8 --- /dev/null +++ b/Tests/CTestTestBadGenerator/test.cmake.in @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.0) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Depends") + +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestBadGenerator") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestBadGenerator") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "Bad Generator") +set(CTEST_CMAKE_GENERATOR_TOOLSET "") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index adc4308..7918129 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 3.0) project(testf C CXX Fortran) if(NOT DEFINED CMAKE_TEST_MAKEPROGRAM AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") set(CMAKE_TEST_MAKEPROGRAM "${CMAKE_MAKE_PROGRAM}") diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt index 07982bd..05b0217 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt @@ -1,8 +1,4 @@ CMake Error at CMP0026-CONFIG-LOCATION-NEW.cmake:7 \(get_target_property\): - Policy CMP0026 is not set: Disallow use of the LOCATION target property. - Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. - The LOCATION property may not be read from target "somelib". Use the target name directly with add_custom_command, or use the generator expression \$<TARGET_FILE>, as appropriate. diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt index 0e90f96..fec9dfb 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt @@ -1,8 +1,4 @@ CMake Error at CMP0026-LOCATION-CONFIG-NEW.cmake:7 \(get_target_property\): - Policy CMP0026 is not set: Disallow use of the LOCATION target property. - Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. - The LOCATION property may not be read from target "somelib". Use the target name directly with add_custom_command, or use the generator expression \$<TARGET_FILE>, as appropriate. diff --git a/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt index 2a05a4d..fa02512 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt @@ -1,8 +1,4 @@ CMake Error at CMP0026-NEW.cmake:7 \(get_target_property\): - Policy CMP0026 is not set: Disallow use of the LOCATION target property. - Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. - The LOCATION property may not be read from target "somelib". Use the target name directly with add_custom_command, or use the generator expression \$<TARGET_FILE>, as appropriate. diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN-Dir/CMakeLists.txt b/Tests/RunCMake/CMP0026/CMP0026-WARN-Dir/CMakeLists.txt new file mode 100644 index 0000000..17a7db0 --- /dev/null +++ b/Tests/RunCMake/CMP0026/CMP0026-WARN-Dir/CMakeLists.txt @@ -0,0 +1 @@ +add_library(otherlib ../empty.cpp) diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt index 9b88194..d122c4a 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt @@ -10,3 +10,16 @@ CMake Warning \(dev\) at CMP0026-WARN.cmake:5 \(get_target_property\): Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at CMP0026-WARN.cmake:8 \(get_target_property\): + Policy CMP0026 is not set: Disallow use of the LOCATION target property. + Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy + command to set the policy and suppress this warning. + + The LOCATION property should not be read from target "otherlib". Use the + target name directly with add_custom_command, or use the generator + expression \$<TARGET_FILE>, as appropriate. + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake b/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake index 89c5a8a..bfc9203 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake +++ b/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake @@ -3,3 +3,6 @@ enable_language(CXX) add_library(somelib empty.cpp) get_target_property(_loc somelib LOCATION) + +add_subdirectory(CMP0026-WARN-Dir) +get_target_property(_loc otherlib LOCATION) diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt index 9d2c35b..ec2315f 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt +++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt @@ -1,9 +1,4 @@ CMake Error at CMP0037-NEW-colon.cmake:4 \(add_library\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "lib:colon" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. @@ -11,11 +6,6 @@ Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + CMake Error at CMP0037-NEW-colon.cmake:5 \(add_executable\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "exe:colon" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. @@ -23,11 +13,6 @@ Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + CMake Error at CMP0037-NEW-colon.cmake:6 \(add_custom_target\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "custom:colon" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt index 13835af..5789e38 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt +++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt @@ -1,20 +1,10 @@ CMake Error at CMP0037-NEW-reserved.cmake:4 \(add_library\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "all" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + CMake Error at CMP0037-NEW-reserved.cmake:5 \(add_executable\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "clean" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. @@ -22,11 +12,6 @@ Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + CMake Error at CMP0037-NEW-reserved.cmake:6 \(add_custom_target\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "help" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. Call Stack \(most recent call first\): diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt index 2525bcd..e14cec0 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt +++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt @@ -1,9 +1,4 @@ CMake Error at CMP0037-NEW-space.cmake:4 \(add_library\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "lib with spaces" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. @@ -11,11 +6,6 @@ Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + CMake Error at CMP0037-NEW-space.cmake:5 \(add_executable\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "exe with spaces" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. @@ -23,11 +13,6 @@ Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + CMake Error at CMP0037-NEW-space.cmake:6 \(add_custom_target\): - Policy CMP0037 is not set: Target names should not be reserved and should - match a validity pattern. Run "cmake --help-policy CMP0037" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The target name "custom with spaces" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. diff --git a/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt b/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt index 821c4f8..3d9d225 100644 --- a/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt @@ -1,8 +1,4 @@ CMake Error at CMP0039-NEW.cmake:7 \(target_link_libraries\): - Policy CMP0039 is not set: Utility targets may not have link dependencies. - Run "cmake --help-policy CMP0039" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. - Utility target "utility" must not be used as the target of a target_link_libraries call. Call Stack \(most recent call first\): diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt index 03a0217..3f82d8c 100644 --- a/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt +++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt @@ -1,9 +1,4 @@ CMake Error at CMP0040-NEW-missing-target.cmake:3 \(add_custom_command\): - Policy CMP0040 is not set: The target in the TARGET signature of - add_custom_command\(\) must exist. Run "cmake --help-policy CMP0040" for - policy details. Use the cmake_policy command to set the policy and - suppress this warning. -+ The target name "foobar" is unknown in this context. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency-stderr.txt b/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency-stderr.txt index 0c23c43..381647f 100644 --- a/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency-stderr.txt +++ b/Tests/RunCMake/CMP0046/CMP0046-NEW-missing-dependency-stderr.txt @@ -1,8 +1,4 @@ CMake Error at CMP0046-NEW-missing-dependency.cmake:4 \(add_dependencies\): - Policy CMP0046 is not set: Error on non-existent dependency in - add_dependencies. Run "cmake --help-policy CMP0046" for policy details. - Use the cmake_policy command to set the policy and suppress this warning. -+ The dependency target "bar" of target "foo" does not exist. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index ada4cab..3aaeac0 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1,5 +1,12 @@ include(RunCMake) +run_cmake_command(build-no-cache + ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) +run_cmake_command(build-no-generator + ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-no-generator) +run_cmake_command(build-bad-generator + ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-bad-generator) + if(UNIX) run_cmake_command(E_create_symlink-missing-dir ${CMAKE_COMMAND} -E create_symlink T missing-dir/L diff --git a/Tests/RunCMake/CommandLine/build-bad-generator-result.txt b/Tests/RunCMake/CommandLine/build-bad-generator-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-bad-generator-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/build-bad-generator-stderr.txt b/Tests/RunCMake/CommandLine/build-bad-generator-stderr.txt new file mode 100644 index 0000000..1103407 --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-bad-generator-stderr.txt @@ -0,0 +1 @@ +^Error: could create CMAKE_GENERATOR "Bad Generator"$ diff --git a/Tests/RunCMake/CommandLine/build-no-cache-result.txt b/Tests/RunCMake/CommandLine/build-no-cache-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-no-cache-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt b/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt new file mode 100644 index 0000000..40dd3c0 --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt @@ -0,0 +1 @@ +^Error: could not load cache$ diff --git a/Tests/RunCMake/CommandLine/build-no-generator-result.txt b/Tests/RunCMake/CommandLine/build-no-generator-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-no-generator-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/build-no-generator-stderr.txt b/Tests/RunCMake/CommandLine/build-no-generator-stderr.txt new file mode 100644 index 0000000..40ad030 --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-no-generator-stderr.txt @@ -0,0 +1 @@ +^Error: could not find CMAKE_GENERATOR in Cache$ diff --git a/Tests/RunCMake/CommandLine/cache-bad-generator/CMakeCache.txt b/Tests/RunCMake/CommandLine/cache-bad-generator/CMakeCache.txt new file mode 100644 index 0000000..e34af44 --- /dev/null +++ b/Tests/RunCMake/CommandLine/cache-bad-generator/CMakeCache.txt @@ -0,0 +1 @@ +CMAKE_GENERATOR:INTERNAL=Bad Generator diff --git a/Tests/RunCMake/CommandLine/cache-no-generator/CMakeCache.txt b/Tests/RunCMake/CommandLine/cache-no-generator/CMakeCache.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/cache-no-generator/CMakeCache.txt diff --git a/Tests/RunCMake/include/CMP0024-NEW-stderr.txt b/Tests/RunCMake/include/CMP0024-NEW-stderr.txt index 059d7e4..0fdb3ca 100644 --- a/Tests/RunCMake/include/CMP0024-NEW-stderr.txt +++ b/Tests/RunCMake/include/CMP0024-NEW-stderr.txt @@ -1,8 +1,4 @@ CMake Error at subdir2/CMakeLists.txt:2 \(include\): - Policy CMP0024 is not set: Disallow include export result. Run "cmake - --help-policy CMP0024" for policy details. Use the cmake_policy command to - set the policy and suppress this warning. - The file .*/Tests/RunCMake/include/CMP0024-NEW-build/subdir1/theTargets.cmake diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt index d27686d..8e3f315 100644 --- a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt +++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt @@ -1,9 +1,4 @@ CMake Error at CMP0023-NEW-2.cmake:11 \(target_link_libraries\): - Policy CMP0023 is not set: Plain and keyword target_link_libraries - signatures cannot be mixed. Run "cmake --help-policy CMP0023" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The plain signature for target_link_libraries has already been used with the target "foo". All uses of target_link_libraries with a target must be either all-keyword or all-plain. diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt index d7be0ff..2ef2290 100644 --- a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt +++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt @@ -1,9 +1,4 @@ CMake Error at CMP0023-NEW.cmake:11 \(target_link_libraries\): - Policy CMP0023 is not set: Plain and keyword target_link_libraries - signatures cannot be mixed. Run "cmake --help-policy CMP0023" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - The plain signature for target_link_libraries has already been used with the target "foo". All uses of target_link_libraries with a target must be either all-keyword or all-plain. diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index 23dc6ae..5e3e04b 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -24,6 +24,7 @@ project(CMakeHelp NONE) option(SPHINX_MAN "Build man pages with Sphinx" OFF) option(SPHINX_HTML "Build html help with Sphinx" OFF) +option(SPHINX_SINGLEHTML "Build html single page help with Sphinx" OFF) option(SPHINX_TEXT "Build text help with Sphinx (not installed)" OFF) find_program(SPHINX_EXECUTABLE NAMES sphinx-build @@ -32,7 +33,7 @@ find_program(SPHINX_EXECUTABLE mark_as_advanced(SPHINX_TEXT) -if(NOT SPHINX_MAN AND NOT SPHINX_HTML AND NOT SPHINX_TEXT) +if(NOT SPHINX_MAN AND NOT SPHINX_HTML AND NOT SPHINX_SINGLEHTML AND NOT SPHINX_TEXT) return() elseif(NOT SPHINX_EXECUTABLE) message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!") @@ -60,6 +61,9 @@ endif() if(SPHINX_MAN) list(APPEND doc_formats man) endif() +if(SPHINX_SINGLEHTML) + list(APPEND doc_formats singlehtml) +endif() if(SPHINX_TEXT) list(APPEND doc_formats text) endif() @@ -122,3 +126,11 @@ if(SPHINX_HTML) PATTERN objects.inv EXCLUDE ) endif() + +if(SPHINX_SINGLEHTML) + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/singlehtml + DESTINATION ${CMAKE_DOC_DIR} + PATTERN .buildinfo EXCLUDE + PATTERN objects.inv EXCLUDE + ) +endif() diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py index 336c74a..0e8f280 100644 --- a/Utilities/Sphinx/cmake.py +++ b/Utilities/Sphinx/cmake.py @@ -62,12 +62,12 @@ class CMakeModule(Directive): settings.record_dependencies.add(path) f = io.FileInput(source_path=path, encoding=encoding, error_handler=e_handler) - except UnicodeEncodeError, error: + except UnicodeEncodeError as error: raise self.severe('Problems with "%s" directive path:\n' 'Cannot encode input file path "%s" ' '(wrong locale?).' % (self.name, SafeString(path))) - except IOError, error: + except IOError as error: raise self.severe('Problems with "%s" directive path:\n%s.' % (self.name, ErrorString(error))) raw_lines = f.read().splitlines() @@ -290,9 +290,12 @@ class CMakeDomain(Domain): } def clear_doc(self, docname): + to_clear = set() for fullname, (fn, _) in self.data['objects'].items(): if fn == docname: - del self.data['objects'][fullname] + to_clear.add(fullname) + for fullname in to_clear: + del self.data['objects'][fullname] def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode): @@ -305,7 +308,7 @@ class CMakeDomain(Domain): contnode, target) def get_objects(self): - for refname, (docname, type) in self.data['objects'].iteritems(): + for refname, (docname, type) in self.data['objects'].items(): yield (refname, refname, type, docname, refname, 1) def setup(app): diff --git a/Utilities/Sphinx/conf.py.in b/Utilities/Sphinx/conf.py.in index ef622fd..e334389 100644 --- a/Utilities/Sphinx/conf.py.in +++ b/Utilities/Sphinx/conf.py.in @@ -50,7 +50,7 @@ for fpath in cmake_manuals: name, desc, [], int(sec))) else: sys.stderr.write("ERROR: No cmake-manual-description in '%s'\n" % fpath) - except Exception, e: + except Exception as e: sys.stderr.write("ERROR: %s\n" % str(e)) man_show_urls = False diff --git a/Utilities/cmcurl/hostip.c b/Utilities/cmcurl/hostip.c index fd555ef..83f1564 100644 --- a/Utilities/cmcurl/hostip.c +++ b/Utilities/cmcurl/hostip.c @@ -609,7 +609,7 @@ Curl_addrinfo *Curl_ip2addr(in_addr_t num, const char *hostname, int port) h = &buf->hostentry; h->h_addr_list = &buf->h_addr_list[0]; addrentry = &buf->addrentry; -#ifdef _CRAYC +#ifdef _CRAY /* On UNICOS, s_addr is a bit field and for some reason assigning to it * doesn't work. There must be a better fix than this ugly hack. */ diff --git a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c index b69c873..bca2e35 100644 --- a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c +++ b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c @@ -2861,7 +2861,7 @@ set_time(int fd, int mode, const char *name, #endif } -#ifdef F_SETTIMES /* Tru64 */ +#ifdef F_SETTIMES static int set_time_tru64(int fd, int mode, const char *name, time_t atime, long atime_nsec, @@ -2869,19 +2869,21 @@ set_time_tru64(int fd, int mode, const char *name, time_t ctime, long ctime_nsec) { struct attr_timbuf tstamp; - struct timeval times[3]; - times[0].tv_sec = atime; - times[0].tv_usec = atime_nsec / 1000; - times[1].tv_sec = mtime; - times[1].tv_usec = mtime_nsec / 1000; - times[2].tv_sec = ctime; - times[2].tv_usec = ctime_nsec / 1000; - tstamp.atime = times[0]; - tstamp.mtime = times[1]; - tstamp.ctime = times[2]; + tstamp.atime.tv_sec = atime; + tstamp.mtime.tv_sec = mtime; + tstamp.ctime.tv_sec = ctime; +#if defined (__hpux) && defined (__ia64) + tstamp.atime.tv_nsec = atime_nsec; + tstamp.mtime.tv_nsec = mtime_nsec; + tstamp.ctime.tv_nsec = ctime_nsec; +#else + tstamp.atime.tv_usec = atime_nsec / 1000; + tstamp.mtime.tv_usec = mtime_nsec / 1000; + tstamp.ctime.tv_usec = ctime_nsec / 1000; +#endif return (fcntl(fd,F_SETTIMES,&tstamp)); } -#endif /* Tru64 */ +#endif /* F_SETTIMES */ static int set_times(struct archive_write_disk *a, @@ -1085,8 +1085,8 @@ if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then cmake_test_flags= # If we are on HP-UX, check for -Ae for the C compiler. - cmake_test_flags="-Ae" if [ "x${cmake_system}" = "xHP-UX" ]; then + cmake_test_flags="-Ae" TMPFILE=`cmake_tmp_file` echo ' int main(int argc, char** argv) { (void)argc; (void)argv; return 0; } @@ -1107,6 +1107,29 @@ if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then echo "${cmake_c_compiler} does not need ${cmake_test_flags}" fi rm -f "${TMPFILE}.c" + echo ' + #include <iostream> + int main(int argc, char** argv) { + for(int i=0; i < 1; ++i); + for(int i=0; i < 1; ++i); + (void)argc; (void)argv; return 0; } +' > ${TMPFILE}.cxx + cmake_need_AAstd98=0 + cmake_test_flags="-AA +hpxstd98" + if cmake_try_run "${cmake_cxx_compiler}" "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then + : + else + if cmake_try_run "${cmake_cxx_compiler}" \ + "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then + cmake_need_AAstd98=1 + fi + fi + if [ "x${cmake_need_AAstd98}" = "x1" ]; then + cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}" + echo "${cmake_cxx_compiler} needs ${cmake_test_flags}" + else + echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}" + fi fi cmake_test_flags= fi @@ -1451,9 +1474,11 @@ fi # When bootstrapping on MinGW with MSYS we must convert the source # directory to a windows path. if ${cmake_system_mingw}; then - cmake_root_dir=`cd "${cmake_source_dir}"; pwd -W` + CMAKE_BOOTSTRAP_SOURCE_DIR=`cd "${cmake_source_dir}"; pwd -W` + CMAKE_BOOTSTRAP_BINARY_DIR=`cd "${cmake_binary_dir}"; pwd -W` else - cmake_root_dir="${cmake_source_dir}" + CMAKE_BOOTSTRAP_SOURCE_DIR="${cmake_source_dir}" + CMAKE_BOOTSTRAP_BINARY_DIR="${cmake_binary_dir}" fi # Write CMake version @@ -1461,7 +1486,8 @@ cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MAJOR ${cmake_versi cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MINOR ${cmake_version_minor}" cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_PATCH ${cmake_version_patch}" cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION \"${cmake_version}\"" -cmake_report cmConfigure.h${_tmp} "#define CMAKE_ROOT_DIR \"${cmake_root_dir}\"" +cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_SOURCE_DIR \"${CMAKE_BOOTSTRAP_SOURCE_DIR}\"" +cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_BINARY_DIR \"${CMAKE_BOOTSTRAP_BINARY_DIR}\"" cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\"" cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP" |