From e7032003419b8575e211fb9bb4740c1d37736f51 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 2 Feb 2011 16:16:51 +0300 Subject: [PATCH] Update build and install system. --- CMakeLists.txt | 10 ++++------ lib/CMakeLists.txt | 16 +++++++++++++++- src/client/CMakeLists.txt | 3 +++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d01c636a..1437166a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -759,9 +759,7 @@ ENDIF(ENABLE_STATIC MATCHES "ON") ##################### 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) @@ -812,9 +810,9 @@ IF(ENABLE_PERL MATCHES "ON") 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) @@ -925,4 +923,4 @@ IF(DPKG_FOUND STREQUAL "YES") 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") diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index f625b2833..5b30f041b 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -4,4 +4,18 @@ SET(LIBRSPAMDSRC librspamdclient.c ../src/util.c ../src/upstream.c ../src/me 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) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 186b458f3..dee29b667 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -6,3 +6,6 @@ SET_TARGET_PROPERTIES(rspamc PROPERTIES COMPILE_FLAGS "-I.. -I../../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) -- 2.39.5