From 32a9833bd78ea65e66c67298f564c7260cb0fa9a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 26 Dec 2013 15:38:17 +0000 Subject: [PATCH] Fix linking libraries. --- CMakeLists.txt | 12 +++++++----- contrib/lgpl/CMakeLists.txt | 2 +- lib/CMakeLists.txt | 8 ++++---- src/client/CMakeLists.txt | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19b0eb59c..290fb95e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -286,7 +286,7 @@ MACRO(ProcessPackage var _name0) FOREACH(_arg ${${_XPREFIX}_LDFLAGS_OTHER}) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${_arg}") ENDFOREACH(_arg ${${_XPREFIX}_LDFLAGS_OTHER}) - LIST(APPEND CMAKE_REQUIRED_LIBRARIES "${${_XPREFIX}_LIBRARIES}") + LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "${${_XPREFIX}_LIBRARIES}") ENDIF(${var}_FOUND) ENDMACRO(ProcessPackage name) @@ -325,7 +325,7 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") /usr/lib /usr/local/lib DOC "Path where the libintl library can be found") - LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBINTL_LIBRARY}) + LIST(APPEND RSPAMD_REQUIRED_LIBRARIES ${LIBINTL_LIBRARY}) MESSAGE(STATUS "Configuring for FreeBSD") ENDIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") @@ -338,7 +338,7 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin") /usr/lib /usr/local/lib DOC "Path where the libintl library can be found") - LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBINTL_LIBRARY}) + LIST(APPEND RSPAMD_REQUIRED_LIBRARIES ${LIBINTL_LIBRARY}) MESSAGE(STATUS "Configuring for Darwin") ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin") @@ -583,7 +583,7 @@ IF(LIBUTIL_LIBRARY) /usr/local/include DOC "Path to libutil header") IF(HAVE_LIBUTIL_H) - LIST(APPEND CMAKE_REQUIRED_LIBRARIES util) + LIST(APPEND RSPAMD_REQUIRED_LIBRARIES util) CHECK_FUNCTION_EXISTS(pidfile_open HAVE_PIDFILE) CHECK_FUNCTION_EXISTS(pidfile_fileno HAVE_PIDFILE_FILENO) ENDIF(HAVE_LIBUTIL_H) @@ -633,6 +633,8 @@ ELSE(ENABLE_STATIC MATCHES "ON") ENDIF(NO_SHARED MATCHES "OFF") ENDIF(ENABLE_STATIC MATCHES "ON") +LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") + # Process with warn flags SET(CMAKE_C_WARN_FLAGS "") CHECK_C_COMPILER_FLAG(-Wall SUPPORT_WALL) @@ -973,7 +975,7 @@ ENDIF(OPENSSL_FOUND) IF(HAVE_FETCH_H) TARGET_LINK_LIBRARIES(rspamd fetch) ENDIF(HAVE_FETCH_H) -TARGET_LINK_LIBRARIES(rspamd ${CMAKE_REQUIRED_LIBRARIES}) +TARGET_LINK_LIBRARIES(rspamd ${RSPAMD_REQUIRED_LIBRARIES}) IF(ENABLE_LUAJIT MATCHES "ON") TARGET_LINK_LIBRARIES(rspamd "${LUAJIT_LIBRARY}") diff --git a/contrib/lgpl/CMakeLists.txt b/contrib/lgpl/CMakeLists.txt index 2cd97a7f8..39191620a 100644 --- a/contrib/lgpl/CMakeLists.txt +++ b/contrib/lgpl/CMakeLists.txt @@ -12,7 +12,7 @@ IF(GLIB2_VERSION VERSION_LESS "2.16") ADD_LIBRARY(glibadditions SHARED ${LIBGLIBSRC}) SET_TARGET_PROPERTIES(glibadditions PROPERTIES COMPILE_FLAGS "-I${CMAKE_SOURCE_DIR}/contrib/lgpl") - TARGET_LINK_LIBRARIES(glibadditions ${CMAKE_REQUIRED_LIBRARIES}) + TARGET_LINK_LIBRARIES(glibadditions ${RSPAMD_REQUIRED_LIBRARIES}) SET_TARGET_PROPERTIES(glibadditions PROPERTIES VERSION ${RSPAMD_VERSION}) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index fc8efff63..b236be14a 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -70,7 +70,7 @@ IF(CMAKE_COMPILER_IS_GNUCC) SET_TARGET_PROPERTIES(rspamd-util PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing") ENDIF(CMAKE_COMPILER_IS_GNUCC) -TARGET_LINK_LIBRARIES(rspamd-util ${CMAKE_REQUIRED_LIBRARIES}) +TARGET_LINK_LIBRARIES(rspamd-util ${RSPAMD_REQUIRED_LIBRARIES}) TARGET_LINK_LIBRARIES(rspamd-util pcre) TARGET_LINK_LIBRARIES(rspamd-util rspamd-ucl) TARGET_LINK_LIBRARIES(rspamd-util event) @@ -100,16 +100,16 @@ IF(NOT DEBIAN_BUILD) SET_TARGET_PROPERTIES(rspamdclient_static PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing") ENDIF(CMAKE_COMPILER_IS_GNUCC) TARGET_LINK_LIBRARIES(rspamdclient rspamd-util) - TARGET_LINK_LIBRARIES(rspamdclient ${CMAKE_REQUIRED_LIBRARIES}) + TARGET_LINK_LIBRARIES(rspamdclient ${RSPAMD_REQUIRED_LIBRARIES}) TARGET_LINK_LIBRARIES(rspamdclient_static rspamd-util) - TARGET_LINK_LIBRARIES(rspamdclient_static ${CMAKE_REQUIRED_LIBRARIES}) + TARGET_LINK_LIBRARIES(rspamdclient_static ${RSPAMD_REQUIRED_LIBRARIES}) ELSE(NOT DEBIAN_BUILD) ADD_LIBRARY(rspamdclient STATIC ${LIBRSPAMDCLIENTSRC}) IF(CMAKE_COMPILER_IS_GNUCC) SET_TARGET_PROPERTIES(rspamdclient PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing") ENDIF(CMAKE_COMPILER_IS_GNUCC) TARGET_LINK_LIBRARIES(rspamdclient rspamd-util) - TARGET_LINK_LIBRARIES(rspamdclient ${CMAKE_REQUIRED_LIBRARIES}) + TARGET_LINK_LIBRARIES(rspamdclient ${RSPAMD_REQUIRED_LIBRARIES}) ENDIF(NOT DEBIAN_BUILD) IF(NOT DEBIAN_BUILD) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index ed93a8555..1d48a202f 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -15,7 +15,7 @@ ENDIF(GLIB_COMPAT) IF(OPENSSL_FOUND) TARGET_LINK_LIBRARIES(rspamc ${OPENSSL_LIBRARIES}) ENDIF(OPENSSL_FOUND) -TARGET_LINK_LIBRARIES(rspamc ${CMAKE_REQUIRED_LIBRARIES}) +TARGET_LINK_LIBRARIES(rspamc ${RSPAMD_REQUIRED_LIBRARIES}) IF(NOT DEBIAN_BUILD) SET_TARGET_PROPERTIES(rspamc PROPERTIES VERSION ${RSPAMD_VERSION}) ENDIF(NOT DEBIAN_BUILD) -- 2.39.5