comparison CMakeLists.txt @ 823:d76699e13156

cmake: use GetPrerequisites, closes #988 @1h
author David Demelier <markand@malikania.fr>
date Fri, 21 Dec 2018 14:32:57 +0100
parents 49fa22f0b4b9
children 06cc2f95f479
comparison
equal deleted inserted replaced
822:5120b9793d1f 823:d76699e13156
51 51
52 cmake_minimum_required(VERSION 3.10) 52 cmake_minimum_required(VERSION 3.10)
53 project(irccd) 53 project(irccd)
54 54
55 include(GNUInstallDirs) 55 include(GNUInstallDirs)
56 include(InstallRequiredSystemLibraries)
56 57
57 # Helper to set global internal variables. 58 # Helper to set global internal variables.
58 function(setg var value) 59 function(setg var value)
59 set("${var}" "${value}" CACHE INTERNAL "") 60 set("${var}" "${value}" CACHE INTERNAL "")
60 endfunction () 61 endfunction ()
64 set(CMAKE_CXX_STANDARD 17) 65 set(CMAKE_CXX_STANDARD 17)
65 set(CMAKE_CXX_STANDARD_REQUIRED On) 66 set(CMAKE_CXX_STANDARD_REQUIRED On)
66 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${irccd_SOURCE_DIR}/cmake/packages) 67 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${irccd_SOURCE_DIR}/cmake/packages)
67 set(CMAKE_POSITION_INDEPENDENT_CODE On) 68 set(CMAKE_POSITION_INDEPENDENT_CODE On)
68 set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS On) 69 set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS On)
69
70 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 70 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
71 71
72 foreach (cfg ${CMAKE_CONFIGURATION_TYPES}) 72 foreach (cfg ${CMAKE_CONFIGURATION_TYPES})
73 string(TOUPPER CFG ${cfg}) 73 string(TOUPPER CFG ${cfg})
74 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG} ${CMAKE_BINARY_DIR}/bin/${cfg}) 74 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG} ${CMAKE_BINARY_DIR}/bin/${cfg})
112 add_subdirectory(tests) 112 add_subdirectory(tests)
113 endif () 113 endif ()
114 114
115 add_subdirectory(cmake/export) 115 add_subdirectory(cmake/export)
116 116
117 if (CMAKE_SYSTEM_NAME MATCHES "Windows")
118 add_subdirectory(cmake/windows)
119 endif ()
120
121 message("Compiling with the following flags:") 117 message("Compiling with the following flags:")
122 message(" General flags: ${CMAKE_CXX_FLAGS}") 118 message(" General flags: ${CMAKE_CXX_FLAGS}")
123 message(" Debug flags: ${CMAKE_CXX_FLAGS_DEBUG}") 119 message(" Debug flags: ${CMAKE_CXX_FLAGS_DEBUG}")
124 message(" Release flags: ${CMAKE_CXX_FLAGS_RELEASE}") 120 message(" Release flags: ${CMAKE_CXX_FLAGS_RELEASE}")
125 message("") 121 message("")
139 string(TOUPPER ${plugin} name) 135 string(TOUPPER ${plugin} name)
140 irccd_indent_message(" ${plugin}: " "${IRCCD_WITH_PLUGIN_${name}_MSG}" 22) 136 irccd_indent_message(" ${plugin}: " "${IRCCD_WITH_PLUGIN_${name}_MSG}" 22)
141 endforeach () 137 endforeach ()
142 message("") 138 message("")
143 139
144 if (CMAKE_SYSTEM_NAME MATCHES "Windows")
145 message("Installing these DLLs:")
146 foreach (name ${IRCCD_DLLS})
147 irccd_indent_message(" ${name}: " "${${name}}" 30)
148 endforeach ()
149 message("")
150
151 if (IRCCD_DLLS_NOT_FOUND)
152 message("The following DLLs were not found:")
153 foreach (name ${IRCCD_DLLS_NOT_FOUND})
154 message(" ${name}")
155 endforeach ()
156 message("")
157 endif ()
158 endif ()
159
160 include(cmake/IrccdPackage.cmake) 140 include(cmake/IrccdPackage.cmake)
161 include(CPack) 141 include(CPack)