]> granicus.if.org Git - icinga2/blob - lib/base/CMakeLists.txt
Merge pull request #7185 from Icinga/bugfix/gelfwriter-wrong-log-facility
[icinga2] / lib / base / CMakeLists.txt
1 # Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+
2
3 mkclass_target(application.ti application-ti.cpp application-ti.hpp)
4 mkclass_target(configobject.ti configobject-ti.cpp configobject-ti.hpp)
5 mkclass_target(configuration.ti configuration-ti.cpp configuration-ti.hpp)
6 mkclass_target(datetime.ti datetime-ti.cpp datetime-ti.hpp)
7 mkclass_target(filelogger.ti filelogger-ti.cpp filelogger-ti.hpp)
8 mkclass_target(function.ti function-ti.cpp function-ti.hpp)
9 mkclass_target(logger.ti logger-ti.cpp logger-ti.hpp)
10 mkclass_target(perfdatavalue.ti perfdatavalue-ti.cpp perfdatavalue-ti.hpp)
11 mkclass_target(streamlogger.ti streamlogger-ti.cpp streamlogger-ti.hpp)
12 mkclass_target(sysloglogger.ti sysloglogger-ti.cpp sysloglogger-ti.hpp)
13
14 set(base_SOURCES
15   i2-base.hpp
16   application.cpp application.hpp application-ti.hpp application-version.cpp application-environment.cpp
17   array.cpp array.hpp array-script.cpp
18   base64.cpp base64.hpp
19   boolean.cpp boolean.hpp boolean-script.cpp
20   configobject.cpp configobject.hpp configobject-ti.hpp configobject-script.cpp
21   configtype.cpp configtype.hpp
22   configuration.cpp configuration.hpp configuration-ti.hpp
23   configwriter.cpp configwriter.hpp
24   console.cpp console.hpp
25   context.cpp context.hpp
26   convert.cpp convert.hpp
27   datetime.cpp datetime.hpp datetime-ti.hpp datetime-script.cpp
28   debug.hpp
29   debuginfo.cpp debuginfo.hpp
30   dependencygraph.cpp dependencygraph.hpp
31   dictionary.cpp dictionary.hpp dictionary-script.cpp
32   exception.cpp exception.hpp
33   fifo.cpp fifo.hpp
34   filelogger.cpp filelogger.hpp filelogger-ti.hpp
35   function.cpp function.hpp function-ti.hpp function-script.cpp functionwrapper.hpp
36   initialize.cpp initialize.hpp
37   io-engine.cpp io-engine.hpp
38   json.cpp json.hpp json-script.cpp
39   lazy-init.hpp
40   library.cpp library.hpp
41   loader.cpp loader.hpp
42   logger.cpp logger.hpp logger-ti.hpp
43   math-script.cpp
44   netstring.cpp netstring.hpp
45   networkstream.cpp networkstream.hpp
46   namespace.cpp namespace.hpp namespace-script.cpp
47   number.cpp number.hpp number-script.cpp
48   object.cpp object.hpp object-script.cpp
49   objectlock.cpp objectlock.hpp
50   object-packer.cpp object-packer.hpp
51   objecttype.cpp objecttype.hpp
52   perfdatavalue.cpp perfdatavalue.hpp perfdatavalue-ti.hpp
53   primitivetype.cpp primitivetype.hpp
54   process.cpp process.hpp
55   reference.cpp reference.hpp reference-script.cpp
56   registry.hpp
57   ringbuffer.cpp ringbuffer.hpp
58   scriptframe.cpp scriptframe.hpp
59   scriptglobal.cpp scriptglobal.hpp
60   scriptutils.cpp scriptutils.hpp
61   serializer.cpp serializer.hpp
62   singleton.hpp
63   socket.cpp socket.hpp
64   socketevents.cpp socketevents-epoll.cpp socketevents-poll.cpp socketevents.hpp
65   stacktrace.cpp stacktrace.hpp
66   statsfunction.hpp
67   stdiostream.cpp stdiostream.hpp
68   stream.cpp stream.hpp
69   streamlogger.cpp streamlogger.hpp streamlogger-ti.hpp
70   string.cpp string.hpp string-script.cpp
71   stringbuilder.cpp stringbuilder.hpp
72   sysloglogger.cpp sysloglogger.hpp sysloglogger-ti.hpp
73   tcpsocket.cpp tcpsocket.hpp
74   threadpool.cpp threadpool.hpp
75   timer.cpp timer.hpp
76   tlsstream.cpp tlsstream.hpp
77   tlsutility.cpp tlsutility.hpp
78   type.cpp type.hpp typetype-script.cpp
79   unix.hpp
80   unixsocket.cpp unixsocket.hpp
81   utility.cpp utility.hpp
82   value.cpp value.hpp value-operators.cpp
83   win32.hpp
84   workqueue.cpp workqueue.hpp
85 )
86
87 set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/application-version.cpp PROPERTY EXCLUDE_UNITY_BUILD TRUE)
88
89 if(ICINGA2_UNITY_BUILD)
90   mkunity_target(base base base_SOURCES)
91 endif()
92
93 if(HAVE_SYSTEMD)
94   find_path(SYSTEMD_INCLUDE_DIR
95     NAMES systemd/sd-daemon.h
96     HINTS ${SYSTEMD_ROOT_DIR})
97   include_directories(${SYSTEMD_INCLUDE_DIR})
98 endif()
99
100 add_library(base OBJECT ${base_SOURCES})
101
102 include_directories(${icinga2_SOURCE_DIR}/third-party/execvpe)
103 link_directories(${icinga2_BINARY_DIR}/third-party/execvpe)
104
105 include_directories(${icinga2_SOURCE_DIR}/third-party/mmatch)
106 link_directories(${icinga2_BINARY_DIR}/third-party/mmatch)
107
108 include_directories(${icinga2_SOURCE_DIR}/third-party/socketpair)
109 link_directories(${icinga2_BINARY_DIR}/third-party/socketpair)
110
111 set_target_properties (
112   base PROPERTIES
113   FOLDER Lib
114 )
115
116 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_CACHEDIR}\")")
117 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_LOGDIR}/crash\")")
118
119 set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)