2013-11-03 13:45:26 +01:00
|
|
|
# Icinga 2
|
2015-01-22 12:00:23 +01:00
|
|
|
# Copyright (C) 2012-2015 Icinga Development Team (http://www.icinga.org)
|
2013-11-03 13:45:26 +01:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
2015-03-28 11:04:42 +01:00
|
|
|
mkclass_target(application.ti application.tcpp application.thpp)
|
2015-08-15 20:28:05 +02:00
|
|
|
mkclass_target(configobject.ti configobject.tcpp configobject.thpp)
|
2015-03-28 11:04:42 +01:00
|
|
|
mkclass_target(filelogger.ti filelogger.tcpp filelogger.thpp)
|
|
|
|
mkclass_target(logger.ti logger.tcpp logger.thpp)
|
|
|
|
mkclass_target(streamlogger.ti streamlogger.tcpp streamlogger.thpp)
|
|
|
|
mkclass_target(sysloglogger.ti sysloglogger.tcpp sysloglogger.thpp)
|
2013-11-03 13:45:26 +01:00
|
|
|
|
2014-08-30 18:08:28 +02:00
|
|
|
set(base_SOURCES
|
2015-08-04 14:47:44 +02:00
|
|
|
application.cpp application.thpp application-version.cpp array.cpp
|
|
|
|
array-script.cpp boolean.cpp boolean-script.cpp console.cpp context.cpp
|
|
|
|
convert.cpp debuginfo.cpp dictionary.cpp dictionary-script.cpp
|
2015-08-15 20:28:05 +02:00
|
|
|
configobject.cpp configobject.thpp configobject-script.cpp configtype.cpp
|
2015-08-04 14:47:44 +02:00
|
|
|
exception.cpp fifo.cpp filelogger.cpp filelogger.thpp initialize.cpp json.cpp
|
|
|
|
json-script.cpp loader.cpp logger.cpp logger.thpp math-script.cpp
|
|
|
|
netstring.cpp networkstream.cpp number.cpp number-script.cpp object.cpp
|
|
|
|
object-script.cpp primitivetype.cpp process.cpp ringbuffer.cpp scriptframe.cpp
|
|
|
|
function.cpp function-script.cpp functionwrapper.cpp scriptglobal.cpp
|
2015-02-13 21:02:48 +01:00
|
|
|
scriptutils.cpp serializer.cpp socket.cpp socketevents.cpp stacktrace.cpp
|
2014-12-12 15:19:23 +01:00
|
|
|
statsfunction.cpp stdiostream.cpp stream.cpp streamlogger.cpp streamlogger.thpp string.cpp string-script.cpp
|
2013-12-17 12:23:19 +01:00
|
|
|
sysloglogger.cpp sysloglogger.thpp tcpsocket.cpp thinmutex.cpp threadpool.cpp timer.cpp
|
2015-08-04 14:47:44 +02:00
|
|
|
tlsstream.cpp tlsutility.cpp type.cpp typetype-script.cpp unixsocket.cpp utility.cpp value.cpp
|
2014-05-09 10:23:54 +02:00
|
|
|
value-operators.cpp workqueue.cpp
|
2013-11-03 13:45:26 +01:00
|
|
|
)
|
|
|
|
|
2014-11-20 09:59:39 +01:00
|
|
|
set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/application-version.cpp PROPERTY EXCLUDE_UNITY_BUILD TRUE)
|
|
|
|
|
2014-08-30 18:08:28 +02:00
|
|
|
if(ICINGA2_UNITY_BUILD)
|
|
|
|
mkunity_target(base base_SOURCES)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(base SHARED ${base_SOURCES})
|
|
|
|
|
2015-02-13 21:02:48 +01:00
|
|
|
target_link_libraries(base ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${YAJL_LIBRARIES} mmatch socketpair)
|
2013-11-03 13:45:26 +01:00
|
|
|
|
2014-04-14 03:02:33 +02:00
|
|
|
if(HAVE_LIBEXECINFO)
|
2014-08-30 18:08:28 +02:00
|
|
|
target_link_libraries(base execinfo)
|
2014-04-14 03:02:33 +02:00
|
|
|
endif()
|
|
|
|
|
2013-11-03 13:45:26 +01:00
|
|
|
include_directories(${icinga2_SOURCE_DIR}/third-party/execvpe)
|
|
|
|
link_directories(${icinga2_BINARY_DIR}/third-party/execvpe)
|
|
|
|
|
|
|
|
include_directories(${icinga2_SOURCE_DIR}/third-party/mmatch)
|
|
|
|
link_directories(${icinga2_BINARY_DIR}/third-party/mmatch)
|
|
|
|
|
2015-02-13 21:02:48 +01:00
|
|
|
include_directories(${icinga2_SOURCE_DIR}/third-party/socketpair)
|
|
|
|
link_directories(${icinga2_BINARY_DIR}/third-party/socketpair)
|
|
|
|
|
2013-11-03 13:45:26 +01:00
|
|
|
if(UNIX OR CYGWIN)
|
|
|
|
target_link_libraries(base execvpe)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WIN32)
|
2015-05-12 15:44:44 +02:00
|
|
|
target_link_libraries(base ws2_32 dbghelp shlwapi msi)
|
2013-11-03 13:45:26 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set_target_properties (
|
|
|
|
base PROPERTIES
|
|
|
|
INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
|
|
|
|
DEFINE_SYMBOL I2_BASE_BUILD
|
|
|
|
FOLDER Lib
|
|
|
|
)
|
|
|
|
|
2014-12-19 09:45:35 +01:00
|
|
|
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/cache/icinga2\")")
|
2014-12-20 15:29:04 +01:00
|
|
|
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/icinga2/crash\")")
|
2014-12-19 09:45:35 +01:00
|
|
|
|
2013-11-03 13:45:26 +01:00
|
|
|
install(
|
|
|
|
TARGETS base
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
|
|
|
|
)
|
2015-02-02 09:58:38 +01:00
|
|
|
|
|
|
|
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)
|