You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am in the process of adding compatibility with the official FindOpenMP.cmake CMake module to the llvm-openmp package on CCI: conan-io/conan-center-index#22353
Everything works as expected, except two small details for "module" mode output from the CMakeDeps generator:
find_package(OpenMP MODULE REQUIRED COMPONENTS Fortran) and find_package(OpenMP <some high version> MODULE REQUIRED) don't fail.
The version set by the custom CMake module gets overridden - the official FindOpenMP sets the version to the OpenMP API standard version supported by the implementation.
Both of these issues are caused by the following block at the end of FindOpenMP.cmake from CMakeDeps:
# Only the first installed configuration is included to avoid the collisionforeach(_BUILD_MODULE ${llvm-openmp_BUILD_MODULES_PATHS_RELEASE} )
message(${OpenMP_MESSAGE_MODE}"Conan: Including build module from '${_BUILD_MODULE}'")
include(${_BUILD_MODULE})
endforeach()
include(FindPackageHandleStandardArgs)
set(OpenMP_FOUND 1)
set(OpenMP_VERSION "18.1.3")
find_package_handle_standard_args(OpenMP
REQUIRED_VARS OpenMP_VERSION
VERSION_VAR OpenMP_VERSION)
mark_as_advanced(OpenMP_FOUND OpenMP_VERSION)
I would recommend adjusting the logic there to do the following instead:
unset(OpenMP_FOUND)
unset(OpenMP_VERSION)
# Only the first installed configuration is included to avoid the collisionforeach(_BUILD_MODULE ${llvm-openmp_BUILD_MODULES_PATHS_RELEASE} )
message(${OpenMP_MESSAGE_MODE}"Conan: Including build module from '${_BUILD_MODULE}'")
include(${_BUILD_MODULE})
endforeach()
include(FindPackageHandleStandardArgs)
if(NOTDEFINED OpenMP_FOUND)
set(OpenMP_FOUND 1)
endif()
if(NOTDEFINED OpenMP_VERSION)
set(OpenMP_VERSION "18.1.3")
endif()
find_package_handle_standard_args(OpenMP
REQUIRED_VARS OpenMP_VERSION
VERSION_VAR OpenMP_VERSION)
mark_as_advanced(OpenMP_FOUND OpenMP_VERSION)
Describe the bug
I am in the process of adding compatibility with the official
FindOpenMP.cmake
CMake module to thellvm-openmp
package on CCI: conan-io/conan-center-index#22353Everything works as expected, except two small details for "module" mode output from the CMakeDeps generator:
find_package(OpenMP MODULE REQUIRED COMPONENTS Fortran)
andfind_package(OpenMP <some high version> MODULE REQUIRED)
don't fail.Both of these issues are caused by the following block at the end of
FindOpenMP.cmake
from CMakeDeps:I would recommend adjusting the logic there to do the following instead:
How to reproduce it
Uncomment https://github.com/conan-io/conan-center-index/pull/22353/files#diff-6fca027d0646da5134891fc8afe91b18d63ee958917d15643746aa5c54855787R10-R14
and build the package.
The text was updated successfully, but these errors were encountered: