Merge pull request #3752 from OgreTransporter/fix-issue-3751

Check OpenMP target in CMake (issue #3751)
This commit is contained in:
Egor Pugin 2022-02-20 02:15:09 +03:00 committed by GitHub
commit 1e095ad33f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -292,7 +292,9 @@ if(OPENMP_BUILD)
if(OpenMP_FOUND)
message(">> OpenMP_FOUND ${OpenMP_FOUND} ${OpenMP_VERSION}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
add_library(OpenMP::OpenMP_CXX IMPORTED INTERFACE)
if (NOT TARGET OpenMP::OpenMP_CXX)
add_library(OpenMP::OpenMP_CXX IMPORTED INTERFACE)
endif()
endif()
# https://stackoverflow.com/questions/12399422
# how-to-set-linker-flags-for-openmp-in-cmakes-try-compile-function