comparison cmake/IrccdOptions.cmake @ 486:0b156b82b8c1

Irccd: rework of paths, closes #611
author David Demelier <markand@malikania.fr>
date Thu, 20 Jul 2017 15:12:41 +0200
parents 8ea7330101e6
children 6ec510722582
comparison
equal deleted inserted replaced
485:daf3aa8b2ddb 486:0b156b82b8c1
36 36
37 # 37 #
38 # Options that controls both installations and the irccd runtime: 38 # Options that controls both installations and the irccd runtime:
39 # 39 #
40 # WITH_BINDIR Binary directory for irccd, irccdctl 40 # WITH_BINDIR Binary directory for irccd, irccdctl
41 # WITH_PLUGINDIR Path where plugins must be installed 41 # WITH_CACHEDIR Path where to store temporary files
42 # WITH_CMAKEDIR Path where to install CMake configuration files
43 # WITH_DATADIR Path for data files
42 # WITH_DOCDIR Path where to install documentation 44 # WITH_DOCDIR Path where to install documentation
43 # WITH_MANDIR Path where to install manuals 45 # WITH_MANDIR Path where to install manuals
44 # WITH_CONFDIR Path where to search configuration files
45 # WITH_CACHEDIR Path where to store temporary files
46 # WITH_PKGCONFIGDIR Path where to install pkg-config files 46 # WITH_PKGCONFIGDIR Path where to install pkg-config files
47 # WITH_PLUGINDIR Path where plugins must be installed
48 # WITH_SYSCONFDIR Path where to install configuration files
47 # WITH_SYSTEMDDIR Path where to install systemd unit file 49 # WITH_SYSTEMDDIR Path where to install systemd unit file
48 # 50 #
49 51
50 # Manual pages on Windows are pretty useless. 52 # Manual pages on Windows are pretty useless.
51 if (WIN32) 53 if (WIN32)
82 # Installation paths. 84 # Installation paths.
83 # ------------------------------------------------------------------- 85 # -------------------------------------------------------------------
84 # 86 #
85 87
86 set(WITH_BINDIR "bin" CACHE STRING "Binary directory") 88 set(WITH_BINDIR "bin" CACHE STRING "Binary directory")
89 set(WITH_CACHEDIR "var/cache/irccd" CACHE STRING "Cache directory")
90 set(WITH_CMAKEDIR "lib/cmake" CACHE STRING "Directory for CMake modules")
91 set(WITH_DATADIR "share/irccd" CACHE STRING "Directory for additional data")
92 set(WITH_DOCDIR "share/doc/irccd" CACHE STRING "Documentation directory")
87 set(WITH_MANDIR "share/man" CACHE STRING "Man directory") 93 set(WITH_MANDIR "share/man" CACHE STRING "Man directory")
88 set(WITH_CONFDIR "etc" CACHE STRING "Configuration directory")
89 set(WITH_CMAKEDIR "lib/cmake" CACHE STRING "Directory for CMake modules")
90 set(WITH_PKGCONFIGDIR "lib/pkgconfig" CACHE STRING "Directory for pkg-config file") 94 set(WITH_PKGCONFIGDIR "lib/pkgconfig" CACHE STRING "Directory for pkg-config file")
95 set(WITH_PLUGINDIR "libexec/irccd/plugins" CACHE STRING "Module prefix where to install")
96 set(WITH_SYSCONFDIR "etc" CACHE STRING "Configuration directory")
91 set(WITH_SYSTEMDDIR "/usr/lib/systemd/system" CACHE STRING "Absolute path where to install systemd files") 97 set(WITH_SYSTEMDDIR "/usr/lib/systemd/system" CACHE STRING "Absolute path where to install systemd files")
92
93 #
94 # On Windows, we install the applcation like C:/Program Files/irccd so do not append irccd to the
95 # directories again.
96 #
97 if (WIN32)
98 set(WITH_DATADIR "share" CACHE STRING "Data directory")
99 set(WITH_CACHEDIR "var" CACHE STRING "Temporary files directory")
100 set(WITH_PLUGINDIR "share/plugins" CACHE STRING "Module prefix where to install")
101 set(WITH_DOCDIR "share/doc" CACHE STRING "Documentation directory")
102 else ()
103 set(WITH_DATADIR "share/irccd" CACHE STRING "Data directory")
104 set(WITH_CACHEDIR "var/irccd" CACHE STRING "Temporary files directory")
105 set(WITH_PLUGINDIR "share/irccd/plugins" CACHE STRING "Module prefix where to install")
106 set(WITH_DOCDIR "share/doc/irccd" CACHE STRING "Documentation directory")
107 endif ()
108
109 #
110 # Check if any of these path is absolute and raise an error if true.
111 #
112 foreach (d WITH_BINDIR WITH_CACHEDIR WITH_DATADIR WITH_CONFDIR WITH_PLUGINDIR)
113 if (IS_ABSOLUTE ${${d}})
114 message(FATAL_ERROR "${d} can not be absolute (${${d}} given)")
115 endif ()
116 endforeach ()
117 98
118 # 99 #
119 # Internal dependencies. 100 # Internal dependencies.
120 # ------------------------------------------------------------------- 101 # -------------------------------------------------------------------
121 # 102 #