1 From 9d1ba2f7c5d72436b17d0f3982a00380c72a58f8 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jose.bollo@iot.bzh>
3 Date: Mon, 4 Jul 2016 13:54:59 +0200
4 Subject: [PATCH] cmake: Improves directories and libsystemd
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 The previous implementation was not fully compliant with
10 standards. It was missing some of the predefined variable
11 DATAROOTDIR, it was missing specificity of
12 CMAKE_INSTALL_FULL_SYSCONFDIR. It also was not compatible
13 with yocto build system bitbake.
15 The library systemd is changing. The previous previous
16 pkg-config files 'libsystemd-daemon' and 'libsystemd-journal'
17 are now deprecated in favour of 'libsystemd'.
19 Upstream-status: Submitted [https://github.com/Samsung/cynara/pull/16]
21 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
23 CMakeLists.txt | 46 ++++++++++++++++++++--------------------------
24 1 file changed, 20 insertions(+), 26 deletions(-)
26 diff --git a/CMakeLists.txt b/CMakeLists.txt
27 index b0ee75f..6a439e2 100644
30 @@ -43,66 +43,60 @@ ENDIF (NOT BUILD_COMMONS AND NOT BUILD_SERVICE AND NOT BUILD_DBUS)
32 ########################## search for packages ################################
34 -#1st case. User choose to build with systemd.
35 -IF (DEFINED BUILD_WITH_SYSTEMD AND BUILD_WITH_SYSTEMD)
36 - PKG_CHECK_MODULES(SYSTEMD_DEP
41 -ENDIF (DEFINED BUILD_WITH_SYSTEMD AND BUILD_WITH_SYSTEMD)
42 +#Search the new libsystemd package
43 +PKG_CHECK_MODULES(SYSTEMD_DEP QUIET libsystemd)
45 -#2nd case. User choose not to build with systemd. Noting to do in this case.
46 -#IF (DEFINED BUILD_WITH_SYSTEMD AND NOT BUILD_WITH_SYSTEMD)
47 -#ENDIF (DEFINED BUILD_WITH_SYSTEMD AND NOT BUILD_WITH_SYSTEMD)
49 -#3rd case. User did not choose. If we can we will use systemd.
50 -IF (NOT DEFINED BUILD_WITH_SYSTEMD)
51 +#Fallback ot the oldest libsystemd packages
52 +IF(NOT SYSTEMD_DEP_FOUND)
53 PKG_CHECK_MODULES(SYSTEMD_DEP
59 - IF (SYSTEMD_DEP_FOUND)
60 - SET(BUILD_WITH_SYSTEMD ON)
61 - ENDIF (SYSTEMD_DEP_FOUND)
62 -ENDIF (NOT DEFINED BUILD_WITH_SYSTEMD)
63 +ENDIF(NOT SYSTEMD_DEP_FOUND)
66 +IF(SYSTEMD_DEP_FOUND)
67 + #Enforce use of systemd if present
68 + SET(BUILD_WITH_SYSTEMD ON)
69 +ELSEIF(BUILD_WITH_SYSTEMD)
70 + MESSAGE(FATAL_ERROR "Can't find libsystemd")
73 ######################## directory configuration ############################
76 - "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
77 + "${CMAKE_INSTALL_FULL_LIBDIR}"
79 "Object code libraries directory")
82 - "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}"
83 + "${CMAKE_INSTALL_FULL_BINDIR}"
85 "User executables directory")
88 - "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SBINDIR}"
89 + "${CMAKE_INSTALL_FULL_SBINDIR}"
91 "System admin executables directory")
94 - "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SYSCONFDIR}"
95 + "${CMAKE_INSTALL_FULL_SYSCONFDIR}"
97 "Read-only single-machine data directory")
100 - "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}"
101 + "${CMAKE_INSTALL_FULL_INCLUDEDIR}"
103 "Header files directory")
106 - "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LOCALSTATEDIR}"
107 + "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}"
109 "Modifiable single-machine data directory")
112 - "${CMAKE_INSTALL_PREFIX}/share"
113 + "${CMAKE_INSTALL_FULL_DATAROOTDIR}"
115 "Read-only architecture-independent data root directory")