find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
+set(base_DEPS ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
+set(base_OBJS $<TARGET_OBJECTS:mmatch> $<TARGET_OBJECTS:socketpair> $<TARGET_OBJECTS:base>)
+
find_package(YAJL)
if(NOT YAJL_FOUND)
include_directories(${icinga2_BINARY_DIR}/third-party/yajl/include)
link_directories(${icinga2_BINARY_DIR}/third-party/yajl)
- set(YAJL_LIBRARIES "yajl")
+ list(APPEND base_SOURCES $<TARGET_OBJECTS:yajl>)
+else()
+ list(APPEND base_DEPS ${YAJL_LIBRARIES})
endif()
find_package(Editline)
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/lib
)
-set(base_DEPS ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${YAJL_LIBRARIES} mmatch socketpair)
-
if(HAVE_LIBEXECINFO)
list(APPEND base_DEPS execinfo)
endif()
if(UNIX OR CYGWIN)
- list(APPEND base_DEPS execvpe)
+ list(APPEND base_OBJS $<TARGET_OBJECTS:execvpe>)
endif()
if(EDITLINE_FOUND)
add_executable(icinga-app
$<TARGET_OBJECTS:icingaloader>
+ $<TARGET_OBJECTS:mmatch>
+ $<TARGET_OBJECTS:socketpair>
$<TARGET_OBJECTS:base>
$<TARGET_OBJECTS:config>
$<TARGET_OBJECTS:remote>
connectform.cpp connectform.hpp
mainform.cpp mainform.hpp
icinga.icns ${WindowsSources}
- $<TARGET_OBJECTS:base>
+ ${base_OBJS}
$<TARGET_OBJECTS:config>
$<TARGET_OBJECTS:remote>
)
add_executable(check_nscp_api
check_nscp_api.cpp
- $<TARGET_OBJECTS:base>
+ ${base_OBJS}
$<TARGET_OBJECTS:config>
$<TARGET_OBJECTS:remote>
)
icinga-notification.cpp
icinga-perfdata.cpp
remote-url.cpp
- $<TARGET_OBJECTS:base>
+ ${base_OBJS}
$<TARGET_OBJECTS:config>
$<TARGET_OBJECTS:remote>
$<TARGET_OBJECTS:icinga>
set(livestatus_test_SOURCES
livestatus-fixture.cpp
livestatus.cpp
- $<TARGET_OBJECTS:base>
+ ${base_OBJS}
$<TARGET_OBJECTS:config>
$<TARGET_OBJECTS:remote>
$<TARGET_OBJECTS:icinga>
set(icinga_checkable_test_SOURCES
icinga-checkable-fixture.cpp
icinga-checkable-flapping.cpp
- $<TARGET_OBJECTS:base>
+ ${base_OBJS}
$<TARGET_OBJECTS:config>
$<TARGET_OBJECTS:remote>
$<TARGET_OBJECTS:icinga>
execvpe.c execvpe.h
)
-add_library(execvpe STATIC ${execvpe_SOURCES})
+add_library(execvpe OBJECT ${execvpe_SOURCES})
set_target_properties (
execvpe PROPERTIES
mmatch.c mmatch.h
)
-add_library(mmatch STATIC ${mmatch_SOURCES})
+add_library(mmatch OBJECT ${mmatch_SOURCES})
set_target_properties(
mmatch PROPERTIES
socketpair.c socketpair.h
)
-add_library(socketpair STATIC ${socketpair_SOURCES})
+add_library(socketpair OBJECT ${socketpair_SOURCES})
set_target_properties (
socketpair PROPERTIES
# set up some paths
SET (incDir ${CMAKE_CURRENT_BINARY_DIR}/../include/yajl)
-ADD_LIBRARY(yajl STATIC ${SRCS} ${HDRS} ${PUB_HDRS})
+ADD_LIBRARY(yajl OBJECT ${SRCS} ${HDRS} ${PUB_HDRS})
#### setup shared library version number
SET_TARGET_PROPERTIES(yajl