summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Hutton <tihutt@microsoft.com>2020-02-07 17:17:01 (GMT)
committerBrad King <brad.king@kitware.com>2020-02-10 22:20:19 (GMT)
commit2dbff623f90fbdf7e370084374b5083d446daaad (patch)
tree951e92e7d7a4320b5be05f7baa1af6de8c679157
parent155540d89eb5ac00fd8ba03a9580de2382af6386 (diff)
downloadCMake-2dbff623f90fbdf7e370084374b5083d446daaad.zip
CMake-2dbff623f90fbdf7e370084374b5083d446daaad.tar.gz
CMake-2dbff623f90fbdf7e370084374b5083d446daaad.tar.bz2
FindOpenMP: Save flags/libs in cache entries each time they are detected
-rw-r--r--Modules/FindOpenMP.cmake11
1 files changed, 5 insertions, 6 deletions
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index 26fed41..7a6ca29 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -425,13 +425,12 @@ foreach(LANG IN ITEMS C CXX)
if(NOT DEFINED OpenMP_${LANG}_FLAGS OR "${OpenMP_${LANG}_FLAGS}" STREQUAL "NOTFOUND"
OR NOT DEFINED OpenMP_${LANG}_LIB_NAMES OR "${OpenMP_${LANG}_LIB_NAMES}" STREQUAL "NOTFOUND")
_OPENMP_GET_FLAGS("${LANG}" "${LANG}" OpenMP_${LANG}_FLAGS_WORK OpenMP_${LANG}_LIB_NAMES_WORK)
+ set(OpenMP_${LANG}_FLAGS "${OpenMP_${LANG}_FLAGS_WORK}"
+ CACHE STRING "${LANG} compiler flags for OpenMP parallelization" FORCE)
+ set(OpenMP_${LANG}_LIB_NAMES "${OpenMP_${LANG}_LIB_NAMES_WORK}"
+ CACHE STRING "${LANG} compiler libraries for OpenMP parallelization" FORCE)
+ mark_as_advanced(OpenMP_${LANG}_FLAGS OpenMP_${LANG}_LIB_NAMES)
endif()
-
- set(OpenMP_${LANG}_FLAGS "${OpenMP_${LANG}_FLAGS_WORK}"
- CACHE STRING "${LANG} compiler flags for OpenMP parallelization")
- set(OpenMP_${LANG}_LIB_NAMES "${OpenMP_${LANG}_LIB_NAMES_WORK}"
- CACHE STRING "${LANG} compiler libraries for OpenMP parallelization")
- mark_as_advanced(OpenMP_${LANG}_FLAGS OpenMP_${LANG}_LIB_NAMES)
endif()
endforeach()