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