2 # Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/)
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation
16 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
18 mkclass_target(application.ti application.tcpp application.thpp)
19 mkclass_target(configobject.ti configobject.tcpp configobject.thpp)
20 mkclass_target(datetime.ti datetime.tcpp datetime.thpp)
21 mkclass_target(filelogger.ti filelogger.tcpp filelogger.thpp)
22 mkclass_target(function.ti function.tcpp function.thpp)
23 mkclass_target(logger.ti logger.tcpp logger.thpp)
24 mkclass_target(perfdatavalue.ti perfdatavalue.tcpp perfdatavalue.thpp)
25 mkclass_target(streamlogger.ti streamlogger.tcpp streamlogger.thpp)
26 mkclass_target(sysloglogger.ti sysloglogger.tcpp sysloglogger.thpp)
29 application.cpp application.thpp application-version.cpp array.cpp
30 array-script.cpp boolean.cpp boolean-script.cpp console.cpp context.cpp
31 convert.cpp datetime.cpp datetime.thpp datetime-script.cpp debuginfo.cpp dictionary.cpp dictionary-script.cpp
32 configobject.cpp configobject.thpp configobject-script.cpp configtype.cpp configwriter.cpp dependencygraph.cpp
33 exception.cpp fifo.cpp filelogger.cpp filelogger.thpp initialize.cpp json.cpp
34 json-script.cpp loader.cpp logger.cpp logger.thpp math-script.cpp
35 netstring.cpp networkstream.cpp number.cpp number-script.cpp object.cpp
36 object-script.cpp objecttype.cpp primitivetype.cpp process.cpp ringbuffer.cpp scriptframe.cpp
37 function.cpp function.thpp function-script.cpp functionwrapper.cpp
38 perfdatavalue.cpp perfdatavalue.thpp scriptglobal.cpp
39 scriptutils.cpp serializer.cpp socket.cpp socketevents.cpp socketevents-epoll.cpp socketevents-poll.cpp stacktrace.cpp
40 statsfunction.cpp stdiostream.cpp stream.cpp streamlogger.cpp streamlogger.thpp string.cpp string-script.cpp
41 sysloglogger.cpp sysloglogger.thpp tcpsocket.cpp udpsocket.cpp threadpool.cpp timer.cpp
42 tlsstream.cpp tlsutility.cpp type.cpp typetype-script.cpp unixsocket.cpp utility.cpp value.cpp
43 value-operators.cpp workqueue.cpp
46 set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/application-version.cpp PROPERTY EXCLUDE_UNITY_BUILD TRUE)
48 if(ICINGA2_UNITY_BUILD)
49 mkunity_target(base base base_SOURCES)
52 add_library(base SHARED ${base_SOURCES})
54 target_link_libraries(base ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${YAJL_LIBRARIES} mmatch socketpair)
57 target_link_libraries(base execinfo)
60 include_directories(${icinga2_SOURCE_DIR}/third-party/execvpe)
61 link_directories(${icinga2_BINARY_DIR}/third-party/execvpe)
63 include_directories(${icinga2_SOURCE_DIR}/third-party/mmatch)
64 link_directories(${icinga2_BINARY_DIR}/third-party/mmatch)
66 include_directories(${icinga2_SOURCE_DIR}/third-party/socketpair)
67 link_directories(${icinga2_BINARY_DIR}/third-party/socketpair)
70 target_link_libraries(base execvpe)
74 target_link_libraries(base ws2_32 dbghelp shlwapi msi)
77 set_target_properties (
79 INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
80 DEFINE_SYMBOL I2_BASE_BUILD
82 VERSION ${SPEC_VERSION}
85 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/cache/icinga2\")")
86 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/icinga2/crash\")")
90 RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
91 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
97 LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR}/icinga-studio.app/Contents
101 set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)