summaryrefslogtreecommitdiffstats
path: root/cmake/Paths.cmake
blob: 858cdc265157c11bebc4eec281d54630d81c94bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Now CMAKE_INSTALL_PREFIX is a base prefix for everything
# CONFDIR - for configuration
# LOCAL_CONFDIR - for local configuration
# MANDIR - for manual pages
# RUNDIR - for runtime files
# DBDIR - for static files
# LOGDIR - for log files

IF(NOT CONFDIR)
    SET(CONFDIR "${CMAKE_INSTALL_PREFIX}/etc/rspamd")
ENDIF(NOT CONFDIR)

IF(NOT LOCAL_CONFDIR)
    SET(LOCAL_CONFDIR "${CONFDIR}")
ENDIF(NOT LOCAL_CONFDIR)

IF(NOT MANDIR)
    SET(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
ENDIF(NOT MANDIR)

IF(NOT RUNDIR)
    SET(RUNDIR "/var/run/rspamd")
ENDIF(NOT RUNDIR)

IF(NOT DBDIR)
    SET(DBDIR "/var/lib/rspamd")
ENDIF(NOT DBDIR)

IF(NOT LOGDIR)
    SET(LOGDIR "/var/log/rspamd")
ENDIF(NOT LOGDIR)

IF(NOT SHAREDIR)
    SET(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/rspamd")
ENDIF(NOT SHAREDIR)

IF(NOT LUALIBDIR)
    SET(LUALIBDIR "${SHAREDIR}/lualib")
ENDIF(NOT LUALIBDIR)

IF(NOT PLUGINSDIR)
    SET(PLUGINSDIR "${SHAREDIR}/plugins")
ENDIF(NOT PLUGINSDIR)

IF(NOT RULESDIR)
    SET(RULESDIR "${SHAREDIR}/rules")
ENDIF(NOT RULESDIR)

IF(NOT WWWDIR)
    SET(WWWDIR "${SHAREDIR}/www")
ENDIF(NOT WWWDIR)

# Set libdir
IF(NOT LIBDIR)
    SET(RSPAMD_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib/rspamd")
ELSE(NOT LIBDIR)
    SET(RSPAMD_LIBDIR "${LIBDIR}")
ENDIF(NOT LIBDIR)
SET(CMAKE_MACOSX_RPATH ON)
SET(CMAKE_INSTALL_RPATH "${RSPAMD_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)

SET(RSPAMD_DEFAULT_INCLUDE_PATHS "/opt;/usr;/usr/local;/opt/local;/usr/pkg;/opt/csw;/sw")
SET(RSPAMD_DEFAULT_LIBRARY_PATHS "/usr/local;/usr/pkg;/usr;/Library/Frameworks;/sw;/opt/local;/opt/csw;/opt")