comparison CMakeLists.txt @ 1107:02c1b78b9b58

cmake: rename some targets and explain
author David Demelier <markand@malikania.fr>
date Wed, 20 Oct 2021 15:07:37 +0200
parents c94ae6941ce0
children 251976043986
comparison
equal deleted inserted replaced
1106:5facd2f604b6 1107:02c1b78b9b58
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 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 15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #
18
19 #
20 # Overview of projects targets
21 # ============================
22 #
23 # Irccd is a host program that loads C native plugins, to do so it exports the
24 # public API by its own and plugins must not link to the library code itself.
25 # But for unit testing the project we don't want to compile over and over the
26 # same files that *must* link against the library code so we split:
27 #
28 # - libirccd (lib/, static library): contains the public API for C plugins.
29 # - irccd-static (irccd/, object code): contains all irccd(1) code *without*
30 # the main entry point. This code isn't publicly exposed to the plugins.
31 # - irccd (irccd/, executable): contains main and config parser code.
32 # - irccdctl (irccdctl, executable): contain irccdctl(1) utility.
17 # 33 #
18 34
19 cmake_minimum_required(VERSION 2.20) 35 cmake_minimum_required(VERSION 2.20)
20 cmake_policy(SET CMP0048 NEW) 36 cmake_policy(SET CMP0048 NEW)
21 project(irccd 37 project(irccd
40 option(IRCCD_WITH_JS "Enable Javascript" On) 56 option(IRCCD_WITH_JS "Enable Javascript" On)
41 option(IRCCD_WITH_MAN "Enable manual pages" On) 57 option(IRCCD_WITH_MAN "Enable manual pages" On)
42 option(IRCCD_WITH_SSL "Enable SSL (requires OpenSSL)" On) 58 option(IRCCD_WITH_SSL "Enable SSL (requires OpenSSL)" On)
43 option(IRCCD_WITH_TESTS "Enable unit tests" On) 59 option(IRCCD_WITH_TESTS "Enable unit tests" On)
44 60
61 # Check presence of POSIX m library
62 find_library(M_LIBRARY m libm)
63
45 include(GNUInstallDirs) 64 include(GNUInstallDirs)
46 65
47 include(cmake/IrccdDefinePlugin.cmake) 66 include(cmake/IrccdDefinePlugin.cmake)
48 67
49 if (IRCCD_WITH_SSL) 68 if (IRCCD_WITH_SSL)
52 71
53 if (IRCCD_WITH_JS) 72 if (IRCCD_WITH_JS)
54 add_subdirectory(extern/libduktape) 73 add_subdirectory(extern/libduktape)
55 endif () 74 endif ()
56 75
57 # Check presence of POSIX m library
58 find_library(M_LIBRARY m libm)
59 76
60 add_subdirectory(extern/libutlist) 77 add_subdirectory(extern/libutlist)
61 add_subdirectory(extern/libketopt) 78 add_subdirectory(extern/libketopt)
62 79
63 add_subdirectory(lib) 80 add_subdirectory(lib)