From 4c2accb349bc5b0abcb7af97e8e813898bf4d5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Thu, 1 Jan 2015 03:42:12 +0100 Subject: Fix linked libraries with CMake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- CMakeLists.txt | 6 ++++++ src/CMakeLists.txt | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 89b2d99..ec3eb11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,12 @@ if( NOT LIBGLADE_FOUND ) tde_message_fatal( "libglade-2.0 are required, but not found on your system" ) endif( NOT LIBGLADE_FOUND ) + +set( EXTRA_LIBRARIES "-lm -lpthread" ) +if( UNIX ) + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden" ) +endif( UNIX ) + message( STATUS "Ready to build with backend ${BACKEND_NAME}" ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7d54add..7668568 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,7 +40,7 @@ tde_add_library( ${target} SHARED VERSION 0.0.0 SOURCES ${${target}_SRCS} - LINK ${BACKEND_LIBS} + LINK ${BACKEND_LIBRARIES} ${ZLIB_LIBRARIES} ${EXTRA_LIBRARIES} DESTINATION ${LIB_INSTALL_DIR} ) @@ -48,7 +48,7 @@ tde_add_library( ${target} STATIC VERSION 0.0.0 SOURCES ${${target}_SRCS} - LINK ${BACKEND_LIBS} + LINK ${BACKEND_LIBRARIES} ${ZLIB_LIBRARIES} ${EXTRA_LIBRARIES} DESTINATION ${LIB_INSTALL_DIR} ) -- cgit v1.2.1