[CMake] Ensure `CLANG_RESOURCE_DIR` is respected.
re-commit of 39aa0f5c434b463520ac39a8dbe933ee8c4c5ea7 with missing file:
cmake/Modules/GetClangResourceDir.cmake.
GitOrigin-RevId: 0beffb854209a41f31beb18f9631258349a99299
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 04678cb..c1efcaf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -90,8 +90,8 @@
if(${OPENMP_STANDALONE_BUILD})
set(LIBOMP_HEADERS_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}")
else()
- string(REGEX MATCH "[0-9]+" CLANG_VERSION ${PACKAGE_VERSION})
- set(LIBOMP_HEADERS_INSTALL_PATH "${OPENMP_INSTALL_LIBDIR}/clang/${CLANG_VERSION}/include")
+ include(GetClangResourceDir)
+ get_clang_resource_dir(LIBOMP_HEADERS_INSTALL_PATH SUBDIR include)
endif()
# Build host runtime library, after LIBOMPTARGET variables are set since they are needed