Replace pthread and dl linking with cmake-based variables

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/27/head
Michele Calgaro 2 months ago
parent 493173b2a8
commit 45ff2423e0
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -50,22 +50,13 @@ check_include_file( "pthread.h" HAVE_LIBPTHREAD )
##### check for system libraries ################
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 )
##### check for functions #######################
tde_save_and_set( CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARIES} )
tde_save_and_set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS} )
check_function_exists( dlopen HAVE_LIBDL )
check_function_exists( dlerror HAVE_DLERROR )
check_function_exists( strcmp HAVE_STRCMP )
check_function_exists( strchr HAVE_STRCHR )

@ -18,8 +18,8 @@ set( prefix ${CMAKE_INSTALL_PREFIX} )
set( exec_prefix $prefix )
set( libdir ${LIB_INSTALL_DIR} )
set( includedir ${CMAKE_INSTALL_PREFIX}/include/artsc )
if( NOT "${DL_LIBRARIES}" STREQUAL "" )
set( LIBDL -l${DL_LIBRARIES} )
if( NOT "${CMAKE_DL_LIBS}" STREQUAL "" )
set( LIBDL -l${CMAKE_DL_LIBS} )
endif( )
set( USE_THREADS )
set( LIBPTHREAD ${CMAKE_THREAD_LIBS_INIT} )
@ -72,7 +72,7 @@ install( FILES
tde_add_library( artsdsp SHARED
SOURCES artsdsp.c
VERSION 0.0.0
LINK artsc-shared ${DL_LIBRARIES}
LINK artsc-shared ${CMAKE_DL_LIBS}
DESTINATION ${LIB_INSTALL_DIR}
)

@ -24,6 +24,6 @@ include_directories(
tde_add_library( mcop_mt SHARED
SOURCES threads_posix.cpp
VERSION 1.0.0
LINK artsflow-shared pthread
LINK artsflow-shared ${CMAKE_THREAD_LIBS_INIT}
DESTINATION ${LIB_INSTALL_DIR}
)

Loading…
Cancel
Save