Ok, I just figured out why you probably can't reproduce the issue: you need to use clang as a compiler. If you use `CXX=clang++-14 cmake [...]` as a configure command line you'll likely trigger the error.
And the required package providing OpenMP for clang must match the clang version used: if I install libomp-13-dev while using clang++-14 for example I'll still get the error. With this additional info I get that the issue is triggered with a non-default setup, so I'm not sure how or even if it can be fixed correctly. Especially given that the proper dependency is heavily dependent on the clang version used/installed. Given that understanding I'd be fine with leaving things as is. And maybe it's the upstream MathGL2Config.cmake that needs a rework to deal more easily with various setups. Anyway, thanks for taking a look. Le mer. 31 août 2022 à 10:03, Sylvain Joubert <joubert...@gmail.com> a écrit : > Hi, > Here is the minimal CMakeLists.txt that reproduces the issue: > > cmake_minimum_required(VERSION 3.22.0) > project(mgl_test LANGUAGES CXX) > find_package(MathGL2 REQUIRED) > > If the packages libomp-dev and libomp-XX-dev that it drags (libomp-11-dev > on stable, libomp-14-dev on my testing setup) are not installed I get the > initial reported error. > > > Le mar. 30 août 2022 à 22:03, Rafael Laboissière <raf...@debian.org> a > écrit : > >> Control: tags -1 moreinfo >> >> * Sylvain Joubert <joubert...@gmail.com> [2022-03-02 11:17]: >> >> > Package: libmgl-dev >> > Version: 8.0.1-1 >> > Severity: normal >> > >> > Dear Maintainer, >> > >> > Trying to use libmgl-dev through find_package(MathGL2) in CMake I'm >> facing the >> > following error: >> > >> > CMake Error at >> /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 >> > (message): Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS >> OpenMP_CXX_LIB_NAMES) >> > Call Stack (most recent call first): >> > /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 >> > (_FPHSA_FAILURE_MESSAGE) >> > /usr/share/cmake-3.22/Modules/FindOpenMP.cmake:544 >> > (find_package_handle_standard_args) >> > /usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 >> > (find_package) >> > /usr/lib/cmake/mathgl2/MathGL2Config.cmake:22 (find_dependency) >> > [...] >> > >> > It appears the libmgl-dev package is missing a dependency on an OpenMP >> > related package. Installing libomp-dev fixes the issue though I'm not >> > sure this is the correct package to depend on. >> >> Thank you for the bug report. >> >> Could you please provide an example that trigger the bug? For >> inspiration, look at Bug #1004218 [1] or #1004219 [2]. >> >> Best, >> >> Rafael Laboissière >> >> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1004218 >> [2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1004219 >> >