# # Rspamd - rapid antispam system # # Cmake configuration file # ############################# INITIAL SECTION ############################################# PROJECT(rspamd C) ENABLE_LANGUAGE(ASM) SET(RSPAMD_VERSION_MAJOR 0) SET(RSPAMD_VERSION_MINOR 9) SET(RSPAMD_VERSION_PATCH 0) SET(RSPAMD_VERSION "${RSPAMD_VERSION_MAJOR}.${RSPAMD_VERSION_MINOR}.${RSPAMD_VERSION_PATCH}") SET(RSPAMD_MASTER_SITE_URL "https://rspamd.com") IF(NOT RSPAMD_USER) SET(RSPAMD_USER "nobody") SET(RSPAMD_GROUP "nobody") ENDIF(NOT RSPAMD_USER) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR) SET_PROPERTY(GLOBAL PROPERTY ALLOW_DUPLICATE_CUSTOM_TARGETS 1) ############################# OPTIONS SECTION ############################################# OPTION(DEBUG_MODE "Enable debug output [default: ON]" ON) OPTION(ENABLE_OPTIMIZATION "Enable optimization [default: OFF]" OFF) OPTION(SKIP_RELINK_RPATH "Skip relinking and full RPATH for the install tree" OFF) OPTION(ENABLE_REDIRECTOR "Enable redirector install [default: OFF]" OFF) OPTION(ENABLE_GPERF_TOOLS "Enable google perftools [default: OFF]" OFF) OPTION(ENABLE_STATIC "Enable static compiling [default: OFF]" OFF) OPTION(ENABLE_LUAJIT "Link with libluajit [default: ON]" ON) OPTION(ENABLE_DB "Find and link with DB library [default: OFF]" OFF) OPTION(ENABLE_SQLITE "Find and link with sqlite3 library [default: OFF]" OFF) OPTION(ENABLE_HIREDIS "Find and link with external redis library [default: ON]" ON) OPTION(ENABLE_URL_INCLUDE "Enable urls in ucl includes (requires libcurl or libfetch) [default: OFF]" OFF) OPTION(NO_SHARED "Build internal libs static [default: ON]" ON) OPTION(FORCE_GMIME24 "Link with gmime2.4 [default: OFF]" OFF) OPTION(INSTALL_EXAMPLES "Install examples [default: OFF]" OFF) OPTION(INSTALL_WEBUI "Install web interface [default: ON]" ON) OPTION(WANT_SYSTEMD_UNITS "Install systemd unit files on Linux [default: OFF]" OFF) # Build optimized code for following CPU (default i386) #SET(CPU_TUNE "i686") # Now CMAKE_INSTALL_PREFIX is a base prefix for everything # CONFDIR - for configuration # MANDIR - for manual pages # RUNDIR - for runtime files # DBDIR - for static files # LOGDIR - for log files # EXAMPLESDIR - for examples files IF(NOT CONFDIR) SET(CONFDIR "${CMAKE_INSTALL_PREFIX}/etc/rspamd") ENDIF(NOT CONFDIR) IF(NOT MANDIR) SET(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man") ENDIF(NOT MANDIR) IF(NOT RUNDIR) SET(RUNDIR "${CMAKE_INSTALL_PREFIX}/var/run/rspamd") ENDIF(NOT RUNDIR) IF(NOT DBDIR) SET(DBDIR "${CMAKE_INSTALL_PREFIX}/var/lib/rspamd") ENDIF(NOT DBDIR) IF(NOT LOGDIR) SET(LOGDIR "${CMAKE_INSTALL_PREFIX}/var/log/rspamd") ENDIF(NOT LOGDIR) IF(NOT EXAMPLESDIR) SET(EXAMPLESDIR "${CMAKE_INSTALL_PREFIX}/share/examples/rspamd") ENDIF(NOT EXAMPLESDIR) IF(NOT PLUGINSDIR) SET(PLUGINSDIR "${CMAKE_INSTALL_PREFIX}/share/rspamd") ENDIF(NOT PLUGINSDIR) IF(NOT WWWDIR) SET(WWWDIR "${CMAKE_INSTALL_PREFIX}/share/rspamd/www") ENDIF(NOT WWWDIR) # Set libdir IF(NOT LIBDIR) SET(LIBDIR lib/rspamd) IF(NOT CMAKE_INSTALL_RPATH) SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${LIBDIR}) ENDIF(NOT CMAKE_INSTALL_RPATH) ENDIF(NOT LIBDIR) # Set includedir IF(NOT INCLUDEDIR) SET(INCLUDEDIR include/rspamd) ENDIF(NOT INCLUDEDIR) IF(NOT SYSTEMDDIR) SET(SYSTEMDDIR ${CMAKE_INSTALL_PREFIX}/lib/systemd/system) ENDIF(NOT SYSTEMDDIR) ############################# INCLUDE SECTION ############################################# INCLUDE(CheckIncludeFiles) INCLUDE(CheckFunctionExists) INCLUDE(CheckSymbolExists) INCLUDE(CheckCSourceCompiles) INCLUDE(CheckLibraryExists) INCLUDE(FindPkgConfig) INCLUDE(CheckCCompilerFlag) INCLUDE(FindPerl) INCLUDE(FindOpenSSL) ############################# MACRO SECTION ############################################# # Find lua installation MACRO(FindLua _major _minor) # Find lua libraries MESSAGE(STATUS "Check for lua ${_major}.${_minor}") UNSET(LUA_INCLUDE_DIR CACHE) UNSET(LUA_LIBRARY CACHE) FIND_PATH(LUA_INCLUDE_DIR lua.h HINTS $ENV{LUA_DIR} PATH_SUFFIXES "include/lua${_major}${_minor}" "include/lua${_major}.${_minor}" "include/lua-${_major}.${_minor}" include/lua include PATHS /usr/local /usr/pkg /usr ~/Library/Frameworks /Library/Frameworks /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave /opt ) # Check for luajit IF(ENABLE_LUAJIT MATCHES "ON") FIND_LIBRARY(LUA_LIBRARY NAMES "luajit${_major}${_minor}" "luajit${_major}.${_minor}" "luajit-${_major}.${_minor}" "luajit" HINTS $ENV{LUA_DIR} PATH_SUFFIXES lib64 lib PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /usr/pkg /opt ) ELSE(ENABLE_LUAJIT MATCHES "ON") FIND_LIBRARY(LUA_LIBRARY NAMES lua "lua${_major}${_minor}" "lua${_major}.${_minor}" "lua-${_major}.${_minor}" HINTS $ENV{LUA_DIR} PATH_SUFFIXES lib64 lib PATHS /usr/local /usr ~/Library/Frameworks /Library/Frameworks /sw /opt/local /opt/csw /opt DOC "Lua library" ) ENDIF(ENABLE_LUAJIT MATCHES "ON") IF(LUA_LIBRARY AND LUA_INCLUDE_DIR) SET(LUA_FOUND 1) IF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR) SET(LUA_VERSION_MAJOR ${_major}) SET(LUA_VERSION_MINOR ${_minor}) ENDIF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR) MESSAGE(STATUS "Found lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") ENDIF(LUA_LIBRARY AND LUA_INCLUDE_DIR) ENDMACRO(FindLua _major _minor) FUNCTION(INSTALL_IF_NOT_EXISTS src dest destname suffix) IF(NOT IS_ABSOLUTE "${src}") SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${src}") ENDIF() GET_FILENAME_COMPONENT(src_name "${src}" NAME) GET_FILENAME_COMPONENT(dest_name "${destname}" NAME) IF(NOT IS_ABSOLUTE "${dest}") SET(dest "${CMAKE_INSTALL_PREFIX}/${dest}") ENDIF() INSTALL(CODE " IF(NOT EXISTS \"\$ENV{DESTDIR}${dest}/${dest_name}${suffix}\") #FILE(INSTALL \"${src}\" DESTINATION \"${dest}\") MESSAGE(STATUS \"Installing: \$ENV{DESTDIR}${dest}/${dest_name}${suffix}\") EXECUTE_PROCESS(COMMAND \${CMAKE_COMMAND} -E copy \"${src}\" \"\$ENV{DESTDIR}${dest}/${dest_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}/${dest_name}${suffix}\") ENDIF() ") ENDFUNCTION(INSTALL_IF_NOT_EXISTS) # Process required package by using FindPackage and calling for INCLUDE_DIRECTORIES and # setting list of required libraries MACRO(ProcessPackage var _name0) PKG_SEARCH_MODULE(${var} REQUIRED "${_name0}" ${ARGN}) IF(${var}_FOUND) SET(WITH_${var} 1) IF(ENABLE_STATIC MATCHES "ON") SET(_XPREFIX "${var}_STATIC") ELSE(ENABLE_STATIC MATCHES "ON") SET(_XPREFIX "${var}") ENDIF(ENABLE_STATIC MATCHES "ON") FOREACH(_arg ${${_XPREFIX}_INCLUDE_DIRS}) INCLUDE_DIRECTORIES("${_arg}") SET(${var}_INCLUDE_DIR "${_arg}") ENDFOREACH(_arg ${${_XPREFIX}_INCLUDE_DIRS}) FOREACH(_arg ${${_XPREFIX}_LIBRARY_DIRS}) LINK_DIRECTORIES("${_arg}") ENDFOREACH(_arg ${${_XPREFIX}_LIBRARY_DIRS}) # Handle other CFLAGS and LDFLAGS FOREACH(_arg ${${_XPREFIX}_CFLAGS_OTHER}) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_arg}") ENDFOREACH(_arg ${${_XPREFIX}_CFLAGS_OTHER}) FOREACH(_arg ${${_XPREFIX}_LDFLAGS_OTHER}) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${_arg}") ENDFOREACH(_arg ${${_XPREFIX}_LDFLAGS_OTHER}) LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "${${_XPREFIX}_LIBRARIES}") ELSE(${var}_FOUND) MESSAGE(FATAL_ERROR "Packages ${_name0} ${ARGN} could not be found") ENDIF(${var}_FOUND) ENDMACRO(ProcessPackage name) MACRO(ADD_PRECOMPILED_HEADER _target _input) GET_FILENAME_COMPONENT(_name ${_input} NAME) SET(_outdir "${CMAKE_BINARY_DIR}/${_name}.pch") MAKE_DIRECTORY(${_outdir}) SET(_output "${_outdir}/${_name}.pch") STRING(TOUPPER "CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name) SET(_compi
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2009-2012, Matthias Sohn <matthias.sohn@sap.com>
and other copyright owners as documented in the project's IP log.
This program and the accompanying materials are made available
under the terms of the Eclipse Distribution License v1.0 which
accompanies this distribution, is reproduced below, and is
available at http://www.eclipse.org/org/documents/edl-v10.php
All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
- Neither the name of the Eclipse Foundation, Inc. nor the
names of its contributors may be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>jgit.tycho.parent</artifactId>
<version>4.0.2.201509141540-r</version>
</parent>
<groupId>org.eclipse.jgit.feature</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<packaging>eclipse-feature</packaging>
<name>JGit Feature</name>
<dependencies>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>