diff options
-rw-r--r-- | Docs/bash-completion/cmake | 8 | ||||
-rw-r--r-- | Docs/bash-completion/cpack | 6 | ||||
-rw-r--r-- | Docs/bash-completion/ctest | 2 | ||||
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 6 | ||||
-rw-r--r-- | Modules/FindCUDA.cmake | 17 | ||||
-rw-r--r-- | Modules/FindHDF5.cmake | 38 | ||||
-rw-r--r-- | Modules/FindPNG.cmake | 14 | ||||
-rw-r--r-- | Modules/Platform/Darwin.cmake | 9 | ||||
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 18 | ||||
-rw-r--r-- | Source/cmGeneratorExpression.cxx | 16 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 18 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 13 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 8 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt | 9 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt | 9 | ||||
-rwxr-xr-x | bootstrap | 5 |
16 files changed, 111 insertions, 85 deletions
diff --git a/Docs/bash-completion/cmake b/Docs/bash-completion/cmake index 5f33c09..59e0298 100644 --- a/Docs/bash-completion/cmake +++ b/Docs/bash-completion/cmake @@ -111,12 +111,12 @@ _cmake() ;; --help-command) COMPREPLY=( $( compgen -W '$( cmake --help-command-list 2>/dev/null| - tail -n +2 )' -- "$cur" ) ) + grep -v "^cmake version " )' -- "$cur" ) ) return ;; --help-module) COMPREPLY=( $( compgen -W '$( cmake --help-module-list 2>/dev/null| - tail -n +2 )' -- "$cur" ) ) + grep -v "^cmake version " )' -- "$cur" ) ) return ;; --help-policy) @@ -126,12 +126,12 @@ _cmake() ;; --help-property) COMPREPLY=( $( compgen -W '$( cmake --help-property-list \ - 2>/dev/null | tail -n +2 )' -- "$cur" ) ) + 2>/dev/null | grep -v "^cmake version " )' -- "$cur" ) ) return ;; --help-variable) COMPREPLY=( $( compgen -W '$( cmake --help-variable-list \ - 2>/dev/null | tail -n +2 )' -- "$cur" ) ) + 2>/dev/null | grep -v "^cmake version " )' -- "$cur" ) ) return ;; esac diff --git a/Docs/bash-completion/cpack b/Docs/bash-completion/cpack index 51638c5..9ab6048 100644 --- a/Docs/bash-completion/cpack +++ b/Docs/bash-completion/cpack @@ -20,7 +20,7 @@ _cpack() -D) [[ $cur == *=* ]] && return # no completion for values COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \ - 2>/dev/null | tail -n +2 )' -S = -- "$cur" ) ) + 2>/dev/null | grep -v "^cpack version " )' -S = -- "$cur" ) ) compopt -o nospace return ;; @@ -38,12 +38,12 @@ _cpack() ;; --help-command) COMPREPLY=( $( compgen -W '$( cpack --help-command-list 2>/dev/null| - tail -n +2 )' -- "$cur" ) ) + grep -v "^cpack version " )' -- "$cur" ) ) return ;; --help-variable) COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \ - 2>/dev/null | tail -n +2 )' -- "$cur" ) ) + 2>/dev/null | grep -v "^cpack version " )' -- "$cur" ) ) return ;; esac diff --git a/Docs/bash-completion/ctest b/Docs/bash-completion/ctest index 7433d3d..25cb998 100644 --- a/Docs/bash-completion/ctest +++ b/Docs/bash-completion/ctest @@ -63,7 +63,7 @@ _ctest() ;; --help-command) COMPREPLY=( $( compgen -W '$( ctest --help-command-list 2>/dev/null| - tail -n +2 )' -- "$cur" ) ) + grep -v "^ctest version " )' -- "$cur" ) ) return ;; esac diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index ebd9ce0..8ca5334 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -133,7 +133,11 @@ Id flags: ${testflags} endif() if(CMAKE_VS_WINCE_VERSION) set(id_entrypoint "mainACRTStartup") - set(id_subsystem 9) + if("${vs_version}" VERSION_LESS 9) + set(id_subsystem 9) + else() + set(id_subsystem 8) + endif() else() set(id_subsystem 1) endif() diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 0390ae4..8270ad4 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1292,22 +1292,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) # Make sure the build system knows the file is generated. set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE) - # Don't add the object file to the list of generated files if we are using - # visual studio and we are attaching the build rule to the cuda file. VS - # will add our object file to the linker automatically for us. - set(cuda_add_generated_file TRUE) - - if(NOT compile_to_ptx AND CMAKE_GENERATOR MATCHES "Visual Studio" AND CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE) - # Visual Studio 8 crashes when you close the solution when you don't add the object file. - if(NOT CMAKE_GENERATOR MATCHES "Visual Studio 8") - #message("Not adding ${generated_file}") - set(cuda_add_generated_file FALSE) - endif() - endif() - - if(cuda_add_generated_file) - list(APPEND _cuda_wrap_generated_files ${generated_file}) - endif() + list(APPEND _cuda_wrap_generated_files ${generated_file}) # Add the other files that we want cmake to clean on a cleanup ########## list(APPEND CUDA_ADDITIONAL_CLEAN_FILES "${cmake_dependency_file}") diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 8514164..0c246a1 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -289,27 +289,13 @@ if( NOT HDF5_FOUND ) ENV HDF5_ROOT PATH_SUFFIXES lib Lib ) select_library_configurations( HDF5_${LIB} ) - # even though we adjusted the individual library names in - # select_library_configurations, we still need to distinguish - # between debug and release variants because HDF5_LIBRARIES will - # need to specify different lists for debug and optimized builds. - # We can't just use the HDF5_${LIB}_LIBRARY variable (which was set - # up by the selection macro above) because it may specify debug and - # optimized variants for a particular library, but a list of - # libraries is allowed to specify debug and optimized only once. - list( APPEND HDF5_${LANGUAGE}_LIBRARIES_DEBUG - ${HDF5_${LIB}_LIBRARY_DEBUG} ) - list( APPEND HDF5_${LANGUAGE}_LIBRARIES_RELEASE - ${HDF5_${LIB}_LIBRARY_RELEASE} ) + list(APPEND HDF5_${LANGUAGE}_LIBRARIES ${HDF5_${LIB}_LIBRARY}) endforeach() list( APPEND HDF5_LIBRARY_DIRS ${HDF5_${LANGUAGE}_LIBRARY_DIRS} ) # Append the libraries for this language binding to the list of all # required libraries. - list( APPEND HDF5_LIBRARIES_DEBUG - ${HDF5_${LANGUAGE}_LIBRARIES_DEBUG} ) - list( APPEND HDF5_LIBRARIES_RELEASE - ${HDF5_${LANGUAGE}_LIBRARIES_RELEASE} ) + list(APPEND HDF5_LIBRARIES ${HDF5_${LANGUAGE}_LIBRARIES}) endforeach() # We may have picked up some duplicates in various lists during the above @@ -329,30 +315,10 @@ if( NOT HDF5_FOUND ) if( HDF5_INCLUDE_DIRS ) _remove_duplicates_from_beginning( HDF5_INCLUDE_DIRS ) endif() - if( HDF5_LIBRARIES_DEBUG ) - _remove_duplicates_from_beginning( HDF5_LIBRARIES_DEBUG ) - endif() - if( HDF5_LIBRARIES_RELEASE ) - _remove_duplicates_from_beginning( HDF5_LIBRARIES_RELEASE ) - endif() if( HDF5_LIBRARY_DIRS ) _remove_duplicates_from_beginning( HDF5_LIBRARY_DIRS ) endif() - # Construct the complete list of HDF5 libraries with debug and optimized - # variants when the generator supports them. - if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) - set( HDF5_LIBRARIES ) - foreach( _lib ${HDF5_LIBRARIES_DEBUG} ) - list( APPEND HDF5_LIBRARIES debug ${_lib} ) - endforeach() - foreach( _lib ${HDF5_LIBRARIES_RELEASE} ) - list( APPEND HDF5_LIBRARIES optimized ${_lib} ) - endforeach() - else() - set( HDF5_LIBRARIES ${HDF5_LIBRARIES_RELEASE} ) - endif() - # If the HDF5 include directory was found, open H5pubconf.h to determine if # HDF5 was compiled with parallel IO support set( HDF5_IS_PARALLEL FALSE ) diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake index 33c2971..a2577d2 100644 --- a/Modules/FindPNG.cmake +++ b/Modules/FindPNG.cmake @@ -58,15 +58,19 @@ if(ZLIB_FOUND) list(APPEND PNG_NAMES png${v} libpng${v}) list(APPEND PNG_NAMES_DEBUG png${v}d libpng${v}d) endforeach() -message(STATUS "PNG r: ${PNG_NAMES} d: ${PNG_NAMES_DEBUG}") unset(_PNG_VERSION_SUFFIXES) - find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES}) - find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG}) + # For compatiblity with versions prior to this multi-config search, honor + # any PNG_LIBRARY that is already specified and skip the search. + if(NOT PNG_LIBRARY) + find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES}) + find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG}) + include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) + select_library_configurations(PNG) + mark_as_advanced(PNG_LIBRARY_RELEASE PNG_LIBRARY_DEBUG) + endif() unset(PNG_NAMES) unset(PNG_NAMES_DEBUG) - include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) - select_library_configurations(PNG) # Set by select_library_configurations(), but we want the one from # find_package_handle_standard_args() below. unset(PNG_FOUND) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 0930880..72844b5 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -294,6 +294,15 @@ endif() # set up the default search directories for frameworks set(CMAKE_SYSTEM_FRAMEWORK_PATH ~/Library/Frameworks + ) +if(_CMAKE_OSX_SYSROOT_PATH) + list(APPEND CMAKE_SYSTEM_FRAMEWORK_PATH + ${_CMAKE_OSX_SYSROOT_PATH}/Library/Frameworks + ${_CMAKE_OSX_SYSROOT_PATH}/Network/Library/Frameworks + ${_CMAKE_OSX_SYSROOT_PATH}/System/Library/Frameworks + ) +endif() +list(APPEND CMAKE_SYSTEM_FRAMEWORK_PATH /Library/Frameworks /Network/Library/Frameworks /System/Library/Frameworks) diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 685638a..7036ba0 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -124,8 +124,15 @@ endif() set(CMAKE_BUILD_TYPE_INIT Debug) if(WINCE) - string(TOUPPER "${MSVC_C_ARCHITECTURE_ID}" _MSVC_C_ARCHITECTURE_ID_UPPER) - string(TOUPPER "${MSVC_CXX_ARCHITECTURE_ID}" _MSVC_CXX_ARCHITECTURE_ID_UPPER) + foreach(lang C CXX) + set(_MSVC_${lang}_ARCHITECTURE_FAMILY "${MSVC_${lang}_ARCHITECTURE_ID}") + if(_MSVC_${lang}_ARCHITECTURE_FAMILY STREQUAL "THUMB") + set(_MSVC_${lang}_ARCHITECTURE_FAMILY "ARM") + elseif(_MSVC_${lang}_ARCHITECTURE_FAMILY MATCHES "^SH") + set(_MSVC_${lang}_ARCHITECTURE_FAMILY "SHx") + endif() + string(TOUPPER "${_MSVC_${lang}_ARCHITECTURE_FAMILY}" _MSVC_${lang}_ARCHITECTURE_FAMILY_UPPER) + endforeach() if("${CMAKE_SYSTEM_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)") math(EXPR _CE_VERSION "${CMAKE_MATCH_1}*100 + ${CMAKE_MATCH_2}") @@ -136,15 +143,15 @@ if(WINCE) endif() set(_PLATFORM_DEFINES "/D_WIN32_WCE=0x${_CE_VERSION} /DUNDER_CE") - set(_PLATFORM_DEFINES_C " /D${MSVC_C_ARCHITECTURE_ID} /D_${_MSVC_C_ARCHITECTURE_ID_UPPER}_") - set(_PLATFORM_DEFINES_CXX " /D${MSVC_CXX_ARCHITECTURE_ID} /D_${_MSVC_CXX_ARCHITECTURE_ID_UPPER}_") + set(_PLATFORM_DEFINES_C " /D${_MSVC_C_ARCHITECTURE_FAMILY} /D_${_MSVC_C_ARCHITECTURE_FAMILY_UPPER}_") + set(_PLATFORM_DEFINES_CXX " /D${_MSVC_CXX_ARCHITECTURE_FAMILY} /D_${_MSVC_CXX_ARCHITECTURE_FAMILY_UPPER}_") set(_RTC1 "") set(_FLAGS_CXX " /GR /EHsc") set(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib") set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /NODEFAULTLIB:libc.lib /NODEFAULTLIB:oldnames.lib") - if (MSVC_VERSION LESS 1500) + if (MSVC_VERSION LESS 1600) set(CMAKE_C_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT} corelibc.lib") endif () else() @@ -231,7 +238,6 @@ macro(__windows_compiler_msvc lang) set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /FoNUL /FAs /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}") - set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link") 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}") diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index e962313..127cf6b 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -192,11 +192,12 @@ static std::string stripAllGeneratorExpressions(const std::string &input) std::string result; std::string::size_type pos = 0; std::string::size_type lastPos = pos; + int nestingLevel = 0; while((pos = input.find("$<", lastPos)) != input.npos) { result += input.substr(lastPos, pos - lastPos); pos += 2; - int nestingLevel = 1; + nestingLevel = 1; const char *c = input.c_str() + pos; const char * const cStart = c; for ( ; *c; ++c) @@ -224,7 +225,10 @@ static std::string stripAllGeneratorExpressions(const std::string &input) pos += traversed; lastPos = pos; } - result += input.substr(lastPos); + if (nestingLevel == 0) + { + result += input.substr(lastPos); + } return cmGeneratorExpression::StripEmptyListElements(result); } @@ -253,6 +257,7 @@ static std::string stripExportInterface(const std::string &input, { std::string result; + int nestingLevel = 0; std::string::size_type pos = 0; std::string::size_type lastPos = pos; while (true) @@ -282,7 +287,7 @@ static std::string stripExportInterface(const std::string &input, const bool gotInstallInterface = input[pos + 2] == 'I'; pos += gotInstallInterface ? sizeof("$<INSTALL_INTERFACE:") - 1 : sizeof("$<BUILD_INTERFACE:") - 1; - int nestingLevel = 1; + nestingLevel = 1; const char *c = input.c_str() + pos; const char * const cStart = c; for ( ; *c; ++c) @@ -331,7 +336,10 @@ static std::string stripExportInterface(const std::string &input, pos += traversed; lastPos = pos; } - result += input.substr(lastPos); + if (nestingLevel == 0) + { + result += input.substr(lastPos); + } return cmGeneratorExpression::StripEmptyListElements(result); } diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 58cc6f4..bd6c860 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1954,23 +1954,27 @@ cmLocalVisualStudio7Generator // Compute the version of the Intel plugin to the VS IDE. // If the key does not exist then use a default guess. - std::string intelVersion = "9.10"; + std::string intelVersion; std::string vskey = gg->GetRegistryBase(); vskey += "\\Packages\\" CM_INTEL_PLUGIN_GUID ";ProductVersion"; cmSystemTools::ReadRegistryValue(vskey.c_str(), intelVersion, cmSystemTools::KeyWOW64_32); - if (intelVersion.find("13") == 0 || - intelVersion.find("12") == 0 || - intelVersion.find("11") == 0) + unsigned int intelVersionNumber = ~0u; + sscanf(intelVersion.c_str(), "%u", &intelVersionNumber); + if(intelVersionNumber >= 11) { - // Version 11.x, 12.x, and 13.x actually use 11.0 in project files! - intelVersion = "11.0" ; + // Default to latest known project file version. + intelVersion = "11.0"; } - else if(intelVersion.find("10") == 0) + else if(intelVersionNumber == 10) { // Version 10.x actually uses 9.10 in project files! intelVersion = "9.10"; } + else + { + // Version <= 9: use ProductVersion from registry. + } fout << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n" << "<VisualStudioProject\n" diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index fd06a33..34541e9 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1069,6 +1069,19 @@ void cmMakefile::UpdateOutputToSourceMap(std::string const& output, cmSourceFile* source) { + OutputToSourceMap::iterator i = this->OutputToSource.find(output); + if(i != this->OutputToSource.end()) + { + // Multiple custom commands produce the same output but may + // be attached to a different source file (MAIN_DEPENDENCY). + // LinearGetSourceFileWithOutput would return the first one, + // so keep the mapping for the first one. + // + // TODO: Warn the user about this case. However, the VS 8 generator + // triggers it for separate generate.stamp rules in ZERO_CHECK and + // individual targets. + return; + } this->OutputToSource[output] = source; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 147c332..ac655da 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -6443,7 +6443,13 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface, ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n" << "Target \"" << this->GetName() << "\" has a " "INTERFACE_LINK_LIBRARIES property which differs from its " - << linkIfaceProp << " properties."; + << linkIfaceProp << " properties." + "\n" + "INTERFACE_LINK_LIBRARIES:\n " + << newExplicitLibraries + << "\n" + << linkIfaceProp << ":\n " + << (explicitLibraries ? explicitLibraries : "(empty)") << "\n"; this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); } // Fall through diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt index 29103c9..93c0ab3 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt @@ -5,4 +5,13 @@ CMake Warning \(dev\) in CMakeLists.txt: Target "bar" has a INTERFACE_LINK_LIBRARIES property which differs from its LINK_INTERFACE_LIBRARIES properties. + + INTERFACE_LINK_LIBRARIES: + + foo + + LINK_INTERFACE_LIBRARIES: + + bat + This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt index 5a5ad27..6370b24 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt @@ -5,4 +5,13 @@ CMake Warning \(dev\) in CMakeLists.txt: Target "bar" has a INTERFACE_LINK_LIBRARIES property which differs from its LINK_INTERFACE_LIBRARIES properties. + + INTERFACE_LINK_LIBRARIES: + + foo + + LINK_INTERFACE_LIBRARIES: + + bat + This warning is for project developers. Use -Wno-dev to suppress it. @@ -692,7 +692,10 @@ if ${cmake_system_linux}; then # avoid binutils problem with large binaries, e.g. when building CMake in debug mode # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50230 if ${cmake_machine_parisc}; then - cmake_ld_flags="${LDFLAGS} -Wl,--unique=.text.*" + # if -O[s23] is given the effect is inverted, so do not use the flag then + if [ "`echo "${CXXFLAGS}" | sed -r '/^(.* )?(-O[s234])( .*)?$/s/.*/-Os/'`" != "-Os" ]; then + cmake_ld_flags="${LDFLAGS} -Wl,--unique=.text.*" + fi fi fi |