Removed HAVE_CONFIG_H
[amule.git] / CMakeLists.txt
blob1ac17d4e3e083b5e35ff147b2ed4819b2edaa69c
1 cmake_minimum_required (VERSION 3.11)
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         amule-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()