From 0ed456ca4dd47a07b1bcf424da5849df8bb2f833 Mon Sep 17 00:00:00 2001 From: "Tobias C. Berner" Date: Wed, 13 Sep 2017 13:07:21 +0200 Subject: [PATCH] Use CMAKE_DL_LIBS instead of dl cmake provides a wrapper to link against 'dl' which evalutes to nothing on FreeBSD and to dl on Linux for example. https://cmake.org/cmake/help/v3.6/variable/CMAKE_DL_LIBS.html --- src/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6c6f32b9..d0b8a66b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -239,9 +239,8 @@ if ( MSVC ) ) else() - # TODO: Check if this is really needed. - if ( UNIX AND NOT FREEBSD ) - target_link_libraries( exiv2lib PRIVATE dl) + if ( UNIX ) + target_link_libraries( exiv2lib PRIVATE ${CMAKE_DL_LIBS}) endif() if (CYGWIN OR MINGW)