summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-25 16:17:37 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-01-25 16:17:46 (GMT)
commitd1ba79da4f9eaf27d1df67e9c72723a2f8d71fd3 (patch)
tree390c76d36553d31b08d97b6e67271fd416558862 /Modules
parente4cdd4206cd0d123e3ef4ec8b3436af4bd5e88d9 (diff)
parent6e53d74147ef06b9acbd1d3045658cf6cc603a23 (diff)
downloadCMake-d1ba79da4f9eaf27d1df67e9c72723a2f8d71fd3.zip
CMake-d1ba79da4f9eaf27d1df67e9c72723a2f8d71fd3.tar.gz
CMake-d1ba79da4f9eaf27d1df67e9c72723a2f8d71fd3.tar.bz2
Merge topic 'FindOpenMP-test-include-dir'
6e53d74147 FindOpenMP: Use OpenMP_<lang>_INCLUDE_DIR Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8110
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindOpenMP.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index 4aa7d91..68be2d6 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -212,10 +212,14 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR)
string(APPEND OPENMP_FLAGS_TEST " ${OpenMP_VERBOSE_COMPILE_OPTIONS}")
endif()
string(REGEX REPLACE "[-/=+]" "" OPENMP_PLAIN_FLAG "${OPENMP_FLAG}")
+ unset(_includeDirFlags)
+ if(OpenMP_${LANG}_INCLUDE_DIR)
+ set(_includeDirFlags "-DINCLUDE_DIRECTORIES:STRING=${OpenMP_${LANG}_INCLUDE_DIR}")
+ endif()
try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG}
SOURCE_FROM_VAR "${_OPENMP_TEST_SRC_NAME}" _OPENMP_TEST_SRC_CONTENT
LOG_DESCRIPTION "Detecting ${LANG} OpenMP compiler info"
- CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST}"
+ CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST}" ${_includeDirFlags}
LINK_LIBRARIES ${CMAKE_${LANG}_VERBOSE_FLAG}
OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT
)