diff options
author | Brad King <brad.king@kitware.com> | 2017-10-05 11:33:51 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-10-05 11:34:01 (GMT) |
commit | 508f47de1b4b7ab52abf17bc4feb39637a4005c2 (patch) | |
tree | 3f63f51727737657bdc3050620f4a2e9d3de4234 | |
parent | 78d4a3db034ac6e15932fb51233c489f8faa360e (diff) | |
parent | 312061573932417dc4a6aad9de4164046fb7982e (diff) | |
download | CMake-508f47de1b4b7ab52abf17bc4feb39637a4005c2.zip CMake-508f47de1b4b7ab52abf17bc4feb39637a4005c2.tar.gz CMake-508f47de1b4b7ab52abf17bc4feb39637a4005c2.tar.bz2 |
Merge topic 'findopenmp-fix-version'
31206157 FindOpenMP: Fix version if OpenMP doesn't work
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1344
-rw-r--r-- | Modules/FindOpenMP.cmake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index 595b0b3..272f4dc 100644 --- a/Modules/FindOpenMP.cmake +++ b/Modules/FindOpenMP.cmake @@ -310,7 +310,11 @@ macro(_OPENMP_SET_VERSION_BY_SPEC_DATE LANG) "199710=1.0" ) - string(REGEX MATCHALL "${OpenMP_${LANG}_SPEC_DATE}=([0-9]+)\\.([0-9]+)" _version_match "${OpenMP_SPEC_DATE_MAP}") + if(OpenMP_${LANG}_SPEC_DATE) + string(REGEX MATCHALL "${OpenMP_${LANG}_SPEC_DATE}=([0-9]+)\\.([0-9]+)" _version_match "${OpenMP_SPEC_DATE_MAP}") + else() + set(_version_match "") + endif() if(NOT _version_match STREQUAL "") set(OpenMP_${LANG}_VERSION_MAJOR ${CMAKE_MATCH_1}) set(OpenMP_${LANG}_VERSION_MINOR ${CMAKE_MATCH_2}) @@ -389,7 +393,7 @@ unset(_OpenMP_MIN_VERSION) foreach(LANG IN LISTS OpenMP_FINDLIST) if(CMAKE_${LANG}_COMPILER_LOADED) - if (NOT OpenMP_${LANG}_SPEC_DATE) + if (NOT OpenMP_${LANG}_SPEC_DATE AND OpenMP_${LANG}_FLAGS) _OPENMP_GET_SPEC_DATE("${LANG}" OpenMP_${LANG}_SPEC_DATE_INTERNAL) set(OpenMP_${LANG}_SPEC_DATE "${OpenMP_${LANG}_SPEC_DATE_INTERNAL}" CACHE INTERNAL "${LANG} compiler's OpenMP specification date") |