diff options
30 files changed, 242 insertions, 82 deletions
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 5fd5c5c..3f73b32 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -407,6 +407,7 @@ Variables for CTest /variable/CTEST_DROP_SITE_USER /variable/CTEST_EXTRA_COVERAGE_GLOB /variable/CTEST_GIT_COMMAND + /variable/CTEST_GIT_INIT_SUBMODULES /variable/CTEST_GIT_UPDATE_CUSTOM /variable/CTEST_GIT_UPDATE_OPTIONS /variable/CTEST_HG_COMMAND diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst index 2fdf7f3..1179f56 100644 --- a/Help/manual/ctest.1.rst +++ b/Help/manual/ctest.1.rst @@ -589,6 +589,12 @@ Configuration settings to specify the version control tool include: * `CTest Script`_ variable: :variable:`CTEST_GIT_COMMAND` * :module:`CTest` module variable: ``GITCOMMAND`` +``GITInitSubmodules`` + If set, CTest will update the repository's submodules before updating. + + * `CTest Script`_ variable: :variable:`CTEST_GIT_INIT_SUBMODULES` + * :module:`CTest` module variable: ``CTEST_GIT_INIT_SUBMODULES`` + ``GITUpdateCustom`` Specify a custom command line (as a semicolon-separated list) to run in the source tree (Git work tree) to update it instead of running diff --git a/Help/release/dev/ctest-run-submodule-sync.rst b/Help/release/dev/ctest-run-submodule-sync.rst new file mode 100644 index 0000000..c41cc2f --- /dev/null +++ b/Help/release/dev/ctest-run-submodule-sync.rst @@ -0,0 +1,9 @@ +ctest-run-submodule-sync +------------------------ + +* The :command:`ctest_update` command now looks at the + :variable:`CTEST_GIT_INIT_SUBMODULES` variable to determine whether + submodules should be updated or not before updating. +* The :command:`ctest_update` command will now synchronize submodules on an + update. Updates which add submodules or change a submodule's URL will now be + pulled properly. diff --git a/Help/release/dev/ep-tls-verify-git.rst b/Help/release/dev/ep-tls-verify-git.rst new file mode 100644 index 0000000..3c727de --- /dev/null +++ b/Help/release/dev/ep-tls-verify-git.rst @@ -0,0 +1,5 @@ +ep-tls-verify-git +----------------- + +* The :module:`ExternalProject` module now uses ``TLS_VERIFY`` when fetching + from git repositories. diff --git a/Help/variable/CTEST_GIT_INIT_SUBMODULES.rst b/Help/variable/CTEST_GIT_INIT_SUBMODULES.rst new file mode 100644 index 0000000..fd27003 --- /dev/null +++ b/Help/variable/CTEST_GIT_INIT_SUBMODULES.rst @@ -0,0 +1,5 @@ +CTEST_GIT_INIT_SUBMODULES +------------------------- + +Specify the CTest ``GITInitSubmodules`` setting +in a :manual:`ctest(1)` dashboard client script. diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index ccafb07..4f2a70c 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -185,11 +185,10 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN) # Fall back to old is-GNU test. if(NOT CMAKE_Fortran_COMPILER_ID) - exec_program(${CMAKE_Fortran_COMPILER} - ARGS ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\"" - OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN) + execute_process(COMMAND ${CMAKE_Fortran_COMPILER} ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "${CMAKE_ROOT}/Modules/CMakeTestGNU.c" + OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RESULT_VARIABLE CMAKE_COMPILER_RETURN) if(NOT CMAKE_COMPILER_RETURN) - if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_GNU") + if(CMAKE_COMPILER_OUTPUT MATCHES "THIS_IS_GNU") set(CMAKE_Fortran_COMPILER_ID "GNU") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran compiler is GNU succeeded with " @@ -200,16 +199,31 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN) "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n") endif() if(NOT CMAKE_Fortran_PLATFORM_ID) - if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_MINGW") + if(CMAKE_COMPILER_OUTPUT MATCHES "THIS_IS_MINGW") set(CMAKE_Fortran_PLATFORM_ID "MinGW") endif() - if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_CYGWIN") + if(CMAKE_COMPILER_OUTPUT MATCHES "THIS_IS_CYGWIN") set(CMAKE_Fortran_PLATFORM_ID "Cygwin") endif() endif() endif() endif() + # Fall back for GNU MINGW, which is not always detected correctly + # (__MINGW32__ is defined for the C language, but perhaps not for Fortran!) + if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_Fortran_PLATFORM_ID) + execute_process(COMMAND ${CMAKE_Fortran_COMPILER} ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "${CMAKE_ROOT}/Modules/CMakeTestGNU.c" + OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RESULT_VARIABLE CMAKE_COMPILER_RETURN) + if(NOT CMAKE_COMPILER_RETURN) + if(CMAKE_COMPILER_OUTPUT MATCHES "THIS_IS_MINGW") + set(CMAKE_Fortran_PLATFORM_ID "MinGW") + endif() + if(CMAKE_COMPILER_OUTPUT MATCHES "THIS_IS_CYGWIN") + set(CMAKE_Fortran_PLATFORM_ID "Cygwin") + endif() + endif() + endif() + # Set old compiler and platform id variables. if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") set(CMAKE_COMPILER_IS_GNUG77 1) diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index 54c53d2..31c4fef 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -2,14 +2,19 @@ # CTestCoverageCollectGCOV # ------------------------ # -# This module provides the function ``ctest_coverage_collect_gcov``. -# The function will run gcov on the .gcda files in a binary tree and then -# package all of the .gcov files into a tar file with a data.json that -# contains the source and build directories for CDash to use in parsing -# the coverage data. In addtion the Labels.json files for targets that -# have coverage information are also put in the tar file for CDash to -# asign the correct labels. This file can be sent to a CDash server for -# display with the +# This module provides the ``ctest_coverage_collect_gcov`` function. +# +# This function runs gcov on all .gcda files found in the binary tree +# and packages the resulting .gcov files into a tar file. +# This tarball also contains the following: +# +# * *data.json* defines the source and build directories for use by CDash. +# * *Labels.json* indicates any :prop_sf:`LABELS` that have been set on the +# source files. +# * The *uncovered* directory holds any uncovered files found by +# :variable:`CTEST_EXTRA_COVERAGE_GLOB`. +# +# After generating this tar file, it can be sent to CDash for display with the # :command:`ctest_submit(CDASH_UPLOAD)` command. # # .. command:: cdash_coverage_collect_gcov @@ -172,6 +177,21 @@ function(ctest_coverage_collect_gcov) set(unfiltered_gcov_files) file(GLOB_RECURSE unfiltered_gcov_files RELATIVE ${binary_dir} "${coverage_dir}/*.gcov") + # if CTEST_EXTRA_COVERAGE_GLOB was specified we search for files + # that might be uncovered + if (DEFINED CTEST_EXTRA_COVERAGE_GLOB) + set(uncovered_files) + foreach(search_entry IN LISTS CTEST_EXTRA_COVERAGE_GLOB) + if(NOT GCOV_QUIET) + message("Add coverage glob: ${search_entry}") + endif() + file(GLOB_RECURSE matching_files "${source_dir}/${search_entry}") + if (matching_files) + list(APPEND uncovered_files "${matching_files}") + endif() + endforeach() + endif() + set(gcov_files) foreach(gcov_file ${unfiltered_gcov_files}) file(STRINGS ${binary_dir}/${gcov_file} first_line LIMIT_COUNT 1 ENCODING UTF-8) @@ -195,20 +215,62 @@ function(ctest_coverage_collect_gcov) endif() endforeach() + get_filename_component(resolved_source_file "${source_file}" ABSOLUTE) + foreach(uncovered_file IN LISTS uncovered_files) + get_filename_component(resolved_uncovered_file "${uncovered_file}" ABSOLUTE) + if (resolved_uncovered_file STREQUAL resolved_source_file) + list(REMOVE_ITEM uncovered_files "${uncovered_file}") + endif() + endforeach() + if(NOT is_excluded) list(APPEND gcov_files ${gcov_file}) endif() endforeach() + foreach (uncovered_file ${uncovered_files}) + # Check if this uncovered file should be excluded. + set(is_excluded false) + foreach(exclude_entry IN LISTS CTEST_CUSTOM_COVERAGE_EXCLUDE) + if(uncovered_file MATCHES "${exclude_entry}") + set(is_excluded true) + if(NOT GCOV_QUIET) + message("Excluding coverage for: ${uncovered_file} which matches ${exclude_entry}") + endif() + break() + endif() + endforeach() + if(is_excluded) + continue() + endif() + + # Copy from source to binary dir, preserving any intermediate subdirectories. + get_filename_component(filename "${uncovered_file}" NAME) + get_filename_component(relative_path "${uncovered_file}" DIRECTORY) + string(REPLACE "${source_dir}" "" relative_path "${relative_path}") + if (relative_path) + # Strip leading slash. + string(SUBSTRING "${relative_path}" 1 -1 relative_path) + endif() + file(COPY ${uncovered_file} DESTINATION ${binary_dir}/uncovered/${relative_path}) + if(relative_path) + list(APPEND uncovered_files_for_tar uncovered/${relative_path}/${filename}) + else() + list(APPEND uncovered_files_for_tar uncovered/${filename}) + endif() + endforeach() + # tar up the coverage info with the same date so that the md5 # sum will be the same for the tar file independent of file time # stamps string(REPLACE ";" "\n" gcov_files "${gcov_files}") string(REPLACE ";" "\n" label_files "${label_files}") + string(REPLACE ";" "\n" uncovered_files_for_tar "${uncovered_files_for_tar}") file(WRITE "${coverage_dir}/coverage_file_list.txt" "${gcov_files} ${coverage_dir}/data.json ${label_files} +${uncovered_files_for_tar} ") if (GCOV_QUIET) diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in index 2da8354..0ff2eed 100644 --- a/Modules/DartConfiguration.tcl.in +++ b/Modules/DartConfiguration.tcl.in @@ -52,6 +52,7 @@ SVNUpdateOptions: @SVN_UPDATE_OPTIONS@ # Git options GITCommand: @GITCOMMAND@ +GITInitSubmodules: @CTEST_GIT_INIT_SUBMODULES@ GITUpdateOptions: @GIT_UPDATE_OPTIONS@ GITUpdateCustom: @CTEST_GIT_UPDATE_CUSTOM@ diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 1185a81..1f3dc38 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -499,7 +499,7 @@ define_property(DIRECTORY PROPERTY "EP_UPDATE_DISCONNECTED" INHERITED "ExternalProject module." ) -function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_remote_name git_submodules src_name work_dir gitclone_infofile gitclone_stampfile) +function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_remote_name git_submodules src_name work_dir gitclone_infofile gitclone_stampfile tls_verify) file(WRITE ${script_filename} "if(\"${git_tag}\" STREQUAL \"\") message(FATAL_ERROR \"Tag for git checkout should not be empty.\") @@ -524,12 +524,21 @@ if(error_code) message(FATAL_ERROR \"Failed to remove directory: '${source_dir}'\") endif() +set(git_options) + +# disable cert checking if explicitly told not to do it +set(tls_verify \"${tls_verify}\") +if(NOT \"x${tls_verify}\" STREQUAL \"x\" AND NOT tls_verify) + list(APPEND git_options + -c http.sslVerify=false) +endif() + # try the clone 3 times incase there is an odd git clone issue set(error_code 1) set(number_of_tries 0) while(error_code AND number_of_tries LESS 3) execute_process( - COMMAND \"${git_EXECUTABLE}\" clone --origin \"${git_remote_name}\" \"${git_repository}\" \"${src_name}\" + COMMAND \"${git_EXECUTABLE}\" \${git_options} clone --origin \"${git_remote_name}\" \"${git_repository}\" \"${src_name}\" WORKING_DIRECTORY \"${work_dir}\" RESULT_VARIABLE error_code ) @@ -544,7 +553,7 @@ if(error_code) endif() execute_process( - COMMAND \"${git_EXECUTABLE}\" checkout ${git_tag} + COMMAND \"${git_EXECUTABLE}\" \${git_options} checkout ${git_tag} WORKING_DIRECTORY \"${work_dir}/${src_name}\" RESULT_VARIABLE error_code ) @@ -553,7 +562,7 @@ if(error_code) endif() execute_process( - COMMAND \"${git_EXECUTABLE}\" submodule init ${git_submodules} + COMMAND \"${git_EXECUTABLE}\" \${git_options} submodule init ${git_submodules} WORKING_DIRECTORY \"${work_dir}/${src_name}\" RESULT_VARIABLE error_code ) @@ -562,7 +571,7 @@ if(error_code) endif() execute_process( - COMMAND \"${git_EXECUTABLE}\" submodule update --recursive ${git_submodules} + COMMAND \"${git_EXECUTABLE}\" \${git_options} submodule update --recursive ${git_submodules} WORKING_DIRECTORY \"${work_dir}/${src_name}\" RESULT_VARIABLE error_code ) @@ -850,12 +859,15 @@ function(_ep_write_downloadfile_script script_filename remote local timeout no_p set(hash_check "") endif() + set(tls_verify_code "") + set(tls_cainfo_code "") + # check for curl globals in the project if(DEFINED CMAKE_TLS_VERIFY) - set(tls_verify "set(CMAKE_TLS_VERIFY ${CMAKE_TLS_VERIFY})") + set(tls_verify_code "set(CMAKE_TLS_VERIFY ${CMAKE_TLS_VERIFY})") endif() if(DEFINED CMAKE_TLS_CAINFO) - set(tls_cainfo "set(CMAKE_TLS_CAINFO \"${CMAKE_TLS_CAINFO}\")") + set(tls_cainfo_code "set(CMAKE_TLS_CAINFO \"${CMAKE_TLS_CAINFO}\")") endif() # now check for curl locals so that the local values @@ -864,12 +876,12 @@ function(_ep_write_downloadfile_script script_filename remote local timeout no_p # check for tls_verify argument string(LENGTH "${tls_verify}" tls_verify_len) if(tls_verify_len GREATER 0) - set(tls_verify "set(CMAKE_TLS_VERIFY ${tls_verify})") + set(tls_verify_code "set(CMAKE_TLS_VERIFY ${tls_verify})") endif() # check for tls_cainfo argument string(LENGTH "${tls_cainfo}" tls_cainfo_len) if(tls_cainfo_len GREATER 0) - set(tls_cainfo "set(CMAKE_TLS_CAINFO \"${tls_cainfo}\")") + set(tls_cainfo_code "set(CMAKE_TLS_CAINFO \"${tls_cainfo}\")") endif() file(WRITE ${script_filename} @@ -878,8 +890,8 @@ function(_ep_write_downloadfile_script script_filename remote local timeout no_p dst='${local}' timeout='${timeout_msg}'\") -${tls_verify} -${tls_cainfo} +${tls_verify_code} +${tls_cainfo_code} file(DOWNLOAD \"${remote}\" @@ -1777,6 +1789,11 @@ function(_ep_add_download_command name) set(git_remote_name "origin") endif() + get_property(tls_verify TARGET ${name} PROPERTY _EP_TLS_VERIFY) + if("x${tls_verify}" STREQUAL "x" AND DEFINED CMAKE_TLS_VERIFY) + set(tls_verify "${CMAKE_TLS_VERIFY}") + endif() + # For the download step, and the git clone operation, only the repository # should be recorded in a configured RepositoryInfo file. If the repo # changes, the clone script should be run again. But if only the tag @@ -1801,7 +1818,7 @@ function(_ep_add_download_command name) # _ep_write_gitclone_script(${tmp_dir}/${name}-gitclone.cmake ${source_dir} ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${git_remote_name} "${git_submodules}" ${src_name} ${work_dir} - ${stamp_dir}/${name}-gitinfo.txt ${stamp_dir}/${name}-gitclone-lastrun.txt + ${stamp_dir}/${name}-gitinfo.txt ${stamp_dir}/${name}-gitclone-lastrun.txt "${tls_verify}" ) set(comment "Performing download step (git clone) for '${name}'") set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitclone.cmake) diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index 546ada1..728494c 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -59,12 +59,7 @@ set(CMAKE_REQUIRED_QUIET ${BLAS_FIND_QUIETLY}) set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) # Check the language being used -get_property( _LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES ) -if( _LANGUAGES_ MATCHES Fortran ) - set( _CHECK_FORTRAN TRUE ) -elseif( (_LANGUAGES_ MATCHES C) OR (_LANGUAGES_ MATCHES CXX) ) - set( _CHECK_FORTRAN FALSE ) -else() +if( NOT (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED OR CMAKE_Fortran_COMPILER_LOADED) ) if(BLAS_FIND_REQUIRED) message(FATAL_ERROR "FindBLAS requires Fortran, C, or C++ to be enabled.") else() @@ -132,7 +127,7 @@ if(_libraries_work) # Test this combination of libraries. set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_thread}) # message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - if (_CHECK_FORTRAN) + if (CMAKE_Fortran_COMPILER_LOADED) check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS) else() check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS) @@ -483,7 +478,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") if (NOT WIN32) set(LM "-lm") endif () - if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) + if (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED) if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) find_package(Threads) else() diff --git a/Modules/FindGSL.cmake b/Modules/FindGSL.cmake index ef125c0..9318a7d 100644 --- a/Modules/FindGSL.cmake +++ b/Modules/FindGSL.cmake @@ -45,7 +45,7 @@ # of GSL installation discovered. These variables may optionally be set to # help this module find the correct files:: # -# GSL_CLBAS_LIBRARY - Location of the GSL CBLAS library. +# GSL_CBLAS_LIBRARY - Location of the GSL CBLAS library. # GSL_CBLAS_LIBRARY_DEBUG - Location of the debug GSL CBLAS library (if any). # GSL_CONFIG_EXECUTABLE - Location of the ``gsl-config`` script (if any). # GSL_LIBRARY - Location of the GSL library. diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake index 2708de0..a6bf89f 100644 --- a/Modules/FindLAPACK.cmake +++ b/Modules/FindLAPACK.cmake @@ -48,11 +48,20 @@ set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) -get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES) -if (NOT _LANGUAGES_ MATCHES Fortran) -include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake) -else () +# Check the language being used +if( NOT (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED OR CMAKE_Fortran_COMPILER_LOADED) ) + if(LAPACK_FIND_REQUIRED) + message(FATAL_ERROR "FindLAPACK requires Fortran, C, or C++ to be enabled.") + else() + message(STATUS "Looking for LAPACK... - NOT found (Unsupported languages)") + return() + endif() +endif() + +if (CMAKE_Fortran_COMPILER_LOADED) include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake) +else () +include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake) endif () include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake) @@ -125,7 +134,7 @@ if(_libraries_work) set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads}) endif() # message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - if (NOT _LANGUAGES_ MATCHES Fortran) + if (NOT CMAKE_Fortran_COMPILER_LOADED) check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS) else () check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS) @@ -250,7 +259,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") if (NOT WIN32) set(LM "-lm") endif () - if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) + if (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED) if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) find_PACKAGE(Threads) else() diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 8b4b988..8dbaf11 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -151,6 +151,7 @@ if(WIN32 AND NOT CYGWIN) NAMES libeay32${_OPENSSL_MSVC_RT_MODE}d libeay32d + NAMES_PER_DIR ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES ${_OPENSSL_PATH_SUFFIXES} @@ -160,6 +161,7 @@ if(WIN32 AND NOT CYGWIN) NAMES libeay32${_OPENSSL_MSVC_RT_MODE} libeay32 + NAMES_PER_DIR ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES ${_OPENSSL_PATH_SUFFIXES} @@ -169,6 +171,7 @@ if(WIN32 AND NOT CYGWIN) NAMES ssleay32${_OPENSSL_MSVC_RT_MODE}d ssleay32d + NAMES_PER_DIR ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES ${_OPENSSL_PATH_SUFFIXES} @@ -179,6 +182,7 @@ if(WIN32 AND NOT CYGWIN) ssleay32${_OPENSSL_MSVC_RT_MODE} ssleay32 ssl + NAMES_PER_DIR ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES ${_OPENSSL_PATH_SUFFIXES} @@ -205,6 +209,7 @@ if(WIN32 AND NOT CYGWIN) find_library(LIB_EAY NAMES ${LIB_EAY_NAMES} + NAMES_PER_DIR ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES "lib" @@ -214,6 +219,7 @@ if(WIN32 AND NOT CYGWIN) find_library(SSL_EAY NAMES ${SSL_EAY_NAMES} + NAMES_PER_DIR ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES "lib" @@ -231,6 +237,7 @@ if(WIN32 AND NOT CYGWIN) find_library(LIB_EAY NAMES libeay32 + NAMES_PER_DIR ${_OPENSSL_ROOT_HINTS_AND_PATHS} HINTS ${_OPENSSL_LIBDIR} @@ -241,6 +248,7 @@ if(WIN32 AND NOT CYGWIN) find_library(SSL_EAY NAMES ssleay32 + NAMES_PER_DIR ${_OPENSSL_ROOT_HINTS_AND_PATHS} HINTS ${_OPENSSL_LIBDIR} @@ -260,6 +268,7 @@ else() ssl ssleay32 ssleay32MD + NAMES_PER_DIR ${_OPENSSL_ROOT_HINTS_AND_PATHS} HINTS ${_OPENSSL_LIBDIR} @@ -270,6 +279,7 @@ else() find_library(OPENSSL_CRYPTO_LIBRARY NAMES crypto + NAMES_PER_DIR ${_OPENSSL_ROOT_HINTS_AND_PATHS} HINTS ${_OPENSSL_LIBDIR} diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake index 3850890..b59fe34 100644 --- a/Modules/UseJava.cmake +++ b/Modules/UseJava.cmake @@ -389,7 +389,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake) function (__java_copy_file src dest comment) add_custom_command( OUTPUT ${dest} - COMMAND cmake -E copy_if_different + COMMAND ${CMAKE_COMMAND} -E copy_if_different ARGS ${src} ${dest} DEPENDS ${src} diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 12f9ce4..4ddd423 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 5) -set(CMake_VERSION_PATCH 20160404) +set(CMake_VERSION_PATCH 20160407) #set(CMake_VERSION_RC 1) diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index bbb3b9d..1d6bdce 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -273,21 +273,60 @@ bool cmCTestGIT::UpdateImpl() std::string top_dir = this->FindTopDir(); const char* git = this->CommandLineTool.c_str(); const char* recursive = "--recursive"; + const char* sync_recursive = "--recursive"; - // Git < 1.6.5.0 did not support --recursive + // Git < 1.6.5 did not support submodule --recursive if(this->GetGitVersion() < cmCTestGITVersion(1,6,5,0)) { recursive = 0; - // No need to require >= 1.6.5.0 if there are no submodules. + // No need to require >= 1.6.5 if there are no submodules. if(cmSystemTools::FileExists((top_dir + "/.gitmodules").c_str())) { - this->Log << "Git < 1.6.5.0 cannot update submodules recursively\n"; + this->Log << "Git < 1.6.5 cannot update submodules recursively\n"; + } + } + + // Git < 1.8.1 did not support sync --recursive + if(this->GetGitVersion() < cmCTestGITVersion(1,8,1,0)) + { + sync_recursive = 0; + // No need to require >= 1.8.1 if there are no submodules. + if(cmSystemTools::FileExists((top_dir + "/.gitmodules").c_str())) + { + this->Log << "Git < 1.8.1 cannot synchronize submodules recursively\n"; } } - char const* git_submodule[] = {git, "submodule", "update", recursive, 0}; OutputLogger submodule_out(this->Log, "submodule-out> "); OutputLogger submodule_err(this->Log, "submodule-err> "); + + bool ret; + + std::string init_submodules = + this->CTest->GetCTestConfiguration("GITInitSubmodules"); + if (cmSystemTools::IsOn(init_submodules.c_str())) + { + char const* git_submodule_init[] = {git, "submodule", "init", 0}; + ret = this->RunChild(git_submodule_init, &submodule_out, &submodule_err, + top_dir.c_str()); + + if (!ret) + { + return false; + } + } + + char const* git_submodule_sync[] = {git, "submodule", "sync", + sync_recursive, 0}; + ret = this->RunChild(git_submodule_sync, &submodule_out, &submodule_err, + top_dir.c_str()); + + if (!ret) + { + return false; + } + + char const* git_submodule[] = {git, "submodule", "update", recursive, 0}; return this->RunChild(git_submodule, &submodule_out, &submodule_err, top_dir.c_str()); } diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx index dfda9f1..1bf60fc 100644 --- a/Source/CTest/cmCTestUpdateCommand.cxx +++ b/Source/CTest/cmCTestUpdateCommand.cxx @@ -55,6 +55,8 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler() this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, "GITUpdateOptions", "CTEST_GIT_UPDATE_OPTIONS", this->Quiet); this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, + "GITInitSubmodules", "CTEST_GIT_INIT_SUBMODULES", this->Quiet); + this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, "GITUpdateCustom", "CTEST_GIT_UPDATE_CUSTOM", this->Quiet); this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, "UpdateVersionOnly", "CTEST_UPDATE_VERSION_ONLY", this->Quiet); diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx index 3ed5cb0..515d041 100644 --- a/Source/CTest/cmParseCoberturaCoverage.cxx +++ b/Source/CTest/cmParseCoberturaCoverage.cxx @@ -125,7 +125,6 @@ protected: std::string line; FileLinesType& curFileLines = this->Coverage.TotalCoverage[this->CurFileName]; - curFileLines.push_back(-1); while(cmSystemTools::GetLineFromStream(fin, line)) { curFileLines.push_back(-1); diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index d17d664..c64e813 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -117,7 +117,7 @@ void cmFLTKWrapUICommand::FinalPass() // people should add the srcs to the target themselves, but the old command // didn't support that, so check and see if they added the files in and if // they didn;t then print a warning and add then anyhow - cmTarget* target = this->Makefile->FindTarget(this->Target); + cmTarget* target = this->Makefile->FindLocalNonAliasTarget(this->Target); if(!target) { std::string msg = diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx index c175e62..b3b2f16 100644 --- a/Source/cmFortranParserImpl.cxx +++ b/Source/cmFortranParserImpl.cxx @@ -229,7 +229,7 @@ void cmFortranParser_RuleLineDirective(cmFortranParser* parser, cmSystemTools::ConvertToUnixSlashes(included); // Save the named file as included in the source. - if (cmSystemTools::FileExists(included)) + if (cmSystemTools::FileExists(included, true)) { parser->Info.Includes.insert(included); } diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 26a1485..f70f252 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -388,7 +388,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) return false; } // Lookup this target in the current directory. - if(cmTarget* target=this->Makefile->FindTarget(*targetIt)) + if(cmTarget* target=this->Makefile->FindLocalNonAliasTarget(*targetIt)) { // Found the target. Check its type. if(target->GetType() != cmState::EXECUTABLE && diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 3d44fe2..6a944bf 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -448,7 +448,7 @@ cmInstallTargetGenerator::GetInstallFilename(cmGeneratorTarget const* target, void cmInstallTargetGenerator::Compute(cmLocalGenerator* lg) { - this->Target = lg->FindGeneratorTarget(this->TargetName); + this->Target = lg->FindLocalNonAliasGeneratorTarget(this->TargetName); } //---------------------------------------------------------------------------- diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 1be39a9..0195b9e 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -485,19 +485,9 @@ private: std::string Name; }; -cmGeneratorTarget* cmLocalGenerator::FindGeneratorTarget( +cmGeneratorTarget* cmLocalGenerator::FindLocalNonAliasGeneratorTarget( const std::string& name) const { - std::map<std::string, std::string>::const_iterator i = - this->AliasTargets.find(name); - if (i != this->AliasTargets.end()) - { - std::vector<cmGeneratorTarget*>::const_iterator ai = - std::find_if(this->GeneratorTargets.begin(), - this->GeneratorTargets.end(), - NamedGeneratorTargetFinder(i->second)); - return *ai; - } std::vector<cmGeneratorTarget*>::const_iterator ti = std::find_if(this->GeneratorTargets.begin(), this->GeneratorTargets.end(), @@ -506,7 +496,6 @@ cmGeneratorTarget* cmLocalGenerator::FindGeneratorTarget( { return *ti; } - return 0; } @@ -1839,7 +1828,7 @@ cmLocalGenerator::FindGeneratorTargetToUse(const std::string& name) const return *imported; } - if(cmGeneratorTarget* t = this->FindGeneratorTarget(name)) + if(cmGeneratorTarget* t = this->FindLocalNonAliasGeneratorTarget(name)) { return t; } diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 68e7667..b673a85 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -129,7 +129,8 @@ public: void AddImportedGeneratorTarget(cmGeneratorTarget* gt); void AddOwnedImportedGeneratorTarget(cmGeneratorTarget* gt); - cmGeneratorTarget* FindGeneratorTarget(const std::string& name) const; + cmGeneratorTarget* + FindLocalNonAliasGeneratorTarget(const std::string& name) const; cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const; /** diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index aa6f7c8..7ca005d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4026,25 +4026,13 @@ std::vector<std::string> cmMakefile::GetPropertyKeys() const return this->StateSnapshot.GetDirectory().GetPropertyKeys(); } -cmTarget* cmMakefile::FindTarget(const std::string& name, - bool excludeAliases) const +cmTarget* cmMakefile::FindLocalNonAliasTarget(const std::string& name) const { - if (!excludeAliases) - { - std::map<std::string, std::string>::const_iterator i = - this->AliasTargets.find(name); - if (i != this->AliasTargets.end()) - { - cmTargets::iterator ai = this->Targets.find(i->second); - return &ai->second; - } - } cmTargets::iterator i = this->Targets.find( name ); if ( i != this->Targets.end() ) { return &i->second; } - return 0; } @@ -4215,7 +4203,7 @@ cmTarget* cmMakefile::FindTargetToUse(const std::string& name, } // Look for a target built in this directory. - if(cmTarget* t = this->FindTarget(name, excludeAliases)) + if(cmTarget* t = this->FindLocalNonAliasTarget(name)) { return t; } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 362ea75..45f2efb 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -388,8 +388,7 @@ public: } std::vector<cmTarget*> GetImportedTargets() const; - cmTarget* FindTarget(const std::string& name, - bool excludeAliases = false) const; + cmTarget* FindLocalNonAliasTarget(const std::string& name) const; /** Find a target to use in place of the given name. The target returned may be imported or built within the project. */ diff --git a/Tests/AliasTarget/subdir/CMakeLists.txt b/Tests/AliasTarget/subdir/CMakeLists.txt index 8c84aea..05a7d86 100644 --- a/Tests/AliasTarget/subdir/CMakeLists.txt +++ b/Tests/AliasTarget/subdir/CMakeLists.txt @@ -1,3 +1,8 @@ add_library(tgt STATIC empty.cpp) add_library(Sub::tgt ALIAS tgt) + +# foo comes from the top-level CMakeLists.txt +add_library(Top::foo ALIAS foo) +get_target_property(some_prop Top::foo SOME_PROP) +target_link_libraries(tgt Top::foo) diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/extra/uncovered1.cpp b/Tests/CTestCoverageCollectGCOV/TestProject/extra/uncovered1.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/extra/uncovered1.cpp diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/uncovered2.cpp b/Tests/CTestCoverageCollectGCOV/TestProject/uncovered2.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/uncovered2.cpp diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in index b2e6d6d..d48ef61 100644 --- a/Tests/CTestCoverageCollectGCOV/test.cmake.in +++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in @@ -15,7 +15,9 @@ list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE "/foo/something" "/3rdparty/" "/bar/somethingelse" + "/CMakeFiles/" ) +list(APPEND CTEST_EXTRA_COVERAGE_GLOB "*.cpp") include(CTestCoverageCollectGCOV) set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.tar) @@ -41,6 +43,8 @@ set(expected_out Testing/CoverageInfo/data.json Testing/CoverageInfo/extra.cpp.gcov Testing/CoverageInfo/main.cpp.gcov + uncovered/extra/uncovered1.cpp + uncovered/uncovered2.cpp ) if("${out}" STREQUAL "${expected_out}") |