From e1134fd3d940680b654ebed717b5902d38da9eb4 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 17 Jan 2018 14:59:02 +0100 Subject: [PATCH] Build all remaining libraries as object libraries --- CMakeLists.txt | 11 +++++++---- icinga-app/CMakeLists.txt | 2 ++ icinga-studio/CMakeLists.txt | 2 +- plugins/CMakeLists.txt | 2 +- test/CMakeLists.txt | 6 +++--- third-party/execvpe/CMakeLists.txt | 2 +- third-party/mmatch/CMakeLists.txt | 2 +- third-party/socketpair/CMakeLists.txt | 2 +- third-party/yajl/src/CMakeLists.txt | 2 +- 9 files changed, 18 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d3fcd19c..8d5006d29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,12 +123,17 @@ include_directories(${Boost_INCLUDE_DIRS}) find_package(OpenSSL REQUIRED) include_directories(${OPENSSL_INCLUDE_DIR}) +set(base_DEPS ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES}) +set(base_OBJS $ $ $) + 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 $) +else() + list(APPEND base_DEPS ${YAJL_LIBRARIES}) endif() find_package(Editline) @@ -142,14 +147,12 @@ include_directories( ${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 $) endif() if(EDITLINE_FOUND) diff --git a/icinga-app/CMakeLists.txt b/icinga-app/CMakeLists.txt index c599f2366..cc209ed75 100644 --- a/icinga-app/CMakeLists.txt +++ b/icinga-app/CMakeLists.txt @@ -65,6 +65,8 @@ endif() add_executable(icinga-app $ + $ + $ $ $ $ diff --git a/icinga-studio/CMakeLists.txt b/icinga-studio/CMakeLists.txt index 475fa595a..2925ce95f 100644 --- a/icinga-studio/CMakeLists.txt +++ b/icinga-studio/CMakeLists.txt @@ -32,7 +32,7 @@ set(icinga_studio_SOURCES connectform.cpp connectform.hpp mainform.cpp mainform.hpp icinga.icns ${WindowsSources} - $ + ${base_OBJS} $ $ ) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 34f0786be..5d1cc348f 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -17,7 +17,7 @@ add_executable(check_nscp_api check_nscp_api.cpp - $ + ${base_OBJS} $ $ ) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8513cd6d2..0ceaefe8c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -44,7 +44,7 @@ set(base_test_SOURCES icinga-notification.cpp icinga-perfdata.cpp remote-url.cpp - $ + ${base_OBJS} $ $ $ @@ -146,7 +146,7 @@ if(ICINGA2_WITH_LIVESTATUS) set(livestatus_test_SOURCES livestatus-fixture.cpp livestatus.cpp - $ + ${base_OBJS} $ $ $ @@ -168,7 +168,7 @@ endif() set(icinga_checkable_test_SOURCES icinga-checkable-fixture.cpp icinga-checkable-flapping.cpp - $ + ${base_OBJS} $ $ $ diff --git a/third-party/execvpe/CMakeLists.txt b/third-party/execvpe/CMakeLists.txt index 9f52f8e15..4be31bc1b 100644 --- a/third-party/execvpe/CMakeLists.txt +++ b/third-party/execvpe/CMakeLists.txt @@ -19,7 +19,7 @@ set(execvpe_SOURCES execvpe.c execvpe.h ) -add_library(execvpe STATIC ${execvpe_SOURCES}) +add_library(execvpe OBJECT ${execvpe_SOURCES}) set_target_properties ( execvpe PROPERTIES diff --git a/third-party/mmatch/CMakeLists.txt b/third-party/mmatch/CMakeLists.txt index 238cf2f51..70bb6f1c2 100644 --- a/third-party/mmatch/CMakeLists.txt +++ b/third-party/mmatch/CMakeLists.txt @@ -19,7 +19,7 @@ set(mmatch_SOURCES mmatch.c mmatch.h ) -add_library(mmatch STATIC ${mmatch_SOURCES}) +add_library(mmatch OBJECT ${mmatch_SOURCES}) set_target_properties( mmatch PROPERTIES diff --git a/third-party/socketpair/CMakeLists.txt b/third-party/socketpair/CMakeLists.txt index fa2f39273..4983e3ed0 100644 --- a/third-party/socketpair/CMakeLists.txt +++ b/third-party/socketpair/CMakeLists.txt @@ -19,7 +19,7 @@ set(socketpair_SOURCES socketpair.c socketpair.h ) -add_library(socketpair STATIC ${socketpair_SOURCES}) +add_library(socketpair OBJECT ${socketpair_SOURCES}) set_target_properties ( socketpair PROPERTIES diff --git a/third-party/yajl/src/CMakeLists.txt b/third-party/yajl/src/CMakeLists.txt index 1ebf36869..be277d1b3 100644 --- a/third-party/yajl/src/CMakeLists.txt +++ b/third-party/yajl/src/CMakeLists.txt @@ -30,7 +30,7 @@ ADD_DEFINITIONS(-DYAJL_BUILD) # 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