summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorFrançois Andriot <[email protected]>2014-09-14 20:09:06 +0200
committerSlávek Banko <[email protected]>2014-09-14 20:19:46 +0200
commitc73ca85a7664deae18d4b5a1671e84c558160167 (patch)
treec4a2f96654f296d6544f126aa4a7fe5efa6a3d73 /CMakeLists.txt
parent86b0785b2a068407219cf22386e567c476a0eb03 (diff)
downloadarts-c73ca85a7664deae18d4b5a1671e84c558160167.tar.gz
arts-c73ca85a7664deae18d4b5a1671e84c558160167.zip
Fix hardcoded link flag to "dl" library
Fix "dlopen" function detection
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d970382..a717527 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,6 +79,10 @@ set( DL_LIBRARIES dl )
check_library_exists( ${DL_LIBRARIES} dlopen /lib HAVE_LIBDL )
if( NOT HAVE_LIBDL )
unset( DL_LIBRARIES )
+ check_function_exists( dlopen HAVE_DLOPEN )
+ if( HAVE_DLOPEN )
+ set( HAVE_LIBDL 1 )
+ endif( HAVE_DLOPEN )
endif( NOT HAVE_LIBDL )
find_package( Threads )
@@ -88,7 +92,7 @@ find_package( Threads )
include( CheckFunctionExists )
set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} )
-set( CMAKE_REQUIRED_LIBRARIES dl )
+set( CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARIES} )
check_function_exists( dlerror HAVE_DLERROR )
check_function_exists( strcmp HAVE_STRCMP )
check_function_exists( strchr HAVE_STRCHR )