Skip to content

Commit

Permalink
[CMake] Remove dead NO_CONNECTION AND fail-on-missing code branches
Browse files Browse the repository at this point in the history
The connection check if not done anymore if `fail-on-missing=ON` and
`NO_CONNECTION` is always set to false. Now, the configuration will fail
at download time, and not with fatal errors in
`SearchInstalledSoftware`. Therefore, the corresponding code branches
can be removed.
  • Loading branch information
guitargeek committed May 9, 2024
1 parent dcfa5c7 commit da32e95
Showing 1 changed file with 33 additions and 89 deletions.
122 changes: 33 additions & 89 deletions cmake/modules/SearchInstalledSoftware.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -484,12 +484,8 @@ endif()
#---Check for GSL library---------------------------------------------------------------
if(mathmore OR builtin_gsl)
if(builtin_gsl AND NO_CONNECTION)
if(fail-on-missing)
message(FATAL_ERROR "No internet connection. Please check your connection, or either disable the 'builtin_gsl' option or the 'fail-on-missing' to automatically disable options requiring internet access")
else()
message(STATUS "No internet connection, disabling 'builtin_gsl' option")
set(builtin_gsl OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()
message(STATUS "No internet connection, disabling 'builtin_gsl' option")
set(builtin_gsl OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()
message(STATUS "Looking for GSL")
if(NOT builtin_gsl)
Expand Down Expand Up @@ -673,12 +669,8 @@ if(ssl AND NOT builtin_openssl)
set(ssl OFF CACHE BOOL "Disabled because OpenSSL not found and builtin version only works on macOS (${ssl_description})" FORCE)
else()
if(NO_CONNECTION)
if(fail-on-missing)
message(FATAL_ERROR "No internet connection and OpenSSL was not found. Please check your connection, or either disable the 'ssl' option or the 'fail-on-missing' to automatically disable options requiring internet access")
else()
message(STATUS "OpenSSL not found, and no internet connection. Disabing the 'ssl' option.")
set(ssl OFF CACHE BOOL "Disabled because ssl requested and OpenSSL not found (${builtin_openssl_description}) and there is no internet connection" FORCE)
endif()
message(STATUS "OpenSSL not found, and no internet connection. Disabing the 'ssl' option.")
set(ssl OFF CACHE BOOL "Disabled because ssl requested and OpenSSL not found (${builtin_openssl_description}) and there is no internet connection" FORCE)
else()
message(STATUS "OpenSSL not found, switching ON 'builtin_openssl' option.")
set(builtin_openssl ON CACHE BOOL "Enabled because ssl requested and OpenSSL not found (${builtin_openssl_description})" FORCE)
Expand All @@ -690,13 +682,9 @@ endif()

if(builtin_openssl)
if(NO_CONNECTION)
if(fail-on-missing)
message(FATAL_ERROR "No internet connection. Please check your connection, or either disable the 'builtin_openssl' option or the 'fail-on-missing' to automatically disable options requiring internet access")
else()
message(STATUS "No internet connection, disabling the 'ssl' and 'builtin_openssl' options")
set(builtin_openssl OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
set(ssl OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()
message(STATUS "No internet connection, disabling the 'ssl' and 'builtin_openssl' options")
set(builtin_openssl OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
set(ssl OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
else()
list(APPEND ROOT_BUILTINS OpenSSL)
add_subdirectory(builtins/openssl)
Expand Down Expand Up @@ -789,12 +777,8 @@ if(pythia8)
endif()

if(builtin_fftw3 AND NO_CONNECTION)
if(fail-on-missing)
message(FATAL_ERROR "No internet connection. Please check your connection, or either disable the 'builtin_fftw3' option or the 'fail-on-missing' to automatically disable options requiring internet access")
else()
message(STATUS "No internet connection, disabling 'builtin_fftw3' option")
set(builtin_fftw3 OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()
message(STATUS "No internet connection, disabling 'builtin_fftw3' option")
set(builtin_fftw3 OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()

#---Check for FFTW3-------------------------------------------------------------------
Expand Down Expand Up @@ -838,12 +822,8 @@ endif()
#---Check for fitsio-------------------------------------------------------------------
if(fitsio OR builtin_cfitsio)
if(builtin_cfitsio AND NO_CONNECTION)
if(fail-on-missing)
message(FATAL_ERROR "No internet connection. Please check your connection, or either disable the 'builtin_cfitsio' option or the 'fail-on-missing' to automatically disable options requiring internet access")
else()
message(STATUS "No internet connection, disabling 'builtin_cfitsio' option")
set(builtin_cfitsio OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()
message(STATUS "No internet connection, disabling 'builtin_cfitsio' option")
set(builtin_cfitsio OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()
if(builtin_cfitsio)
set(cfitsio_version 3.450)
Expand Down Expand Up @@ -943,13 +923,9 @@ if(xrootd AND NOT builtin_xrootd)
endif()

if(builtin_xrootd AND NO_CONNECTION)
if(fail-on-missing)
message(FATAL_ERROR "No internet connection. Please check your connection, or either disable the 'builtin_xrootd' option or the 'fail-on-missing' to automatically disable options requiring internet access")
else()
message(STATUS "No internet connection, disabling 'builtin_xrootd' option")
set(builtin_xrootd OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
set(xrootd OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()
message(STATUS "No internet connection, disabling 'builtin_xrootd' option")
set(builtin_xrootd OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
set(xrootd OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()
if(builtin_xrootd)
list(APPEND ROOT_BUILTINS XROOTD)
Expand Down Expand Up @@ -1098,13 +1074,9 @@ endif()

if(builtin_davix)
if(NO_CONNECTION)
if(fail-on-missing)
message(FATAL_ERROR "No internet connection. Please check your connection, or either disable the 'builtin_davix' option or the 'fail-on-missing' to automatically disable options requiring internet access")
else()
message(STATUS "No internet connection, disabling the 'davix' and 'builtin_davix' options")
set(builtin_davix OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
set(davix OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()
message(STATUS "No internet connection, disabling the 'davix' and 'builtin_davix' options")
set(builtin_davix OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
set(davix OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
else()
list(APPEND ROOT_BUILTINS Davix)
add_subdirectory(builtins/davix)
Expand Down Expand Up @@ -1223,13 +1195,9 @@ int main() { return 0; }" tbb_exception_result)
endif()

if(builtin_tbb AND NO_CONNECTION)
if(fail-on-missing)
message(FATAL_ERROR "No internet connection. Please check your connection, or either disable the 'builtin_tbb' option or the 'fail-on-missing' to automatically disable options requiring internet access")
else()
message(STATUS "No internet connection, disabling 'builtin_tbb' and 'imt' options")
set(builtin_tbb OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
set(imt OFF CACHE BOOL "Disabled because 'builtin_tbb' was set but there is no internet connection" FORCE)
endif()
message(STATUS "No internet connection, disabling 'builtin_tbb' and 'imt' options")
set(builtin_tbb OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
set(imt OFF CACHE BOOL "Disabled because 'builtin_tbb' was set but there is no internet connection" FORCE)
endif()

if(builtin_tbb)
Expand Down Expand Up @@ -1307,12 +1275,8 @@ elseif(vc)
endif()

if(vc AND NOT Vc_FOUND AND NO_CONNECTION)
if(fail-on-missing)
message(FATAL_ERROR "No internet connection. Please check your connection, or either disable the 'vc' option or the 'fail-on-missing' to automatically disable options requiring internet access")
else()
message(STATUS "No internet connection, disabling the 'vc' option")
set(vc OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()
message(STATUS "No internet connection, disabling the 'vc' option")
set(vc OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()

if(vc AND NOT Vc_FOUND)
Expand Down Expand Up @@ -1408,12 +1372,8 @@ elseif(veccore)
endif()

if(builtin_veccore AND NO_CONNECTION)
if(fail-on-missing)
message(FATAL_ERROR "No internet connection. Please check your connection, or either disable the 'builtin_veccore' option or the 'fail-on-missing' to automatically disable options requiring internet access")
else()
message(STATUS "No internet connection, disabling the 'builtin_veccore' option")
set(builtin_veccore OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()
message(STATUS "No internet connection, disabling the 'builtin_veccore' option")
set(builtin_veccore OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()

if(builtin_veccore)
Expand Down Expand Up @@ -1481,12 +1441,8 @@ if(builtin_veccore)
endif()

if(builtin_vdt AND NO_CONNECTION)
if(fail-on-missing)
message(FATAL_ERROR "No internet connection. Please check your connection, or either disable the 'builtin_vdt' option or the 'fail-on-missing' to automatically disable options requiring internet access")
else()
message(STATUS "No internet connection, disabling the 'builtin_vdt' option")
set(builtin_vdt OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()
message(STATUS "No internet connection, disabling the 'builtin_vdt' option")
set(builtin_vdt OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()

#---Check for Vdt--------------------------------------------------------------------
Expand Down Expand Up @@ -1789,12 +1745,8 @@ if (testing)
find_package(GTest)
if(NOT GTEST_FOUND)
if(NO_CONNECTION)
if(fail-on-missing)
message(FATAL_ERROR "No internet connection and GTest was not found. Please check your connection, or either disable the 'testing' option or the 'fail-on-missing' to automatically disable options requiring internet access")
else()
message(STATUS "GTest not found, and no internet connection. Disabing the 'testing' option.")
set(testing OFF CACHE BOOL "Disabled because testing requested and GTest not found (${builtin_gtest_description}) and there is no internet connection" FORCE)
endif()
message(STATUS "GTest not found, and no internet connection. Disabing the 'testing' option.")
set(testing OFF CACHE BOOL "Disabled because testing requested and GTest not found (${builtin_gtest_description}) and there is no internet connection" FORCE)
else()
message(STATUS "GTest not found, switching ON 'builtin_gtest' option.")
set(builtin_gtest ON CACHE BOOL "Enabled because testing requested and GTest not found (${builtin_gtest_description})" FORCE)
Expand All @@ -1803,13 +1755,9 @@ if (testing)
endif()
else()
if(NO_CONNECTION)
if(fail-on-missing)
message(FATAL_ERROR "No internet connection. Please check your connection, or either disable the 'testing' option or the 'builtin_gtest' option or the 'fail-on-missing' option to automatically disable options requiring internet access")
else()
message(STATUS "No internet connection, disabling the 'testing' and 'builtin_gtest' options")
set(testing OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
set(builtin_gtest OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()
message(STATUS "No internet connection, disabling the 'testing' and 'builtin_gtest' options")
set(testing OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
set(builtin_gtest OFF CACHE BOOL "Disabled because there is no internet connection" FORCE)
endif()
endif()
endif()
Expand Down Expand Up @@ -1911,12 +1859,8 @@ if (builtin_gtest)
endif()

if(webgui AND NOT builtin_openui5 AND NO_CONNECTION)
if(fail-on-missing)
message(FATAL_ERROR "No internet connection. Please check your connection, or either enable the 'builtin_openui5' option or the 'fail-on-missing' to automatically disable options requiring internet access")
else()
message(STATUS "No internet connection, switching to 'builtin_openui5' option")
set(builtin_openui5 ON CACHE BOOL "Enabled because there is no internet connection" FORCE)
endif()
message(STATUS "No internet connection, switching to 'builtin_openui5' option")
set(builtin_openui5 ON CACHE BOOL "Enabled because there is no internet connection" FORCE)
endif()

#------------------------------------------------------------------------------------
Expand Down

0 comments on commit da32e95

Please sign in to comment.