diff --git a/cmake/Lcms2Library.cmake b/cmake/Lcms2Library.cmake index 63629609..dcde0ba1 100644 --- a/cmake/Lcms2Library.cmake +++ b/cmake/Lcms2Library.cmake @@ -71,9 +71,9 @@ function(_lcms2_apply_common_settings tgt) # libm (primarily needed on Linux). Make it PUBLIC so dependents (tools) # also link it, matching autotools *_DEPLIBS behavior. - find_library(_lcms2_math_lib m) - if(_lcms2_math_lib) - target_link_libraries(${tgt} PUBLIC "${_lcms2_math_lib}") + # Reuse the library path already detected by lcms2_detect_features(). + if(LCMS2_MATH_LIB) + target_link_libraries(${tgt} PUBLIC "${LCMS2_MATH_LIB}") endif() endfunction() diff --git a/src/meson.build b/src/meson.build index 13cb4b2d..a79bce1f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -68,4 +68,5 @@ endif liblcms2_dep = declare_dependency( link_with: liblcms2_lib, include_directories: [inc_dirs, include_directories('.')], + dependencies: deps, )