##################### INSTALLATION ##########################################
# Binaries
-INSTALL(PROGRAMS rspamd-${RSPAMD_VERSION} DESTINATION bin RENAME rspamd)
-INSTALL(PROGRAMS src/client/rspamc DESTINATION bin)
-
+INSTALL(TARGETS rspamd RUNTIME DESTINATION bin)
# Configs
IF(NOT EXISTS ${DESTDIR}/${ETC_PREFIX}/rspamd)
ENDIF(ENABLE_PERL MATCHES "ON")
# Redirector
-IF(ENABLE_REDIRECTOR MATCHES "ON" AND ENABLE_PERL MATCHES "ON")
+IF(ENABLE_REDIRECTOR MATCHES "ON")
INSTALL(PROGRAMS utils/redirector.pl DESTINATION bin RENAME rspamd-redirector)
-ENDIF(ENABLE_REDIRECTOR MATCHES "ON" AND ENABLE_PERL MATCHES "ON")
+ENDIF(ENABLE_REDIRECTOR MATCHES "ON")
# Start scripts
IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT BUILD_PORT)
ENDIF(DPKG_FOUND STREQUAL "YES")
IF(PKGCREATE_FOUND STREQUAL "YES")
ADD_FREEBSD_PACKAGE("rspamd" "freebsd/rspamd.plist")
-ENDIF(PKGCREATE_FOUND STREQUAL "YES")
\ No newline at end of file
+ENDIF(PKGCREATE_FOUND STREQUAL "YES")
ADD_LIBRARY(rspamdclient SHARED ${LIBRSPAMDSRC})
ADD_LIBRARY(rspamdclient_static STATIC ${LIBRSPAMDSRC})
SET_TARGET_PROPERTIES(rspamdclient PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -I../src/")
-SET_TARGET_PROPERTIES(rspamdclient_static PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -I../src/")
\ No newline at end of file
+SET_TARGET_PROPERTIES(rspamdclient PROPERTIES PUBLIC_HEADER "librspamdclient.h")
+SET_TARGET_PROPERTIES(rspamdclient_static PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -I../src/")
+
+TARGET_LINK_LIBRARIES(rspamdclient ${CMAKE_REQUIRED_LIBRARIES})
+TARGET_LINK_LIBRARIES(rspamdclient ${GLIB2_LIBRARIES})
+TARGET_LINK_LIBRARIES(rspamdclient_static ${CMAKE_REQUIRED_LIBRARIES})
+TARGET_LINK_LIBRARIES(rspamdclient_static ${GLIB2_LIBRARIES})
+
+SET_TARGET_PROPERTIES(rspamdclient PROPERTIES VERSION ${RSPAMD_VERSION})
+SET_TARGET_PROPERTIES(rspamdclient_static PROPERTIES VERSION ${RSPAMD_VERSION})
+
+INSTALL(TARGETS rspamdclient rspamdclient_static LIBRARY PUBLIC_HEADER
+ LIBRARY DESTINATION lib
+ PUBLIC_HEADER DESTINATION include
+ ARCHIVE DESTINATION lib)
TARGET_LINK_LIBRARIES(rspamc rspamdclient)
TARGET_LINK_LIBRARIES(rspamc ${CMAKE_REQUIRED_LIBRARIES})
TARGET_LINK_LIBRARIES(rspamc ${GLIB2_LIBRARIES})
+SET_TARGET_PROPERTIES(rspamc PROPERTIES VERSION ${RSPAMD_VERSION})
+
+INSTALL(TARGETS rspamc RUNTIME DESTINATION bin)