INCLUDE(FindPerl)
# Initial set
-SET(CMAKE_REQUIRED_LIBRARIES m)
IF(CMAKE_INSTALL_PREFIX)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
IF(ENABLE_STATIC MATCHES "ON")
SET(BUILD_STATIC 1)
- SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -pthread")
MESSAGE(STATUS "Static build of rspamd, no custom plugins support")
ENDIF(ENABLE_STATIC MATCHES "ON")
TARGET_LINK_LIBRARIES(rspamd rspamdserver)
-IF(ENABLE_LUAJIT MATCHES "ON")
- TARGET_LINK_LIBRARIES(rspamd "${LUAJIT_LIBRARY}")
-ELSE(ENABLE_LUAJIT MATCHES "ON")
- TARGET_LINK_LIBRARIES(rspamd "${LUA_LIBRARY}")
-ENDIF(ENABLE_LUAJIT MATCHES "ON")
-
IF(LIBJUDY_LIBRARY)
TARGET_LINK_LIBRARIES(rspamd Judy)
ENDIF(LIBJUDY_LIBRARY)
ENDIF(GMIME24)
IF(ENABLE_STATIC MATCHES "ON")
TARGET_LINK_LIBRARIES(rspamd ${PCRE_LIBRARIES})
+ TARGET_LINK_LIBRARIES(rspamd ffi)
ENDIF(ENABLE_STATIC MATCHES "ON")
+IF(ENABLE_LUAJIT MATCHES "ON")
+ TARGET_LINK_LIBRARIES(rspamd "${LUAJIT_LIBRARY}")
+ELSE(ENABLE_LUAJIT MATCHES "ON")
+ TARGET_LINK_LIBRARIES(rspamd "${LUA_LIBRARY}")
+ENDIF(ENABLE_LUAJIT MATCHES "ON")
+
IF(ENABLE_GPERF_TOOLS MATCHES "ON")
TARGET_LINK_LIBRARIES(rspamd profiler)
ENDIF(ENABLE_GPERF_TOOLS MATCHES "ON")
IF(GLIB_COMPAT)
TARGET_LINK_LIBRARIES(rspamd glibadditions)
ENDIF(GLIB_COMPAT)
+TARGET_LINK_LIBRARIES(rspamd m)
##################### INSTALLATION ##########################################
ADD_EXECUTABLE(rspamc ${RSPAMCSRC})
SET_TARGET_PROPERTIES(rspamc PROPERTIES COMPILE_FLAGS "-I${CMAKE_SOURCE_DIR}/lib")
TARGET_LINK_LIBRARIES(rspamc rspamdserver)
-TARGET_LINK_LIBRARIES(rspamc rspamdclient)
+IF(ENABLE_STATIC MATCHES "ON")
+ TARGET_LINK_LIBRARIES(rspamc rspamdclient_static)
+ELSE(ENABLE_STATIC MATCHES "ON")
+ TARGET_LINK_LIBRARIES(rspamc rspamdclient)
+ENDIF(ENABLE_STATIC MATCHES "ON")
TARGET_LINK_LIBRARIES(rspamc pcre)
-TARGET_LINK_LIBRARIES(rspamc ${CMAKE_REQUIRED_LIBRARIES})
-TARGET_LINK_LIBRARIES(rspamc ${GLIB2_LIBRARIES})
-SET_TARGET_PROPERTIES(rspamc PROPERTIES VERSION ${RSPAMD_VERSION})
-
IF(GLIB_COMPAT)
TARGET_LINK_LIBRARIES(rspamc glibadditions)
ENDIF(GLIB_COMPAT)
+TARGET_LINK_LIBRARIES(rspamc ${GLIB2_LIBRARIES})
+TARGET_LINK_LIBRARIES(rspamc ${CMAKE_REQUIRED_LIBRARIES})
+TARGET_LINK_LIBRARIES(rspamc m)
+SET_TARGET_PROPERTIES(rspamc PROPERTIES VERSION ${RSPAMD_VERSION})
INSTALL(TARGETS rspamc RUNTIME DESTINATION bin)