summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineFortranCompiler.cmake26
-rw-r--r--Modules/DartConfiguration.tcl.in1
-rw-r--r--Modules/ExternalProject.cmake23
-rw-r--r--Modules/FindBLAS.cmake11
-rw-r--r--Modules/FindGSL.cmake2
-rw-r--r--Modules/FindLAPACK.cmake21
6 files changed, 57 insertions, 27 deletions
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/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..8d8382f 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,18 @@ if(error_code)
message(FATAL_ERROR \"Failed to remove directory: '${source_dir}'\")
endif()
+set(git_options)
+if(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 +550,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 +559,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 +568,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
)
@@ -1777,6 +1783,11 @@ function(_ep_add_download_command name)
set(git_remote_name "origin")
endif()
+ get_property(tls_verify TARGET ${name} PROPERTY _EP_TLS_VERIFY)
+ if(NOT tls_verify)
+ set(tls_verify OFF)
+ 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 +1812,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()