Opening the changelog for 2.3.4...
[amule.git] / CMakeLists.txt
blob7600a4e4ae43d49dd57629ac0083a887838a26c6
1 cmake_minimum_required (VERSION 3.13)
2 project (amule)
3 set (MIN_BOOST_VERSION 1.47)
4 set (MIN_CRYPTOPP_VERSION 5.6)
5 set (MIN_GDLIB_VERSION 2.0.0)
6 set (MIN_WX_VERSION 2.8.12)
7 set (PACKAGE "amule")
8 set (PACKAGE_BUGREPORT "admin@amule.org")
9 set (PACKAGE_NAME "aMule")
10 set (PACKAGE_STRING "aMule SVN")
11 set (PACKAGE_TARNAME "amule")
12 set (PACKAGE_URL \"\")
13 set (PACKAGE_VERSION "SVN")
14 set (VERSION "GIT")
15 set (DEFAULT_BUILD_TYPE "Release")
16 set (RECONF_COMMAND ${CMAKE_COMMAND})
18 if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
19         SET (DEFAULT_BUILD_TYPE "Debug")
20 endif()
22 # Set the possible values of build type for cmake-gui
23 if (CMAKE_CONFIGURATION_TYPES)
24         set (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE
25                 STRING "Semicolon separated list of supported configuration types, only supports debug and release, anything else will be ignored" FORCE
26         )
28         set_property (CACHE CMAKE_CONFIGURATION_TYPES PROPERTY STRINGS
29                 "Debug" "Release"
30         )
31 endif()
33 if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
34         message (STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.")
35         set (CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE
36                 STRING "Choose the type of build." FORCE
37         )
38 endif()
40 include (cmake/CmDaB.cmake)
41 include (cmake/manpage_install.cmake)
42 include (cmake/options.cmake)
43 include (cmake/search-dirs.cmake)
45 if (BUILD_AMULECMD OR BUILD_WEBSERVER)
46         include (cmake/FindReadline.cmake)
47 endif()
49 if (BUILD_CAS)
50         include (cmake/gdlib.cmake)
51         include (cmake/getopt_long.cmake)
52 endif()
54 if (BUILD_PLASMAMULE)
55         find_package (Qt4 COMPONENTS QtCore QtGUI REQUIRED)
56 endif()
58 if (BUILD_WEBSERVER OR NEED_ZLIB)
59         include (cmake/zlib.cmake)
60 endif()
62 if (BUILD_WEBSERVER)
63         include (cmake/png.cmake)
64 endif()
66 if (ENABLE_BOOST)
67         include (cmake/boost.cmake)
68 endif()
70 if (ENABLE_IP2COUNTRY)
71         include (cmake/ip2country.cmake)
72 endif()
74 if (ENABLE_NLS)
75         include (cmake/nls.cmake)
76 endif()
78 if (ENABLE_UPNP)
79         include (cmake/upnp.cmake)
80 endif()
82 if (NEED_GLIB_CHECK)
83         include (cmake/glib21.cmake)
84 endif()
86 if (NEED_LIB_CRYPTO)
87         include (cmake/cryptopp.cmake)
88 endif()
90 if (wx_NEEDED)
91         include (cmake/wx.cmake)
92 endif()
94 if (NOT SVNDATE)
95         find_package (Git)
97         if (GIT_FOUND)
98                 execute_process (
99                         COMMAND ${GIT_EXECUTABLE} describe
100                         OUTPUT_VARIABLE GIT_INFO_WC_REVISION
101                         OUTPUT_STRIP_TRAILING_WHITESPACE
102                         WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
103         endif (GIT_FOUND)
105         set (SVNDATE "rev. ${GIT_INFO_WC_REVISION}" CACHE STRING "Revision to be written to version string" FORCE)
106         message (STATUS "git revision ${SVNDATE} found")
107 endif()
109 include (cmake/bfd.cmake)
111 configure_file (
112         config.h.cm
113         config.h
116 if (WIN32)
117         configure_file (
118                 version.rc.in
119                 version.rc
120         )
121 endif()
123 if (BUILD_MONOLITHIC)
124         install (FILES amule.desktop
125                 DESTINATION "${CMAKE_INSTALL_DATADIR}/applications"
126         )
127 endif()
129 if (BUILD_REMOTEGUI)
130         install (FILES amulegui.desktop
131                 DESTINATION "${CMAKE_INSTALL_DATADIR}/applications"
132         )
133 endif()
135 add_subdirectory (docs)
136 add_subdirectory (src)
138 if (BUILD_TESTING)
139         enable_testing()
140         add_subdirectory (unittests)
141 endif()
143 message (STATUS "
145         Configured aMule ${PACKAGE_VERSION}${SVN_REVISION} for '${CMAKE_SYSTEM}' on '${CMAKE_SYSTEM_PROCESSOR}'.
147         aMule enabled options:
149         **** aMule Core ****
150         Prefix where aMule should be installed?                         ${CMAKE_PREFIX_PATH}
151         Should aMule be compiled with i18n support?                     ${ENABLE_NLS}
152         Which mode should aMule be compiled in?                         ${CMAKE_BUILD_TYPE}
153         Should aMule be compiled with UPnP support?                     ${ENABLE_UPNP}
154         Should aMule be compiled with IP2country support?               ${ENABLE_IP2COUNTRY}
155         Should aMule monolithic application be built?                   ${BUILD_MONOLITHIC}
156         Should aMule daemon version be built?                           ${BUILD_DAEMON}
157         Should aMule remote gui be built?                               ${BUILD_REMOTEGUI}
159         **** aMule TextClient ****
160         Should aMule Command Line Client be built?                      ${BUILD_AMULECMD}
162         **** aMule WebServer ****
163         Should aMule WebServer be built?                                ${BUILD_WEBSERVER}
165         **** aMule ED2K Links Handler ****
166         Should aMule ED2K Links Handler be built?                       ${BUILD_ED2K}
168         **** aMuleLinkCreator ****
169         Should aMuleLinkCreator GUI version (alc) be built?             ${BUILD_ALC}
170         Should aMuleLinkCreator for console (alcc) be built?            ${BUILD_ALCC}
172         **** aMule Statistics ****
173         Should C aMule Statistics (CAS) be built?                       ${BUILD_CAS}
174         Should aMule GUI Statistics (wxCas) be built?                   ${BUILD_WXCAS}"
177 if (UNIX)
178         message ("      Should xas XChat2 plugin be installed?                          ${BUILD_XAS}")
179 endif()
181 message ("
182         **** General Libraries and Tools ****
183         Should aMule file viewer for console be built?                  ${BUILD_FILEVIEW}
185         Libraries aMule will use to build:"
188 if (NEED_WX)
189         message (STATUS "                       wxWidgets                               ${WX_VERSION}")
190 endif()
192 if (ASIO_SOCKETS)
193         message ("                      boost                           ${Boost_VERSION}")
194 endif()
196 if (NEED_LIB_CRYPTO)
197         message ("                      crypto++                        ${CRYPTOPP_VERSION} in ${CRYPTOPP_INCLUDE_PREFIX}")
198 endif()
200 if (ENABLE_UPNP)
201         message ("                      libupnp                         ${LIBUPNP_VERSION}")
202 endif()
204 message ("                      libintl                         ${ENABLE_NLS}")
206 if (ENABLE_IP2COUNTRY)
207         message ("                      libGeoIP                        ${GEOIP_LIB}")
208 endif()
210 if (BUILD_WEBSERVER)
211         message ("                      libpng                          ${PNG_VERSION_STRING}")
212 endif()
214 if (BUILD_CAS)
215         message ("                      libgd                           ${gdlib_VERSION}")
216 endif()
218 if (NEED_ZLIB)
219         message ("                      zlib                            ${ZLIB_VERSION_STRING}")
220 endif()