diff options
41 files changed, 289 insertions, 221 deletions
diff --git a/Help/release/3.12.rst b/Help/release/3.12.rst index 691731a..4d1135e 100644 --- a/Help/release/3.12.rst +++ b/Help/release/3.12.rst @@ -170,6 +170,9 @@ Modules * The :module:`FindLibXml2` module now provides imported targets. +* The :module:`FindMatlab` module now supports the Matlab Runtime + Compiler (MCR) for compiling and linking matlab extensions. + * A :module:`FindODBC` module was added to find an Open Database Connectivity (ODBC) library. diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in index 8ad0c01..72144cf 100644 --- a/Modules/CMakeCCompiler.cmake.in +++ b/Modules/CMakeCCompiler.cmake.in @@ -15,7 +15,7 @@ set(CMAKE_C_SIMULATE_ID "@CMAKE_C_SIMULATE_ID@") set(CMAKE_C_SIMULATE_VERSION "@CMAKE_C_SIMULATE_VERSION@") @_SET_CMAKE_C_COMPILER_ARCHITECTURE_ID@ @SET_MSVC_C_ARCHITECTURE_ID@ -@SET_CMAKE_XCODE_CURRENT_ARCH@ +@SET_CMAKE_XCODE_ARCHS@ set(CMAKE_AR "@CMAKE_AR@") set(CMAKE_C_COMPILER_AR "@CMAKE_C_COMPILER_AR@") set(CMAKE_RANLIB "@CMAKE_RANLIB@") diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index 974886d..8da6a8c 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -17,7 +17,7 @@ set(CMAKE_CXX_SIMULATE_ID "@CMAKE_CXX_SIMULATE_ID@") set(CMAKE_CXX_SIMULATE_VERSION "@CMAKE_CXX_SIMULATE_VERSION@") @_SET_CMAKE_CXX_COMPILER_ARCHITECTURE_ID@ @SET_MSVC_CXX_ARCHITECTURE_ID@ -@SET_CMAKE_XCODE_CURRENT_ARCH@ +@SET_CMAKE_XCODE_ARCHS@ set(CMAKE_AR "@CMAKE_AR@") set(CMAKE_CXX_COMPILER_AR "@CMAKE_CXX_COMPILER_AR@") set(CMAKE_RANLIB "@CMAKE_RANLIB@") diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 7e6ca1e..17706ea 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -183,9 +183,9 @@ if(MSVC_C_ARCHITECTURE_ID) "set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})") endif() -if(CMAKE_C_XCODE_CURRENT_ARCH) - set(SET_CMAKE_XCODE_CURRENT_ARCH - "set(CMAKE_XCODE_CURRENT_ARCH ${CMAKE_C_XCODE_CURRENT_ARCH})") +if(CMAKE_C_XCODE_ARCHS) + set(SET_CMAKE_XCODE_ARCHS + "set(CMAKE_XCODE_ARCHS \"${CMAKE_C_XCODE_ARCHS}\")") endif() # configure variables set in this file for fast reload later on diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index c0fb3b6..70d17a1 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -181,9 +181,9 @@ if(MSVC_CXX_ARCHITECTURE_ID) "set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})") endif() -if(CMAKE_CXX_XCODE_CURRENT_ARCH) - set(SET_CMAKE_XCODE_CURRENT_ARCH - "set(CMAKE_XCODE_CURRENT_ARCH ${CMAKE_CXX_XCODE_CURRENT_ARCH})") +if(CMAKE_CXX_XCODE_ARCHS) + set(SET_CMAKE_XCODE_ARCHS + "set(CMAKE_XCODE_ARCHS \"${CMAKE_CXX_XCODE_ARCHS}\")") endif() # configure all variables set in this file diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 1628203..16dde65 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -121,7 +121,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "${CMAKE_${lang}_COMPILER_ARCHITECTURE_ID}" PARENT_SCOPE) set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" PARENT_SCOPE) - set(CMAKE_${lang}_XCODE_CURRENT_ARCH "${CMAKE_${lang}_XCODE_CURRENT_ARCH}" PARENT_SCOPE) + set(CMAKE_${lang}_XCODE_ARCHS "${CMAKE_${lang}_XCODE_ARCHS}" PARENT_SCOPE) set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION_INTERNAL "${CMAKE_${lang}_COMPILER_VERSION_INTERNAL}" PARENT_SCOPE) @@ -380,8 +380,10 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} endif() endif() endif() - if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "CURRENT_ARCH=([^%\r\n]+)[\r\n]") - set(CMAKE_${lang}_XCODE_CURRENT_ARCH "${CMAKE_MATCH_1}" PARENT_SCOPE) + if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "ARCHS=([^%\r\n]+)[\r\n]") + set(CMAKE_${lang}_XCODE_ARCHS "${CMAKE_MATCH_1}") + separate_arguments(CMAKE_${lang}_XCODE_ARCHS) + set(CMAKE_${lang}_XCODE_ARCHS "${CMAKE_${lang}_XCODE_ARCHS}" PARENT_SCOPE) endif() else() execute_process( diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in index 1cbaa57..94bcbf8 100644 --- a/Modules/CompilerId/Xcode-3.pbxproj.in +++ b/Modules/CompilerId/Xcode-3.pbxproj.in @@ -58,7 +58,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "echo \"GCC_VERSION=$GCC_VERSION\" ; echo \"CURRENT_ARCH=$CURRENT_ARCH\""; + shellScript = "echo \"GCC_VERSION=$GCC_VERSION\" ; echo \"ARCHS=$ARCHS\""; showEnvVarsInLog = 0; }; 2C18F0B515DC1DCE00593670 = { diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake index e66ae92..a549765 100644 --- a/Modules/FindCURL.cmake +++ b/Modules/FindCURL.cmake @@ -10,7 +10,7 @@ # IMPORTED Targets # ^^^^^^^^^^^^^^^^ # -# This module defines :prop_tgt:`IMPORTED` target ``CURL::CURL``, if +# This module defines :prop_tgt:`IMPORTED` target ``CURL::libcurl``, if # curl has been found. # # Result Variables @@ -67,9 +67,9 @@ if(CURL_FOUND) set(CURL_LIBRARIES ${CURL_LIBRARY}) set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) - if(NOT TARGET CURL::CURL) - add_library(CURL::CURL UNKNOWN IMPORTED) - set_target_properties(CURL::CURL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}") - set_property(TARGET CURL::CURL APPEND PROPERTY IMPORTED_LOCATION "${CURL_LIBRARY}") + if(NOT TARGET CURL::libcurl) + add_library(CURL::libcurl UNKNOWN IMPORTED) + set_target_properties(CURL::libcurl PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}") + set_property(TARGET CURL::libcurl APPEND PROPERTY IMPORTED_LOCATION "${CURL_LIBRARY}") endif() endif() diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake index 61a2213..7290724 100644 --- a/Modules/FindJPEG.cmake +++ b/Modules/FindJPEG.cmake @@ -52,7 +52,7 @@ find_path(JPEG_INCLUDE_DIR jpeglib.h) set(jpeg_names ${JPEG_NAMES} jpeg jpeg-static libjpeg libjpeg-static) -foreach(name ${JPEG_NAMES}) +foreach(name ${jpeg_names}) list(APPEND jpeg_names_debug "${name}d") endforeach() @@ -122,10 +122,4 @@ if(JPEG_FOUND) endif() endif() -# Deprecated declarations. -set(NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR}) -if(JPEG_LIBRARY) - get_filename_component(NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH) -endif() - mark_as_advanced(JPEG_LIBRARY JPEG_INCLUDE_DIR) diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index f7b5930..6eb4354 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -3,6 +3,7 @@ #include "cmCTestCurl.h" #include "cmCTest.h" +#include "cmCurl.h" #include "cmSystemTools.h" #include <ostream> @@ -76,6 +77,7 @@ bool cmCTestCurl::InitCurl() if (!this->Curl) { return false; } + cmCurlSetCAInfo(this->Curl); if (this->VerifyPeerOff) { curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYPEER, 0); } @@ -146,7 +148,7 @@ bool cmCTestCurl::UploadFile(std::string const& local_file, ::curl_slist_append(nullptr, "Content-Type: text/xml"); // Add any additional headers that the user specified. for (std::string const& h : this->HttpHeaders) { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + cmCTestOptionalLog(this->CTest, DEBUG, " Add HTTP Header: \"" << h << "\"" << std::endl, this->Quiet); headers = ::curl_slist_append(headers, h.c_str()); @@ -214,7 +216,7 @@ bool cmCTestCurl::HttpRequest(std::string const& url, struct curl_slist* headers = nullptr; if (!this->HttpHeaders.empty()) { for (std::string const& h : this->HttpHeaders) { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + cmCTestOptionalLog(this->CTest, DEBUG, " Add HTTP Header: \"" << h << "\"" << std::endl, this->Quiet); headers = ::curl_slist_append(headers, h.c_str()); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index cae3d4c..4c2b75e 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -314,7 +314,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, // Add any additional headers that the user specified. for (std::string const& h : this->HttpHeaders) { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + cmCTestOptionalLog(this->CTest, DEBUG, " Add HTTP Header: \"" << h << "\"" << std::endl, this->Quiet); headers = ::curl_slist_append(headers, h.c_str()); diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index 2a1abba..1b57fd8 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -22,6 +22,8 @@ function(cm_check_cxx_feature name) # Filter out warnings caused by local configuration. string(REGEX REPLACE "[^\n]*warning:[^\n]*directory not found for option[^\n]*" "" check_output "${check_output}") string(REGEX REPLACE "[^\n]*warning:[^\n]*object file compiled with -mlong-branch which is no longer needed[^\n]*" "" check_output "${check_output}") + # Filter out xcodebuild warnings. + string(REGEX REPLACE "[^\n]* xcodebuild\\[[0-9]*:[0-9]*\\] warning: [^\n]*" "" check_output "${check_output}") # If using the feature causes warnings, treat it as broken/unavailable. if(check_output MATCHES "[Ww]arning") set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE) diff --git a/Source/LexerParser/cmListFileLexer.c b/Source/LexerParser/cmListFileLexer.c index c6f524c..eb37337 100644 --- a/Source/LexerParser/cmListFileLexer.c +++ b/Source/LexerParser/cmListFileLexer.c @@ -576,16 +576,16 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_accept[81] = +static const flex_int16_t yy_accept[79] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 25, 13, 22, 1, 16, 3, 13, 5, 6, 7, - 15, 23, 23, 17, 19, 20, 21, 17, 10, 11, - 8, 10, 12, 9, 24, 4, 13, 0, 13, 0, - 22, 0, 0, 7, 13, 0, 13, 0, 2, 0, - 13, 17, 0, 18, 10, 8, 4, 0, 14, 0, - 0, 0, 0, 14, 0, 0, 14, 0, 0, 0, - 2, 14, 0, 0, 0, 0, 0, 0, 0, 0 + 15, 23, 23, 17, 19, 20, 21, 24, 10, 11, + 8, 12, 9, 4, 13, 0, 13, 0, 22, 0, + 0, 7, 13, 0, 13, 0, 2, 0, 13, 17, + 0, 18, 10, 8, 4, 0, 14, 0, 0, 0, + 0, 14, 0, 0, 14, 0, 0, 0, 2, 14, + 0, 0, 0, 0, 0, 0, 0, 0 } ; static const YY_CHAR yy_ec[256] = @@ -623,89 +623,87 @@ static const YY_CHAR yy_ec[256] = static const YY_CHAR yy_meta[17] = { 0, 1, 1, 2, 3, 4, 3, 1, 3, 5, 6, - 1, 6, 1, 1, 7, 8 + 1, 6, 1, 1, 7, 2 } ; -static const flex_int16_t yy_base[99] = +static const flex_int16_t yy_base[97] = { 0, 0, 0, 14, 28, 42, 56, 70, 84, 18, 19, - 69, 100, 16, 323, 323, 55, 59, 323, 323, 13, - 115, 0, 323, 52, 323, 323, 21, 51, 0, 323, - 53, 0, 323, 323, 323, 0, 0, 126, 55, 0, - 25, 25, 53, 0, 0, 136, 53, 0, 57, 0, - 0, 42, 50, 323, 0, 43, 0, 146, 160, 45, - 172, 43, 26, 0, 42, 184, 0, 42, 195, 40, - 323, 40, 0, 38, 37, 34, 32, 31, 23, 323, - 211, 219, 227, 235, 243, 251, 259, 267, 274, 281, - 285, 291, 298, 302, 304, 310, 314, 316 + 68, 100, 16, 298, 298, 54, 58, 298, 298, 13, + 115, 0, 298, 51, 298, 298, 21, 298, 0, 298, + 53, 298, 298, 0, 0, 126, 55, 0, 25, 25, + 53, 0, 0, 136, 53, 0, 57, 0, 0, 42, + 50, 298, 0, 43, 0, 146, 160, 45, 172, 43, + 26, 0, 42, 177, 0, 42, 188, 40, 298, 40, + 0, 38, 37, 34, 32, 31, 23, 298, 197, 204, + 211, 218, 225, 232, 239, 245, 252, 259, 262, 268, + 275, 278, 280, 286, 289, 291 } ; -static const flex_int16_t yy_def[99] = +static const flex_int16_t yy_def[97] = { 0, - 80, 1, 81, 81, 82, 82, 83, 83, 84, 84, - 80, 80, 80, 80, 80, 80, 12, 80, 80, 12, - 80, 85, 80, 86, 80, 80, 86, 86, 87, 80, - 80, 87, 80, 80, 80, 88, 12, 89, 12, 90, - 80, 80, 91, 20, 12, 92, 12, 21, 80, 93, - 12, 86, 86, 80, 87, 80, 88, 89, 80, 58, - 89, 94, 80, 59, 91, 92, 59, 66, 92, 95, - 80, 59, 96, 97, 94, 98, 95, 97, 98, 0, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80 + 78, 1, 79, 79, 80, 80, 81, 81, 82, 82, + 78, 78, 78, 78, 78, 78, 12, 78, 78, 12, + 78, 83, 78, 84, 78, 78, 84, 78, 85, 78, + 78, 78, 78, 86, 12, 87, 12, 88, 78, 78, + 89, 20, 12, 90, 12, 21, 78, 91, 12, 84, + 84, 78, 85, 78, 86, 87, 78, 56, 87, 92, + 78, 57, 89, 90, 57, 64, 90, 93, 78, 57, + 94, 95, 92, 96, 93, 95, 96, 0, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78 } ; -static const flex_int16_t yy_nxt[340] = +static const flex_int16_t yy_nxt[315] = { 0, 12, 13, 14, 13, 15, 16, 17, 18, 19, 12, - 12, 20, 21, 22, 12, 23, 25, 41, 26, 41, - 14, 14, 44, 54, 44, 52, 41, 27, 41, 28, - 25, 66, 26, 35, 35, 63, 63, 49, 49, 58, - 67, 27, 66, 28, 30, 59, 58, 62, 67, 76, - 64, 59, 74, 56, 52, 53, 31, 32, 30, 71, - 70, 64, 62, 56, 53, 53, 43, 42, 80, 80, - 31, 32, 30, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 34, 35, 30, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 34, 35, - - 37, 80, 80, 80, 38, 80, 39, 80, 80, 37, - 37, 37, 37, 40, 37, 45, 80, 80, 80, 46, - 80, 47, 80, 80, 45, 48, 45, 49, 50, 45, - 59, 80, 60, 80, 80, 80, 80, 80, 80, 61, - 67, 80, 68, 80, 80, 80, 80, 80, 80, 69, - 59, 80, 60, 80, 80, 80, 80, 80, 80, 61, - 59, 80, 80, 80, 38, 80, 72, 80, 80, 59, - 59, 59, 59, 73, 59, 58, 80, 58, 80, 58, - 58, 80, 80, 80, 80, 80, 80, 58, 67, 80, - 68, 80, 80, 80, 80, 80, 80, 69, 66, 80, - - 66, 80, 66, 66, 80, 80, 80, 80, 80, 80, - 66, 24, 24, 24, 24, 24, 24, 24, 24, 29, - 29, 29, 29, 29, 29, 29, 29, 33, 33, 33, - 33, 33, 33, 33, 33, 36, 36, 36, 36, 36, - 36, 36, 36, 51, 80, 51, 51, 51, 51, 51, - 51, 52, 80, 52, 80, 52, 52, 52, 52, 55, - 80, 55, 55, 55, 55, 80, 55, 57, 80, 57, - 57, 57, 57, 57, 58, 80, 80, 58, 80, 58, - 58, 37, 80, 37, 37, 37, 37, 37, 37, 65, - 65, 66, 80, 80, 66, 80, 66, 66, 45, 80, - - 45, 45, 45, 45, 45, 45, 75, 75, 77, 77, - 59, 80, 59, 59, 59, 59, 59, 59, 78, 78, - 79, 79, 11, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80 + 12, 20, 21, 22, 12, 23, 25, 39, 26, 39, + 14, 14, 42, 52, 42, 50, 39, 27, 39, 28, + 25, 64, 26, 28, 28, 61, 61, 47, 47, 56, + 65, 27, 64, 28, 30, 57, 56, 60, 65, 74, + 62, 57, 72, 54, 50, 51, 31, 28, 30, 69, + 68, 62, 60, 54, 51, 41, 40, 78, 78, 78, + 31, 28, 30, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 33, 28, 30, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 33, 28, + + 35, 78, 78, 78, 36, 78, 37, 78, 78, 35, + 35, 35, 35, 38, 35, 43, 78, 78, 78, 44, + 78, 45, 78, 78, 43, 46, 43, 47, 48, 43, + 57, 78, 58, 78, 78, 78, 78, 78, 78, 59, + 65, 78, 66, 78, 78, 78, 78, 78, 78, 67, + 57, 78, 58, 78, 78, 78, 78, 78, 78, 59, + 57, 78, 78, 78, 36, 78, 70, 78, 78, 57, + 57, 57, 57, 71, 57, 56, 78, 56, 78, 56, + 56, 65, 78, 66, 78, 78, 78, 78, 78, 78, + 67, 64, 78, 64, 78, 64, 64, 24, 24, 24, + + 24, 24, 24, 24, 29, 29, 29, 29, 29, 29, + 29, 32, 32, 32, 32, 32, 32, 32, 34, 34, + 34, 34, 34, 34, 34, 49, 78, 49, 49, 49, + 49, 49, 50, 78, 50, 78, 50, 50, 50, 53, + 78, 53, 53, 53, 53, 55, 78, 55, 55, 55, + 55, 55, 56, 78, 78, 56, 78, 56, 56, 35, + 78, 35, 35, 35, 35, 35, 63, 63, 64, 78, + 78, 64, 78, 64, 64, 43, 78, 43, 43, 43, + 43, 43, 73, 73, 75, 75, 57, 78, 57, 57, + 57, 57, 57, 76, 76, 77, 77, 11, 78, 78, + + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78 } ; -static const flex_int16_t yy_chk[340] = +static const flex_int16_t yy_chk[315] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 13, 3, 13, - 9, 10, 20, 27, 20, 27, 41, 3, 41, 3, - 4, 79, 4, 9, 10, 42, 63, 42, 63, 78, - 77, 4, 76, 4, 5, 75, 74, 72, 70, 68, - 65, 62, 60, 56, 53, 52, 5, 5, 6, 49, - 47, 43, 39, 31, 28, 24, 17, 16, 11, 0, + 9, 10, 20, 27, 20, 27, 39, 3, 39, 3, + 4, 77, 4, 9, 10, 40, 61, 40, 61, 76, + 75, 4, 74, 4, 5, 73, 72, 70, 68, 66, + 63, 60, 58, 54, 51, 50, 5, 5, 6, 47, + 45, 41, 37, 31, 24, 17, 16, 11, 0, 0, 6, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, @@ -713,29 +711,27 @@ static const flex_int16_t yy_chk[340] = 12, 0, 0, 0, 12, 0, 12, 0, 0, 12, 12, 12, 12, 12, 12, 21, 0, 0, 0, 21, 0, 21, 0, 0, 21, 21, 21, 21, 21, 21, - 38, 0, 38, 0, 0, 0, 0, 0, 0, 38, - 46, 0, 46, 0, 0, 0, 0, 0, 0, 46, - 58, 0, 58, 0, 0, 0, 0, 0, 0, 58, - 59, 0, 0, 0, 59, 0, 59, 0, 0, 59, - 59, 59, 59, 59, 59, 61, 0, 61, 0, 61, - 61, 0, 0, 0, 0, 0, 0, 61, 66, 0, - 66, 0, 0, 0, 0, 0, 0, 66, 69, 0, - - 69, 0, 69, 69, 0, 0, 0, 0, 0, 0, - 69, 81, 81, 81, 81, 81, 81, 81, 81, 82, - 82, 82, 82, 82, 82, 82, 82, 83, 83, 83, - 83, 83, 83, 83, 83, 84, 84, 84, 84, 84, - 84, 84, 84, 85, 0, 85, 85, 85, 85, 85, - 85, 86, 0, 86, 0, 86, 86, 86, 86, 87, - 0, 87, 87, 87, 87, 0, 87, 88, 0, 88, - 88, 88, 88, 88, 89, 0, 0, 89, 0, 89, - 89, 90, 0, 90, 90, 90, 90, 90, 90, 91, - 91, 92, 0, 0, 92, 0, 92, 92, 93, 0, - - 93, 93, 93, 93, 93, 93, 94, 94, 95, 95, - 96, 0, 96, 96, 96, 96, 96, 96, 97, 97, - 98, 98, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80 + 36, 0, 36, 0, 0, 0, 0, 0, 0, 36, + 44, 0, 44, 0, 0, 0, 0, 0, 0, 44, + 56, 0, 56, 0, 0, 0, 0, 0, 0, 56, + 57, 0, 0, 0, 57, 0, 57, 0, 0, 57, + 57, 57, 57, 57, 57, 59, 0, 59, 0, 59, + 59, 64, 0, 64, 0, 0, 0, 0, 0, 0, + 64, 67, 0, 67, 0, 67, 67, 79, 79, 79, + + 79, 79, 79, 79, 80, 80, 80, 80, 80, 80, + 80, 81, 81, 81, 81, 81, 81, 81, 82, 82, + 82, 82, 82, 82, 82, 83, 0, 83, 83, 83, + 83, 83, 84, 0, 84, 0, 84, 84, 84, 85, + 0, 85, 85, 85, 85, 86, 0, 86, 86, 86, + 86, 86, 87, 0, 0, 87, 0, 87, 87, 88, + 0, 88, 88, 88, 88, 88, 89, 89, 90, 0, + 0, 90, 0, 90, 90, 91, 0, 91, 91, 91, + 91, 91, 92, 92, 93, 93, 94, 0, 94, 94, + 94, 94, 94, 95, 95, 96, 96, 78, 78, 78, + + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78 } ; /* Table of booleans, true if rule could match eol. */ @@ -1093,13 +1089,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) + if ( yy_current_state >= 79 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 323 ); + while ( yy_base[yy_current_state] != 298 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1674,7 +1670,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) + if ( yy_current_state >= 79 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; @@ -1703,11 +1699,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) + if ( yy_current_state >= 79 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 80); + yy_is_jam = (yy_current_state == 78); (void)yyg; return yy_is_jam ? 0 : yy_current_state; diff --git a/Source/LexerParser/cmListFileLexer.in.l b/Source/LexerParser/cmListFileLexer.in.l index f2fd538..23c7e49 100644 --- a/Source/LexerParser/cmListFileLexer.in.l +++ b/Source/LexerParser/cmListFileLexer.in.l @@ -74,7 +74,7 @@ static void cmListFileLexerDestroy(cmListFileLexer* lexer); %x COMMENT MAKEVAR \$\([A-Za-z0-9_]*\) -UNQUOTED ([^ \0\t\r\n\(\)#\\\"[=]|\\.) +UNQUOTED ([^ \0\t\r\n\(\)#\\\"[=]|\\[^\0\n]) LEGACY {MAKEVAR}|{UNQUOTED}|\"({MAKEVAR}|{UNQUOTED}|[ \t[=])*\" %% @@ -156,7 +156,7 @@ LEGACY {MAKEVAR}|{UNQUOTED}|\"({MAKEVAR}|{UNQUOTED}|[ \t[=])*\" return 1; } -<BRACKET>([^]\n])+ { +<BRACKET>([^]\0\n])+ { cmListFileLexerAppend(lexer, yytext, yyleng); lexer->column += yyleng; } @@ -208,7 +208,7 @@ LEGACY {MAKEVAR}|{UNQUOTED}|\"({MAKEVAR}|{UNQUOTED}|[ \t[=])*\" BEGIN(STRING); } -<STRING>([^\\\n\"]|\\.)+ { +<STRING>([^\\\0\n\"]|\\[^\0\n])+ { cmListFileLexerAppend(lexer, yytext, yyleng); lexer->column += yyleng; } diff --git a/Source/Modules/FindLibUV.cmake b/Source/Modules/FindLibUV.cmake index ba13d75..0554d62 100644 --- a/Source/Modules/FindLibUV.cmake +++ b/Source/Modules/FindLibUV.cmake @@ -63,6 +63,8 @@ mark_as_advanced(LibUV_INCLUDE_DIR) set(_LibUV_H_REGEX "#[ \t]*define[ \t]+UV_VERSION_(MAJOR|MINOR|PATCH)[ \t]+[0-9]+") if(LibUV_INCLUDE_DIR AND EXISTS "${LibUV_INCLUDE_DIR}/uv-version.h") file(STRINGS "${LibUV_INCLUDE_DIR}/uv-version.h" _LibUV_H REGEX "${_LibUV_H_REGEX}") +elseif(LibUV_INCLUDE_DIR AND EXISTS "${LibUV_INCLUDE_DIR}/uv/version.h") + file(STRINGS "${LibUV_INCLUDE_DIR}/uv/version.h" _LibUV_H REGEX "${_LibUV_H_REGEX}") elseif(LibUV_INCLUDE_DIR AND EXISTS "${LibUV_INCLUDE_DIR}/uv.h") file(STRINGS "${LibUV_INCLUDE_DIR}/uv.h" _LibUV_H REGEX "${_LibUV_H_REGEX}") else() diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index aae70b1..dcb79f7 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -777,7 +777,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args, this->Makefile->GetCMakeInstance()->GetWorkingMode(); while (i != args.end()) { if (*i == "LIST_DIRECTORIES") { - ++i; + ++i; // skip LIST_DIRECTORIES if (i != args.end()) { if (cmSystemTools::IsOn(i->c_str())) { g.SetListDirs(true); @@ -789,27 +789,21 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args, this->SetError("LIST_DIRECTORIES missing bool value."); return false; } + ++i; } else { this->SetError("LIST_DIRECTORIES missing bool value."); return false; } - ++i; - if (i == args.end()) { - this->SetError("GLOB requires a glob expression after the bool."); - return false; - } } else if (*i == "FOLLOW_SYMLINKS") { - if (!recurse) { - this->SetError("FOLLOW_SYMLINKS is not a valid parameter for GLOB."); - return false; - } - explicitFollowSymlinks = true; - g.RecurseThroughSymlinksOn(); - ++i; - if (i == args.end()) { - this->SetError( - "GLOB_RECURSE requires a glob expression after FOLLOW_SYMLINKS."); - return false; + ++i; // skip FOLLOW_SYMLINKS + if (recurse) { + explicitFollowSymlinks = true; + g.RecurseThroughSymlinksOn(); + if (i == args.end()) { + this->SetError( + "GLOB_RECURSE requires a glob expression after FOLLOW_SYMLINKS."); + return false; + } } } else if (*i == "RELATIVE") { ++i; // skip RELATIVE diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 8c20313..a5709d5 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -263,25 +263,32 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset( this->GeneratorToolsetVersion.clear(); } - std::string const toolsetPath = this->GetAuxiliaryToolset(); - if (!toolsetPath.empty() && !cmSystemTools::FileExists(toolsetPath)) { - - std::ostringstream e; - /* clang-format off */ - e << - "Generator\n" - " " << this->GetName() << "\n" - "given toolset and version specification\n" - " " << this->GetPlatformToolsetString() << ",version=" << - this->GeneratorToolsetVersion << "\n" - "does not seem to be installed at\n" << - " " << toolsetPath; - ; - /* clang-format on */ - mf->IssueMessage(cmake::FATAL_ERROR, e.str()); - - // Clear the configured tool-set + bool const isDefaultToolset = + this->IsDefaultToolset(this->GeneratorToolsetVersion); + if (isDefaultToolset) { + // If the given version is the default toolset, remove the setting this->GeneratorToolsetVersion.clear(); + } else { + std::string const toolsetPath = this->GetAuxiliaryToolset(); + if (!toolsetPath.empty() && !cmSystemTools::FileExists(toolsetPath)) { + + std::ostringstream e; + /* clang-format off */ + e << + "Generator\n" + " " << this->GetName() << "\n" + "given toolset and version specification\n" + " " << this->GetPlatformToolsetString() << ",version=" << + this->GeneratorToolsetVersion << "\n" + "does not seem to be installed at\n" << + " " << toolsetPath; + ; + /* clang-format on */ + mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + + // Clear the configured tool-set + this->GeneratorToolsetVersion.clear(); + } } } @@ -615,6 +622,12 @@ cmGlobalVisualStudio10Generator::GetPlatformToolsetCudaString() const return this->GeneratorToolsetCuda; } +bool cmGlobalVisualStudio10Generator::IsDefaultToolset( + const std::string&) const +{ + return true; +} + std::string cmGlobalVisualStudio10Generator::GetAuxiliaryToolset() const { return {}; diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index f85b773..6eb597c 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -106,6 +106,7 @@ public: std::string Encoding() override; virtual const char* GetToolsVersion() { return "4.0"; } + virtual bool IsDefaultToolset(const std::string& version) const; virtual std::string GetAuxiliaryToolset() const; bool FindMakeProgram(cmMakefile* mf) override; diff --git a/Source/cmGlobalVisualStudio15Generator.cxx b/Source/cmGlobalVisualStudio15Generator.cxx index 6af5793..9983a43 100644 --- a/Source/cmGlobalVisualStudio15Generator.cxx +++ b/Source/cmGlobalVisualStudio15Generator.cxx @@ -158,6 +158,27 @@ bool cmGlobalVisualStudio15Generator::GetVSInstance(std::string& dir) const return vsSetupAPIHelper.GetVSInstanceInfo(dir); } +bool cmGlobalVisualStudio15Generator::IsDefaultToolset( + const std::string& version) const +{ + if (version.empty()) { + return true; + } + + std::string vcToolsetVersion; + if (this->vsSetupAPIHelper.GetVCToolsetVersion(vcToolsetVersion)) { + + cmsys::RegularExpression regex("[0-9][0-9]\\.[0-9]+"); + if (regex.find(version) && regex.find(vcToolsetVersion)) { + const auto majorMinorEnd = vcToolsetVersion.find('.', 3); + const auto majorMinor = vcToolsetVersion.substr(0, majorMinorEnd); + return version == majorMinor; + } + } + + return false; +} + std::string cmGlobalVisualStudio15Generator::GetAuxiliaryToolset() const { const char* version = this->GetPlatformToolsetVersion(); diff --git a/Source/cmGlobalVisualStudio15Generator.h b/Source/cmGlobalVisualStudio15Generator.h index 3b9cfc7..cdc97ad 100644 --- a/Source/cmGlobalVisualStudio15Generator.h +++ b/Source/cmGlobalVisualStudio15Generator.h @@ -32,6 +32,7 @@ public: bool GetVSInstance(std::string& dir) const; + bool IsDefaultToolset(const std::string& version) const override; std::string GetAuxiliaryToolset() const override; protected: diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 47741f9..e9a08bf 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3156,8 +3156,13 @@ void cmGlobalXCodeGenerator::ComputeArchitectures(cmMakefile* mf) if (this->Architectures.empty()) { // With no ARCHS we use ONLY_ACTIVE_ARCH. // Look up the arch that Xcode chooses in this case. - if (const char* arch = mf->GetDefinition("CMAKE_XCODE_CURRENT_ARCH")) { + if (const char* arch = mf->GetDefinition("CMAKE_XCODE_ARCHS")) { this->ObjectDirArchDefault = arch; + // We expect only one arch but choose the first just in case. + std::string::size_type pos = this->ObjectDirArchDefault.find(';'); + if (pos != std::string::npos) { + this->ObjectDirArchDefault = this->ObjectDirArchDefault.substr(0, pos); + } } } @@ -3333,15 +3338,10 @@ void cmGlobalXCodeGenerator::OutputXCodeProject( } this->WriteXCodePBXProj(fout, root, generators); - // Since the lowest available Xcode version for testing was 6.4, - // I'm setting this as a limit then - if (this->XcodeVersion >= 64) { - if (root->GetMakefile()->GetCMakeInstance()->GetIsInTryCompile() || - root->GetMakefile()->IsOn("CMAKE_XCODE_GENERATE_SCHEME")) { - this->OutputXCodeSharedSchemes(xcodeDir); - this->OutputXCodeWorkspaceSettings(xcodeDir); - } + if (this->IsGeneratingScheme(root)) { + this->OutputXCodeSharedSchemes(xcodeDir); } + this->OutputXCodeWorkspaceSettings(xcodeDir, root); this->ClearXCodeObjects(); @@ -3351,6 +3351,15 @@ void cmGlobalXCodeGenerator::OutputXCodeProject( root->GetBinaryDirectory()); } +bool cmGlobalXCodeGenerator::IsGeneratingScheme(cmLocalGenerator* root) const +{ + // Since the lowest available Xcode version for testing was 6.4, + // I'm setting this as a limit then + return this->XcodeVersion >= 64 && + (root->GetMakefile()->GetCMakeInstance()->GetIsInTryCompile() || + root->GetMakefile()->IsOn("CMAKE_XCODE_GENERATE_SCHEME")); +} + void cmGlobalXCodeGenerator::OutputXCodeSharedSchemes( const std::string& xcProjDir) { @@ -3390,7 +3399,7 @@ void cmGlobalXCodeGenerator::OutputXCodeSharedSchemes( } void cmGlobalXCodeGenerator::OutputXCodeWorkspaceSettings( - const std::string& xcProjDir) + const std::string& xcProjDir, cmLocalGenerator* root) { std::string xcodeSharedDataDir = xcProjDir; xcodeSharedDataDir += "/project.xcworkspace/xcshareddata"; @@ -3412,8 +3421,15 @@ void cmGlobalXCodeGenerator::OutputXCodeWorkspaceSettings( xout.StartElement("plist"); xout.Attribute("version", "1.0"); xout.StartElement("dict"); - xout.Element("key", "IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded"); - xout.Element("false"); + if (this->XcodeVersion >= 100) { + xout.Element("key", "BuildSystemType"); + xout.Element("string", "Original"); + } + if (this->IsGeneratingScheme(root)) { + xout.Element("key", + "IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded"); + xout.Element("false"); + } xout.EndElement(); // dict xout.EndElement(); // plist xout.EndDocument(); diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 0051c4a..ccef6e2 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -182,9 +182,11 @@ private: std::vector<cmLocalGenerator*>& generators); void OutputXCodeProject(cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators); + bool IsGeneratingScheme(cmLocalGenerator* root) const; // Write shared scheme files for all the native targets void OutputXCodeSharedSchemes(const std::string& xcProjDir); - void OutputXCodeWorkspaceSettings(const std::string& xcProjDir); + void OutputXCodeWorkspaceSettings(const std::string& xcProjDir, + cmLocalGenerator* root); void WriteXCodePBXProj(std::ostream& fout, cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators); cmXCodeObject* CreateXCodeFileReferenceFromPath(const std::string& fullpath, diff --git a/Source/cmVS10CudaFlagTable.h b/Source/cmVS10CudaFlagTable.h index da19d64..2b57e08 100644 --- a/Source/cmVS10CudaFlagTable.h +++ b/Source/cmVS10CudaFlagTable.h @@ -47,5 +47,8 @@ static cmVS7FlagTable cmVS10CudaFlagTable[] = { { "HostDebugInfo", "g", "", "true", 0 }, { "HostDebugInfo", "-debug", "", "true", 0 }, + { "MaxRegCount", "maxrregcount=", "", "", cmVS7FlagTable::UserValue }, + { "MaxRegCount", "maxrregcount", "", "", cmVS7FlagTable::UserFollowing }, + { 0, 0, 0, 0, 0 } }; diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx index 4ca847e..22fe007 100644 --- a/Source/cmVSSetupHelper.cxx +++ b/Source/cmVSSetupHelper.cxx @@ -199,6 +199,7 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo( if (!cmSystemTools::FileIsDirectory(vcToolsDir)) { return false; } + vsInstanceInfo.VCToolsetVersion = vcToolsVersion; } // Reboot may have been required before the product package was registered @@ -254,6 +255,18 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo(std::string& vsInstallLocation) return isInstalled; } +bool cmVSSetupAPIHelper::GetVCToolsetVersion(std::string& vsToolsetVersion) +{ + vsToolsetVersion.clear(); + bool isInstalled = this->EnumerateAndChooseVSInstance(); + + if (isInstalled) { + vsToolsetVersion = chosenInstanceInfo.VCToolsetVersion; + } + + return isInstalled && !vsToolsetVersion.empty(); +} + bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance() { bool isVSInstanceExists = false; diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h index 368341c..4144c15 100644 --- a/Source/cmVSSetupHelper.h +++ b/Source/cmVSSetupHelper.h @@ -107,16 +107,12 @@ struct VSInstanceInfo std::wstring InstanceId; std::wstring VSInstallLocation; std::wstring Version; - ULONGLONG ullVersion; - bool IsWin10SDKInstalled; - bool IsWin81SDKInstalled; + std::string VCToolsetVersion; + ULONGLONG ullVersion = 0; + bool IsWin10SDKInstalled = false; + bool IsWin81SDKInstalled = false; - VSInstanceInfo() - { - InstanceId = VSInstallLocation = Version = L""; - ullVersion = 0; - IsWin10SDKInstalled = IsWin81SDKInstalled = false; - } + VSInstanceInfo() = default; std::string GetInstallLocation() const; }; @@ -131,6 +127,7 @@ public: bool IsVS2017Installed(); bool GetVSInstanceInfo(std::string& vsInstallLocation); + bool GetVCToolsetVersion(std::string& vsToolsetVersion); bool IsWin10SDKInstalled(); bool IsWin81SDKInstalled(); diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 1768c57..b9ec301 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2809,6 +2809,7 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions( // Get includes for this target cudaOptions.AddIncludes(this->GetIncludes(configName, "CUDA")); + cudaOptions.AddFlag("UseHostInclude", "false"); this->CudaOptions[configName] = std::move(pOptions); return true; diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index 3aa57fc..127b365 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -1,30 +1,30 @@ cmake_minimum_required(VERSION 2.6) project(testRebuild) -function(test_for_xcode4 result_var) - set(${result_var} 0 PARENT_SCOPE) - if(APPLE) - execute_process(COMMAND xcodebuild -version - OUTPUT_VARIABLE ov RESULT_VARIABLE rv +if(APPLE) + set(CMake_TEST_XCODE_VERSION 0) + if(XCODE_VERSION) + set(CMake_TEST_XCODE_VERSION "${XCODE_VERSION}") + else() + execute_process( + COMMAND xcodebuild -version + OUTPUT_VARIABLE _version ERROR_VARIABLE _version ) - if("${rv}" STREQUAL "0" AND ov MATCHES "^Xcode ([0-9]+)\\.") - if(NOT CMAKE_MATCH_1 VERSION_LESS 4) - set(${result_var} 1 PARENT_SCOPE) - endif() + if(_version MATCHES "^Xcode ([0-9]+(\\.[0-9]+)*)") + set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}") endif() endif() -endfunction() - -if(APPLE) # only use multi-arch if the sysroot exists on this machine # Ninja needs -M which could not be used with multiple -arch flags if(EXISTS "${CMAKE_OSX_SYSROOT}" AND NOT "${CMAKE_GENERATOR}" MATCHES "Ninja") - set(CMAKE_OSX_ARCHITECTURES "ppc;i386") - test_for_xcode4(is_xcode4) - if(is_xcode4) - # Xcode 4, use modern architectures as defaults - # Arch 'ppc' no longer works: tools no longer available starting with Xcode 4 + if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 10) + # Arch 'i386' no longer works in Xcode 10. + set(CMAKE_OSX_ARCHITECTURES x86_64) + elseif(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 4) + # Arch 'ppc' no longer works in Xcode 4. set(CMAKE_OSX_ARCHITECTURES i386 x86_64) + else() + set(CMAKE_OSX_ARCHITECTURES ppc i386) endif() endif() endif() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 886e392..b8b724e 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -252,6 +252,10 @@ if(BUILD_TESTING) set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}") endif() endif() + if(NOT CMake_TEST_XCODE_VERSION VERSION_LESS 10) + # Since Xcode 10 we do not have two supported architectures for the host. + set(CTEST_TEST_OSX_ARCH 0) + endif() if(CMAKE_OSX_SYSROOT) execute_process( COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version ProductName diff --git a/Tests/FindCURL/Test/CMakeLists.txt b/Tests/FindCURL/Test/CMakeLists.txt index f0e5568..c3c719b 100644 --- a/Tests/FindCURL/Test/CMakeLists.txt +++ b/Tests/FindCURL/Test/CMakeLists.txt @@ -7,7 +7,7 @@ find_package(CURL REQUIRED) add_definitions(-DCMAKE_EXPECTED_CURL_VERSION="${CURL_VERSION_STRING}") add_executable(test_tgt main.c) -target_link_libraries(test_tgt CURL::CURL) +target_link_libraries(test_tgt CURL::libcurl) add_test(NAME test_tgt COMMAND test_tgt) add_executable(test_var main.c) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index b2b38ef..69c96cc 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -109,6 +109,7 @@ function(run_cmake test) "|clang[^:]*: warning: the object size sanitizer has no effect at -O0, but is explicitly enabled:" "|Error kstat returned" "|Hit xcodebuild bug" + "|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type" "|ld: 0711-224 WARNING: Duplicate symbol: .__init_aix_libgcc_cxa_atexit" "|ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information" "|[^\n]*is a member of multiple groups" diff --git a/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-result.txt b/Tests/RunCMake/Syntax/NullAfterBackslash-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-result.txt +++ b/Tests/RunCMake/Syntax/NullAfterBackslash-result.txt diff --git a/Tests/RunCMake/Syntax/NullAfterBackslash-stderr.txt b/Tests/RunCMake/Syntax/NullAfterBackslash-stderr.txt new file mode 100644 index 0000000..e7ba440 --- /dev/null +++ b/Tests/RunCMake/Syntax/NullAfterBackslash-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at NullAfterBackslash.cmake:1: + Parse error. Function missing ending "\)". Instead found bad character + with text "\\". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/NullAfterBackslash.cmake b/Tests/RunCMake/Syntax/NullAfterBackslash.cmake Binary files differnew file mode 100644 index 0000000..ed96904 --- /dev/null +++ b/Tests/RunCMake/Syntax/NullAfterBackslash.cmake diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake index 628df91..b8f5fd0 100644 --- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake +++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake @@ -55,6 +55,7 @@ run_cmake(BracketNoSpace5) run_cmake(Escape1) run_cmake(Escape2) run_cmake(EscapeCharsAllowed) +run_cmake(NullAfterBackslash) run_cmake(NullTerminatedArgument) include("${RunCMake_SOURCE_DIR}/EscapeCharsDisallowed.cmake") run_cmake(ParenNoSpace0) diff --git a/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt index 4825d7a..a8f10b5 100644 --- a/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt +++ b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt @@ -1,3 +1 @@ - *Error when uploading file: .*/Configure.xml *Error message was: ([Cc]ould *n.t resolve host:? '?-no-site-'?.*|The requested URL returned error:.*) - *Problems when submitting via HTTP diff --git a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake index b5d90d2..ed0e666 100644 --- a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake @@ -5,14 +5,19 @@ set(CASE_DROP_METHOD "http") set(CASE_DROP_SITE "-no-site-") set(CASE_CTEST_SUBMIT_ARGS "") -#----------------------------------------------------------------------------- -# Test bad argument combinations. function(run_ctest_submit CASE_NAME) set(CASE_CTEST_SUBMIT_ARGS "${ARGN}") run_ctest(${CASE_NAME}) endfunction() +function(run_ctest_submit_debug CASE_NAME) + set(CASE_CTEST_SUBMIT_ARGS "${ARGN}") + run_ctest(${CASE_NAME} "--debug") +endfunction() + +#----------------------------------------------------------------------------- +# Test bad argument combinations. run_ctest_submit(BadArg bad-arg) run_ctest_submit(BadPARTS PARTS bad-part) run_ctest_submit(BadFILES FILES bad-file) @@ -25,8 +30,8 @@ run_ctest_submit(CDashUploadNone CDASH_UPLOAD) run_ctest_submit(CDashUploadMissingFile CDASH_UPLOAD bad-upload) run_ctest_submit(CDashUploadRetry CDASH_UPLOAD ${CMAKE_CURRENT_LIST_FILE} CDASH_UPLOAD_TYPE foo RETRY_COUNT 2 RETRY_DELAY 1 INTERNAL_TEST_CHECKSUM) run_ctest_submit(CDashSubmitQuiet QUIET) -run_ctest_submit(CDashSubmitHeaders HTTPHEADER "Authorization: Bearer asdf") -run_ctest_submit(CDashUploadHeaders CDASH_UPLOAD ${CMAKE_CURRENT_LIST_FILE} CDASH_UPLOAD_TYPE foo HTTPHEADER "Authorization: Bearer asdf") +run_ctest_submit_debug(CDashSubmitHeaders HTTPHEADER "Authorization: Bearer asdf") +run_ctest_submit_debug(CDashUploadHeaders CDASH_UPLOAD ${CMAKE_CURRENT_LIST_FILE} CDASH_UPLOAD_TYPE foo HTTPHEADER "Authorization: Bearer asdf") function(run_ctest_CDashUploadFTP) set(CASE_DROP_METHOD ftp) diff --git a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-result.txt b/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-stderr.txt b/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-stderr.txt deleted file mode 100644 index af3cb2e..0000000 --- a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Error at GLOB-error-FOLLOW_SYMLINKS\.cmake:[0-9]+ \(file\): - file FOLLOW_SYMLINKS is not a valid parameter for GLOB\. -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS.cmake b/Tests/RunCMake/file/GLOB-noexp-FOLLOW_SYMLINKS.cmake index 6d467a0..6d467a0 100644 --- a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS.cmake +++ b/Tests/RunCMake/file/GLOB-noexp-FOLLOW_SYMLINKS.cmake diff --git a/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-stderr.txt b/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-stderr.txt deleted file mode 100644 index ee6cb0b..0000000 --- a/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Error at GLOB-noexp-LIST_DIRECTORIES\.cmake:[0-9]+ \(file\): - file GLOB requires a glob expression after the bool\. -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake index 342606b..b383230 100644 --- a/Tests/RunCMake/file/RunCMakeTest.cmake +++ b/Tests/RunCMake/file/RunCMakeTest.cmake @@ -39,12 +39,12 @@ run_cmake(GLOB_RECURSE-noexp-FOLLOW_SYMLINKS) # tests are valid both for GLOB and GLOB_RECURSE run_cmake(GLOB-sort-dedup) -run_cmake(GLOB-error-FOLLOW_SYMLINKS) run_cmake(GLOB-error-LIST_DIRECTORIES-not-boolean) run_cmake(GLOB-error-LIST_DIRECTORIES-no-arg) run_cmake(GLOB-error-RELATIVE-no-arg) run_cmake(GLOB-error-CONFIGURE_DEPENDS-modified) run_cmake(GLOB-noexp-CONFIGURE_DEPENDS) +run_cmake(GLOB-noexp-FOLLOW_SYMLINKS) run_cmake(GLOB-noexp-LIST_DIRECTORIES) run_cmake(GLOB-noexp-RELATIVE) run_cmake_command(GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE ${CMAKE_COMMAND} -P |