Mercurial > irccd
comparison CMakeLists.txt @ 1098:6c15d37b7518
cmake: switch back to CMake because of portability issues
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 22 Sep 2021 15:44:36 +0200 |
parents | |
children | 5b9c21b3907a |
comparison
equal
deleted
inserted
replaced
1097:617c88eb9da9 | 1098:6c15d37b7518 |
---|---|
1 # | |
2 # CMakeLists.txt -- CMake build system for irccd | |
3 # | |
4 # Copyright (c) 2013-2021 David Demelier <markand@malikania.fr> | |
5 # | |
6 # Permission to use, copy, modify, and/or distribute this software for any | |
7 # purpose with or without fee is hereby granted, provided that the above | |
8 # copyright notice and this permission notice appear in all copies. | |
9 # | |
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 # | |
18 | |
19 cmake_minimum_required(VERSION 2.20) | |
20 cmake_policy(SET CMP0048 NEW) | |
21 project(irccd | |
22 LANGUAGES C | |
23 DESCRIPTION "IRC Client Daemon" | |
24 HOMEPAGE_URL "http://projects.malikania.fr/irccd" | |
25 VERSION 4.0.0 | |
26 ) | |
27 | |
28 set_property(GLOBAL PROPERTY USE_FOLDERS On) | |
29 | |
30 set(CMAKE_C_STANDARD 11) | |
31 set(CMAKE_C_STANDARD_REQUIRED On) | |
32 set(CMAKE_C_EXTENSIONS Off) | |
33 | |
34 if (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") | |
35 set(CMAKE_C_FLAGS "-Wall -Wextra -pedantic ${CMAKE_C_FLAGS}") | |
36 endif () | |
37 | |
38 option(IRCCD_WITH_EXAMPLES "Enable example files" On) | |
39 option(IRCCD_WITH_JS "Enable Javascript" On) | |
40 option(IRCCD_WITH_MAN "Enable manual pages" On) | |
41 option(IRCCD_WITH_SSL "Enable SSL (requires OpenSSL)" On) | |
42 option(IRCCD_WITH_TESTS "Enable unit tests" On) | |
43 | |
44 include(GNUInstallDirs) | |
45 | |
46 include(cmake/IrccdDefinePlugin.cmake) | |
47 | |
48 if (IRCCD_WITH_SSL) | |
49 find_package(OpenSSL REQUIRED) | |
50 endif () | |
51 | |
52 if (IRCCD_WITH_JS) | |
53 add_subdirectory(extern/libduktape) | |
54 endif () | |
55 | |
56 add_subdirectory(extern/libutlist) | |
57 add_subdirectory(extern/libketopt) | |
58 | |
59 add_subdirectory(lib) | |
60 add_subdirectory(irccd) | |
61 add_subdirectory(irccdctl) | |
62 add_subdirectory(plugins) | |
63 | |
64 if (IRCCD_WITH_EXAMPLES) | |
65 add_subdirectory(examples) | |
66 endif () | |
67 if (IRCCD_WITH_MAN) | |
68 add_subdirectory(man) | |
69 endif () | |
70 | |
71 if (IRCCD_WITH_TESTS) | |
72 enable_testing() | |
73 add_subdirectory(extern/libgreatest) | |
74 add_subdirectory(tests) | |
75 endif () |