2 # This file is part of the aMule Project.
4 # Copyright (c) 2011 Werner Mahr (Vollstrecker) <amule@vollstreckernet.de>
6 # Any parts of this program contributed by third-party developers are copyrighted
7 # by their respective authors.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 # This file contains the options for en- or disabling parts of aMule, and
24 # sets the needed variables for them to compile
27 option (BUILD_ALC "compile aLinkCreator GUI version")
28 option (BUILD_ALCC "compile aLinkCreator for console")
29 option (BUILD_AMULECMD "compile aMule command line client")
32 option (BUILD_CAS "compile C aMule Statistics")
35 option (BUILD_DAEMON "compile aMule daemon version")
36 option (BUILD_ED2K "compile aMule ed2k links handler" ON)
37 option (BUILD_EVERYTHING "compile all parts of aMule")
38 option (BUILD_FILEVIEW "compile aMule file viewer for console (EXPERIMENTAL)")
39 option (BUILD_MONOLITHIC "enable building of the monolithic aMule app" ON)
42 option (BUILD_PLASMAMULE "compile aMule plasma applet and engine")
45 option (BUILD_REMOTEGUI "compile aMule remote GUI")
46 option (BUILD_WEBSERVER "compile aMule WebServer")
47 option (BUILD_WXCAS "compile aMule GUI Statistics")
48 option (BUILD_XAS "install xas XChat2 plugin")
49 option (BUILD_TESTING "Run Tests after compile" ON)
52 set (CMAKE_INSTALL_PREFIX "${PREFIX}")
55 include (GNUInstallDirs)
57 set (PKGDATADIR "${CMAKE_INSTALL_DATADIR}/${PACKAGE}")
60 set (BUILD_ALC ON CACHE BOOL "compile aLinkCreator GUI version" FORCE)
61 set (BUILD_ALCC ON CACHE BOOL "compile aLinkCreator for console" FORCE)
62 set (BUILD_AMULECMD ON CACHE BOOL "compile aMule command line client" FORCE)
65 set (BUILD_CAS ON CACHE BOOL "compile C aMule Statistics" FORCE)
68 set (BUILD_DAEMON ON CACHE BOOL "compile aMule daemon version" FORCE)
69 set (BUILD_FILEVIEW ON CACHE BOOL "compile aMule file viewer for console (EXPERIMENTAL)" FORCE)
72 # set (BUILD_PLASMAMULE ON CACHE BOOL )
75 set (BUILD_REMOTEGUI ON CACHE BOOL "compile aMule remote GUI" FORCE)
76 set (BUILD_WEBSERVER ON CACHE BOOL "compile aMule WebServer" FORCE)
77 set (BUILD_WXCAS ON CACHE BOOL "compile aMule GUI Statistics" FORCE)
78 set (BUILD_XAS ON CACHE BOOL "install xas XChat2 plugin" FORCE)
82 set (NEED_LIB_EC TRUE)
83 set (NEED_LIB_MULECOMMON TRUE)
84 set (NEED_LIB_MULESOCKET TRUE)
85 set (wx_NEED_NET TRUE)
95 set (wx_NEED_BASE TRUE)
100 set (wx_NEED_GUI TRUE)
104 set (BUILD_UTIL TRUE)
108 set (NEED_LIB_EC TRUE)
109 set (NEED_LIB_MULEAPPCOMMON TRUE)
110 set (NEED_LIB_MULECOMMON TRUE)
111 set (NEED_LIB_MULESOCKET TRUE)
113 set (wx_NEED_NET TRUE)
117 set (wx_NEED_BASE TRUE)
121 set (BUILD_UTIL TRUE)
122 set (NEED_LIB_CRYPTO TRUE)
123 set (NEED_LIB_MULECOMMON TRUE)
124 set (wx_NEED_NET TRUE)
127 if (BUILD_MONOLITHIC)
128 set (NEED_LIB_EC TRUE)
129 set (NEED_LIB_MULEAPPGUI TRUE)
130 set (NEED_LIB_MULEAPPCOMMON TRUE)
131 set (NEED_LIB_MULECOMMON TRUE)
132 set (NEED_LIB_MULESOCKET TRUE)
134 set (wx_NEED_ADV TRUE)
135 set (wx_NEED_NET TRUE)
138 if (BUILD_MONOLITHIC OR BUILD_REMOTEGUI)
139 set (INSTALL_SKINS TRUE)
142 if (BUILD_PLASMAMULE)
143 set (BUILD_UTIL TRUE)
147 set (NEED_GLIB_CHECK TRUE)
148 set (NEED_LIB_EC TRUE)
149 set (NEED_LIB_MULEAPPCOMMON TRUE)
150 set (NEED_LIB_MULEAPPGUI TRUE)
151 set (NEED_LIB_MULECOMMON TRUE)
152 set (NEED_LIB_MULESOCKET TRUE)
154 set (wx_NEED_ADV TRUE)
155 set (wx_NEED_NET TRUE)
159 set (NEED_LIB_EC TRUE)
160 set (NEED_LIB_MULECOMMON TRUE)
161 set (NEED_LIB_MULESOCKET TRUE)
163 set (WEBSERVERDIR "${PKGDATADIR}/webserver/")
164 set (wx_NEED_NET TRUE)
168 set (BUILD_UTIL TRUE)
169 set (wx_NEED_GUI TRUE)
170 set (wx_NEED_NET TRUE)
174 set (NEED_LIB_CRYPTO TRUE)
177 if (NEED_LIB_MULECOMMON OR NEED_LIB_EC)
179 set (wx_NEED_BASE TRUE)
182 if (NEED_LIB_MULECOMMON)
183 set (NEED_GLIB_CHECK TRUE)
186 if (NEED_LIB_MULEAPPCOMMON)
187 option (ENABLE_BOOST "compile with Boost.ASIO Sockets" ON)
188 option (ENABLE_IP2COUNTRY "compile with GeoIP IP2Country library")
189 option (ENABLE_MMAP "enable using mapped memory if supported")
190 option (ENABLE_NLS "enable national language support" ON)
191 set (NEED_LIB_MULEAPPCORE TRUE)
192 set (wx_NEED_BASE TRUE)
194 set (ENABLE_BOOST FALSE)
195 set (ENABLE_IP2COUNTRY FALSE)
196 set (ENABLE_MMAP FALSE)
197 set (ENABLE_NLS FALSE)
200 if (NEED_LIB_MULEAPPGUI)
201 set (wx_NEED_GUI TRUE)
204 if (NEED_LIB_MULESOCKET)
205 set (wx_NEED_BASE TRUE)
208 if (ENABLE_BOOST AND NOT (BUILD_DAEMON OR BUILD_MONOLITHIC OR BUILD_REMOTEGUI OR BUILD_WXCAS))
209 set (wx_NEED_NET FALSE)
212 if (wx_NEED_ADV OR wx_NEED_BASE OR wx_NEED_GUI OR wx_NEED_NET)
215 if (WIN32 AND NOT wx_NEED_BASE)
216 set (wx_NEED_BASE TRUE)
220 ADD_COMPILE_DEFINITIONS ($<$<CONFIG:DEBUG>:__DEBUG__>)
223 ADD_COMPILE_DEFINITIONS ($<$<CONFIG:DEBUG>:wxDEBUG_LEVEL=0>)
226 if (NEED_LIB_MULEAPPCOMMON OR BUILD_WEBSERVER)
227 option (ENABLE_UPNP "enable UPnP support in aMule" ON)