aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-12-02 14:42:36 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-12-02 14:42:36 +0000
commit0e196f75f256c5af5891aac3ec3fdc52cdaec926 (patch)
tree294313dda9722a4853c9542148024a91ff9d857f
parent4d58641eb7449ac88b423345e7d1b197c2ee6b4d (diff)
downloadrspamd-0e196f75f256c5af5891aac3ec3fdc52cdaec926.tar.gz
rspamd-0e196f75f256c5af5891aac3ec3fdc52cdaec926.zip
Workaround for FreeBSD ports.
-rw-r--r--CMakeLists.txt16
1 files changed, 10 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2980e49bb..8937fe937 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -235,7 +235,7 @@ MACRO(FindLua _major _minor)
ENDIF(ENABLE_LUAJIT MATCHES "ON")
ENDMACRO(FindLua _major _minor)
-FUNCTION(INSTALL_IF_NOT_EXISTS src dest)
+FUNCTION(INSTALL_IF_NOT_EXISTS src dest suffix)
IF(NOT IS_ABSOLUTE "${src}")
SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
ENDIF()
@@ -244,18 +244,18 @@ FUNCTION(INSTALL_IF_NOT_EXISTS src dest)
SET(dest "${CMAKE_INSTALL_PREFIX}/${dest}")
ENDIF()
INSTALL(CODE "
- IF(NOT EXISTS \"\$ENV{DESTDIR}${dest}/${src_name}\")
+ IF(NOT EXISTS \"\$ENV{DESTDIR}${dest}/${src_name}${suffix}\")
#FILE(INSTALL \"${src}\" DESTINATION \"${dest}\")
- MESSAGE(STATUS \"Installing: \$ENV{DESTDIR}${dest}/${src_name}\")
+ MESSAGE(STATUS \"Installing: \$ENV{DESTDIR}${dest}/${src_name}${suffix}\")
EXECUTE_PROCESS(COMMAND \${CMAKE_COMMAND} -E copy \"${src}\"
- \"\$ENV{DESTDIR}${dest}/${src_name}\"
+ \"\$ENV{DESTDIR}${dest}/${src_name}${suffix}\"
RESULT_VARIABLE copy_result
ERROR_VARIABLE error_output)
IF(copy_result)
MESSAGE(FATAL_ERROR \${error_output})
ENDIF()
ELSE()
- MESSAGE(STATUS \"Skipping : \$ENV{DESTDIR}${dest}/${src_name}\")
+ MESSAGE(STATUS \"Skipping : \$ENV{DESTDIR}${dest}/${src_name}${suffix}\")
ENDIF()
")
ENDFUNCTION(INSTALL_IF_NOT_EXISTS)
@@ -1119,7 +1119,11 @@ MATH(EXPR CONFLIST_MAX ${CONFLIST_COUNT}-1)
FOREACH(CONF_IDX RANGE ${CONFLIST_MAX})
LIST(GET CONFFILES ${CONF_IDX} CONF_FILE)
- INSTALL_IF_NOT_EXISTS(${CONF_FILE} ${CONFDIR})
+ IF(BUILD_PORT)
+ INSTALL_IF_NOT_EXISTS(${CONF_FILE} ${CONFDIR} ".sample")
+ ELSE(BUILD_PORT)
+ INSTALL_IF_NOT_EXISTS(${CONF_FILE} ${CONFDIR} "")
+ ENDIF(BUILD_PORT)
ENDFOREACH(CONF_IDX RANGE ${CONFLIST_MAX})
# Lua plugins