diff options
-rw-r--r-- | Modules/CMakeParseImplicitIncludeInfo.cmake | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/Modules/CMakeParseImplicitIncludeInfo.cmake b/Modules/CMakeParseImplicitIncludeInfo.cmake index a8e6ac0b6e..5c0eda2703 100644 --- a/Modules/CMakeParseImplicitIncludeInfo.cmake +++ b/Modules/CMakeParseImplicitIncludeInfo.cmake @@ -12,9 +12,9 @@ function(cmake_parse_implicit_include_line line lang id_var log_var state_var) set(log "") # Cray compiler (from cray wrapper, via PrgEnv-cray) - if("${CMAKE_${lang}_COMPILER_ID}" STREQUAL "Cray" AND - "${line}" MATCHES "^/" AND "${line}" MATCHES "/ccfe |/ftnfe " AND - "${line}" MATCHES " -isystem| -I") + if(CMAKE_${lang}_COMPILER_ID STREQUAL "Cray" AND + line MATCHES "^/" AND line MATCHES "/ccfe |/ftnfe " AND + line MATCHES " -isystem| -I") string(REGEX MATCHALL " (-I ?|-isystem )(\"[^\"]+\"|[^ \"]+)" incs "${line}") foreach(inc IN LISTS incs) string(REGEX REPLACE " (-I ?|-isystem )(\"[^\"]+\"|[^ \"]+)" "\\2" idir "${inc}") @@ -28,12 +28,12 @@ function(cmake_parse_implicit_include_line line lang id_var log_var state_var) endif() # PGI compiler - if("${CMAKE_${lang}_COMPILER_ID}" STREQUAL "PGI") + if(CMAKE_${lang}_COMPILER_ID STREQUAL "PGI") # pgc++ verbose output differs - if(("${lang}" STREQUAL "C" OR "${lang}" STREQUAL "Fortran") AND - "${line}" MATCHES "^/" AND - "${line}" MATCHES "/pgc |/pgf901 |/pgftnc " AND - "${line}" MATCHES " -cmdline ") + if((lang STREQUAL "C" OR lang STREQUAL "Fortran") AND + line MATCHES "^/" AND + line MATCHES "/pgc |/pgf901 |/pgftnc " AND + line MATCHES " -cmdline ") # cmdline has unparsed cmdline, remove it string(REGEX REPLACE "-cmdline .*" "" line "${line}") if("${line}" MATCHES " -nostdinc ") @@ -51,14 +51,14 @@ function(cmake_parse_implicit_include_line line lang id_var log_var state_var) else() string(APPEND log " warning: PGI C/F parse failed!\n") endif() - elseif("${lang}" STREQUAL "CXX" AND "${line}" MATCHES "^/" AND - "${line}" MATCHES "/pggpp1 " AND "${line}" MATCHES " -I") + elseif(lang STREQUAL "CXX" AND line MATCHES "^/" AND + line MATCHES "/pggpp1 " AND line MATCHES " -I") # oddly, -Mnostdinc does not get rid of system -I's, at least in # PGI 18.10.1 ... string(REGEX MATCHALL " (-I ?)([^ ]*)" incs "${line}") foreach(inc IN LISTS incs) string(REGEX REPLACE " (-I ?)([^ ]*)" "\\2" idir "${inc}") - if(NOT "${idir}" STREQUAL "-") # filter out "-I-" + if(NOT idir STREQUAL "-") # filter out "-I-" list(APPEND rv "${idir}") endif() endforeach() @@ -71,8 +71,8 @@ function(cmake_parse_implicit_include_line line lang id_var log_var state_var) endif() # SunPro compiler - if("${CMAKE_${lang}_COMPILER_ID}" STREQUAL "SunPro" AND - ("${line}" MATCHES "-D__SUNPRO_C" OR "${line}" MATCHES "-D__SUNPRO_F") ) + if(CMAKE_${lang}_COMPILER_ID STREQUAL "SunPro" AND + (line MATCHES "-D__SUNPRO_C" OR line MATCHES "-D__SUNPRO_F")) string(REGEX MATCHALL " (-I ?)([^ ]*)" incs "${line}") foreach(inc IN LISTS incs) string(REGEX REPLACE " (-I ?)([^ ]*)" "\\2" idir "${inc}") @@ -81,7 +81,7 @@ function(cmake_parse_implicit_include_line line lang id_var log_var state_var) endif() endforeach() if(rv) - if ("${lang}" STREQUAL "C" OR "${lang}" STREQUAL "CXX") + if (lang STREQUAL "C" OR lang STREQUAL "CXX") # /usr/include appears to be hardwired in list(APPEND rv "/usr/include") endif() @@ -92,24 +92,24 @@ function(cmake_parse_implicit_include_line line lang id_var log_var state_var) endif() # XL compiler - if(("${CMAKE_${lang}_COMPILER_ID}" STREQUAL "XL" - OR "${CMAKE_${lang}_COMPILER_ID}" STREQUAL "XLClang") - AND "${line}" MATCHES "^/" - AND ( ("${lang}" STREQUAL "Fortran" AND - "${line}" MATCHES "/xl[fF]entry " AND - "${line}" MATCHES "OSVAR\\([^ ]+\\)") + if((CMAKE_${lang}_COMPILER_ID STREQUAL "XL" + OR CMAKE_${lang}_COMPILER_ID STREQUAL "XLClang") + AND line MATCHES "^/" + AND ( (lang STREQUAL "Fortran" AND + line MATCHES "/xl[fF]entry " AND + line MATCHES "OSVAR\\([^ ]+\\)") OR - ( ("${lang}" STREQUAL "C" OR "${lang}" STREQUAL "CXX") AND - "${line}" MATCHES "/xl[cC]2?entry " AND - "${line}" MATCHES " -qosvar=") + ( (lang STREQUAL "C" OR lang STREQUAL "CXX") AND + line MATCHES "/xl[cC]2?entry " AND + line MATCHES " -qosvar=") ) ) # -qnostdinc cancels other stdinc flags, even if present string(FIND "${line}" " -qnostdinc" nostd) - if(NOT ${nostd} EQUAL -1) + if(NOT nostd EQUAL -1) set(rv "") # defined but empty string(APPEND log " got implicit includes via XL parser (nostdinc)\n") else() - if("${lang}" STREQUAL "CXX") + if(lang STREQUAL "CXX") string(REGEX MATCHALL " -qcpp_stdinc=([^ ]*)" std "${line}") string(REGEX MATCHALL " -qgcc_cpp_stdinc=([^ ]*)" gcc_std "${line}") else() |