From commits-return-4643-archive-asf-public=cust-asf.ponee.io@celix.apache.org Tue Feb 6 17:04:07 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 989FD180657 for ; Tue, 6 Feb 2018 17:04:07 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 84C0C160C5B; Tue, 6 Feb 2018 16:04:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 86B1D160C3A for ; Tue, 6 Feb 2018 17:04:06 +0100 (CET) Received: (qmail 48719 invoked by uid 500); 6 Feb 2018 16:04:05 -0000 Mailing-List: contact commits-help@celix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@celix.apache.org Delivered-To: mailing list commits@celix.apache.org Received: (qmail 48702 invoked by uid 99); 6 Feb 2018 16:04:05 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Feb 2018 16:04:05 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8EACFDFF6D; Tue, 6 Feb 2018 16:04:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pnoltes@apache.org To: commits@celix.apache.org Date: Tue, 06 Feb 2018 16:04:05 -0000 Message-Id: <92b03a939aad4fd2a616bbfcd0068ed2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] celix git commit: CELIX-417: Fixes some issues with fixed library/include location leaking through the exported targets Repository: celix Updated Branches: refs/heads/develop ac36f55a0 -> 06bcd4ece CELIX-417: Fixes some issues with fixed library/include location leaking through the exported targets Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/5a0e5ed9 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/5a0e5ed9 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/5a0e5ed9 Branch: refs/heads/develop Commit: 5a0e5ed958737fb23b1ddbb017d10a2ce74b546b Parents: 0a5ef69 Author: Pepijn Noltes Authored: Tue Feb 6 17:01:04 2018 +0100 Committer: Pepijn Noltes Committed: Tue Feb 6 17:01:19 2018 +0100 ---------------------------------------------------------------------- CMakeLists.txt | 4 +-- cmake/CelixConfig.cmake | 4 +-- cmake/cmake_celix/BundlePackaging.cmake | 14 ++++++----- cmake/cmake_celix/UseCelix.cmake | 1 + deployment_admin/CMakeLists.txt | 4 +-- dfi/CMakeLists.txt | 26 ++++++++------------ etcdlib/CMakeLists.txt | 18 ++++++++------ framework/CMakeLists.txt | 4 +-- pubsub/mock/CMakeLists.txt | 2 +- pubsub/pubsub_discovery/CMakeLists.txt | 4 +-- remote_services/discovery_common/CMakeLists.txt | 2 ++ remote_services/discovery_etcd/CMakeLists.txt | 2 ++ .../remote_service_admin_dfi/CMakeLists.txt | 3 ++- shell/CMakeLists.txt | 3 ++- 14 files changed, 48 insertions(+), 43 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/celix/blob/5a0e5ed9/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 86d464a..9e43d2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,8 +47,8 @@ ELSE () ENDIF() # Set version for the framework package/release -set(CELIX_MAJOR "1") -set(CELIX_MINOR "0") +set(CELIX_MAJOR "2") +set(CELIX_MINOR "2") set(CELIX_MICRO "0") option(ENABLE_TESTING "Enables unit/bundle testing" FALSE) http://git-wip-us.apache.org/repos/asf/celix/blob/5a0e5ed9/cmake/CelixConfig.cmake ---------------------------------------------------------------------- diff --git a/cmake/CelixConfig.cmake b/cmake/CelixConfig.cmake index 364b856..79afc1e 100644 --- a/cmake/CelixConfig.cmake +++ b/cmake/CelixConfig.cmake @@ -42,8 +42,8 @@ set(CELIX_DFI_INCLUDE_DIR "${REL_INSTALL_DIR}/include/dfi") set(CELIX_LIBRARIES Celix::framework Celix::utils Celix::dfi) set(CELIX_INCLUDE_DIRS $ - $ - $ + $ + $ ) set(CELIX_FRAMEWORK_LIBRARY Celix::framework) http://git-wip-us.apache.org/repos/asf/celix/blob/5a0e5ed9/cmake/cmake_celix/BundlePackaging.cmake ---------------------------------------------------------------------- diff --git a/cmake/cmake_celix/BundlePackaging.cmake b/cmake/cmake_celix/BundlePackaging.cmake index 1196912..bacdde4 100644 --- a/cmake/cmake_celix/BundlePackaging.cmake +++ b/cmake/cmake_celix/BundlePackaging.cmake @@ -573,12 +573,14 @@ get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH) foreach(BUNDLE_TARGET IN LISTS EXPORT_BUNDLES) set(TN "${EXPORT_NAMESPACE}${BUNDLE_TARGET}") file(APPEND "${CONF_IN_FILE}" " -add_library(${TN} SHARED IMPORTED) -set_target_properties(${TN} PROPERTIES - BUNDLE_IMPORTED TRUE - BUNDLE_FILE \"\${_IMPORT_PREFIX}/share/${EXPORT_PROJECT_NAME}/bundles/$\" - BUNDLE_FILENAME \"$\" -) +if (NOT TARGET ${TN}) + add_library(${TN} SHARED IMPORTED) + set_target_properties(${TN} PROPERTIES + BUNDLE_IMPORTED TRUE + BUNDLE_FILE \"\${_IMPORT_PREFIX}/share/${EXPORT_PROJECT_NAME}/bundles/$\" + BUNDLE_FILENAME \"$\" + ) +endif () ") endforeach() file(GENERATE OUTPUT "${CONF_FILE}" INPUT "${CONF_IN_FILE}") http://git-wip-us.apache.org/repos/asf/celix/blob/5a0e5ed9/cmake/cmake_celix/UseCelix.cmake ---------------------------------------------------------------------- diff --git a/cmake/cmake_celix/UseCelix.cmake b/cmake/cmake_celix/UseCelix.cmake index 51290d3..a29b2c4 100644 --- a/cmake/cmake_celix/UseCelix.cmake +++ b/cmake/cmake_celix/UseCelix.cmake @@ -16,6 +16,7 @@ # under the License. include(GNUInstallDirs) +include(CMakeParseArguments) set(CELIX_CMAKE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CELIX_CMAKE_DIRECTORY}/../Modules) http://git-wip-us.apache.org/repos/asf/celix/blob/5a0e5ed9/deployment_admin/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/deployment_admin/CMakeLists.txt b/deployment_admin/CMakeLists.txt index b3f849f..a83b1cd 100644 --- a/deployment_admin/CMakeLists.txt +++ b/deployment_admin/CMakeLists.txt @@ -45,8 +45,8 @@ if (DEPLOYMENT_ADMIN) ) target_compile_definitions(deployment_admin PRIVATE -DUSE_FILE32API) - target_include_directories(deployment_admin PRIVATE - src + target_include_directories(deployment_admin PRIVATE src) + target_include_directories(deployment_admin SYSTEM PRIVATE ${CURL_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} http://git-wip-us.apache.org/repos/asf/celix/blob/5a0e5ed9/dfi/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/dfi/CMakeLists.txt b/dfi/CMakeLists.txt index 39ed784..08f373f 100644 --- a/dfi/CMakeLists.txt +++ b/dfi/CMakeLists.txt @@ -33,30 +33,24 @@ set_target_properties(dfi PROPERTIES OUTPUT_NAME "celix_dfi") target_include_directories(dfi PUBLIC $ $ - ${JANSSON_INCLUDE_DIRS} ) -target_include_directories(dfi PRIVATE src ${FFI_INCLUDE_DIRS}) -target_link_libraries(dfi PUBLIC ${JANSSON_LIBRARY}) -target_link_libraries(dfi PRIVATE Celix::utils ${FFI_LIBRARIES}) -set_target_properties(dfi PROPERTIES "SOVERSION" 1) -add_library(dfi_static STATIC ${SOURCES}) -set_target_properties(dfi_static PROPERTIES OUTPUT_NAME "celix_dfi_static") -target_include_directories(dfi_static PUBLIC - $ - $ +#TODO JANNSON should be public, but this only really works if JANSSON is a imported target +#So make FindJansson deliver targets +target_include_directories(dfi SYSTEM PRIVATE ${JANSSON_INCLUDE_DIRS} ) -target_include_directories(dfi_static PRIVATE src ${FFI_INCLUDE_DIRS}) -target_link_libraries(dfi_static PUBLIC ${JANSSON_LIBRARY}) -target_link_libraries(dfi_static PRIVATE Celix::utils ${FFI_LIBRARIES}) +target_include_directories(dfi PRIVATE src) +target_include_directories(dfi SYSTEM PRIVATE ${FFI_INCLUDE_DIRS}) +target_link_libraries(dfi PRIVATE ${JANSSON_LIBRARY}) +target_link_libraries(dfi PRIVATE Celix::utils ${FFI_LIBRARIES}) +set_target_properties(dfi PROPERTIES "SOVERSION" 1) -install(TARGETS dfi dfi_static EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT dfi) +install(TARGETS dfi EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT dfi) install(DIRECTORY include/ DESTINATION include/celix/dfi COMPONENT dfi) #Alias setup to match external usage add_library(Celix::dfi ALIAS dfi) -add_library(Celix::dfi_static ALIAS dfi_static) if (ENABLE_TESTING) find_package(CppUTest REQUIRED) @@ -65,7 +59,7 @@ if (ENABLE_TESTING) SET(CMAKE_SKIP_BUILD_RPATH FALSE) #TODO needed? SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) #TODO needed? - SET(CMAKE_INSTALL_RPATH "${PROJECT_BINARY_DIR}/dfi" "${PROJECT_BINARY_DIR}/utils") + SET(CMAKE_INSTALL_RPATH "${PROJECT_BINARY_DIR}/dfi" "${PROJECT_BINARY_DIR}/utils") add_executable(test_dfi test/dyn_type_tests.cpp http://git-wip-us.apache.org/repos/asf/celix/blob/5a0e5ed9/etcdlib/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/etcdlib/CMakeLists.txt b/etcdlib/CMakeLists.txt index d9909dc..ccb6621 100644 --- a/etcdlib/CMakeLists.txt +++ b/etcdlib/CMakeLists.txt @@ -48,15 +48,15 @@ target_include_directories(etcdlib PUBLIC $ $ ) -target_include_directories(etcdlib PRIVATE - src +target_include_directories(etcdlib PRIVATE src) +target_include_directories(etcdlib SYSTEM PRIVATE ${CURL_INCLUDE_DIRS} ${JANSSON_INCLUDE_DIRS} ) set_target_properties(etcdlib PROPERTIES SOVERSION 1) set_target_properties(etcdlib PROPERTIES VERSION 1.0.0) -target_link_libraries(etcdlib ${CURL_LIBRARIES} ${JANSSON_LIBRARIES}) +target_link_libraries(etcdlib PRIVATE ${CURL_LIBRARIES} ${JANSSON_LIBRARIES}) add_library(etcdlib_static STATIC src/etcd.c @@ -65,19 +65,21 @@ target_include_directories(etcdlib_static PUBLIC $ $ ) -target_include_directories(etcdlib_static PRIVATE - src +target_include_directories(etcdlib_static PRIVATE src) +target_include_directories(etcdlib_static SYSTEM PRIVATE ${CURL_INCLUDE_DIRS} ${JANSSON_INCLUDE_DIRS} ) set_target_properties(etcdlib_static PROPERTIES "SOVERSION" 1) -target_link_libraries(etcdlib_static ${CURL_LIBRARIES} ${JANSSON_LIBRARY}) +target_link_libraries(etcdlib_static PRIVATE ${CURL_LIBRARIES} ${JANSSON_LIBRARY}) + +#TODO install etcdlib_static. For now left out, because the imported target leaks library paths install(DIRECTORY api/ DESTINATION include/etcdlib COMPONENT ${ETCDLIB_CMP}) if (NOT COMMAND celix_subproject) - install(TARGETS etcdlib etcdlib_static DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${ETCDLIB_CMP}) + install(TARGETS etcdlib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${ETCDLIB_CMP}) else () - install(TARGETS etcdlib etcdlib_static EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${ETCDLIB_CMP}) + install(TARGETS etcdlib EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${ETCDLIB_CMP}) #Setup target aliases to match external usage add_library(Celix::etcdlib ALIAS etcdlib) add_library(Celix::etcdlib_static ALIAS etcdlib_static) http://git-wip-us.apache.org/repos/asf/celix/blob/5a0e5ed9/framework/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt index 483deee..94c78c7 100644 --- a/framework/CMakeLists.txt +++ b/framework/CMakeLists.txt @@ -40,8 +40,8 @@ target_include_directories(framework PUBLIC $ $ ) -target_include_directories(framework PRIVATE - src +target_include_directories(framework PRIVATE src) +target_include_directories(framework SYSTEM PRIVATE ${ZLIB_INCLUDE_DIR} ${CURL_INCLUDE_DIR} ${UUID_INCLUDE_DIR} http://git-wip-us.apache.org/repos/asf/celix/blob/5a0e5ed9/pubsub/mock/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/pubsub/mock/CMakeLists.txt b/pubsub/mock/CMakeLists.txt index c441e21..4fa78ae 100644 --- a/pubsub/mock/CMakeLists.txt +++ b/pubsub/mock/CMakeLists.txt @@ -24,7 +24,7 @@ if (CPPUTEST_FOUND) ) target_include_directories(pubsub_mock PUBLIC api) target_link_libraries(pubsub_mock PRIVATE Celix::pubsub_spi ${CPPUTEST_LIBRARY}) - target_include_directories(pubsub_mock PRIVATE SYSTEM + target_include_directories(pubsub_mock SYSTEM PRIVATE ${CPPUTEST_INCLUDE_DIR} ) http://git-wip-us.apache.org/repos/asf/celix/blob/5a0e5ed9/pubsub/pubsub_discovery/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/pubsub/pubsub_discovery/CMakeLists.txt b/pubsub/pubsub_discovery/CMakeLists.txt index 03dfa31..9d5f074 100644 --- a/pubsub/pubsub_discovery/CMakeLists.txt +++ b/pubsub/pubsub_discovery/CMakeLists.txt @@ -28,8 +28,8 @@ add_celix_bundle(celix_pubsub_discovery_etcd src/etcd_watcher.c src/etcd_writer.c ) -target_include_directories(celix_pubsub_discovery_etcd PRIVATE - src +target_include_directories(celix_pubsub_discovery_etcd PRIVATE src) +target_include_directories(celix_pubsub_discovery_etcd SYSTEM PRIVATE ${CURL_INCLUDE_DIR} ${JANSSON_INCLUDE_DIR} ) http://git-wip-us.apache.org/repos/asf/celix/blob/5a0e5ed9/remote_services/discovery_common/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/remote_services/discovery_common/CMakeLists.txt b/remote_services/discovery_common/CMakeLists.txt index 97e9676..f035e8e 100644 --- a/remote_services/discovery_common/CMakeLists.txt +++ b/remote_services/discovery_common/CMakeLists.txt @@ -16,6 +16,7 @@ # under the License. +find_package(CURL REQUIRED) find_package(LibXml2 REQUIRED) add_library(rsa_discovery_common OBJECT @@ -33,6 +34,7 @@ target_include_directories(rsa_discovery_common PUBLIC $ $ $ + ${CURL_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR}) #Setup target aliases to match external usage http://git-wip-us.apache.org/repos/asf/celix/blob/5a0e5ed9/remote_services/discovery_etcd/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/remote_services/discovery_etcd/CMakeLists.txt b/remote_services/discovery_etcd/CMakeLists.txt index 6200a81..c20c4f9 100644 --- a/remote_services/discovery_etcd/CMakeLists.txt +++ b/remote_services/discovery_etcd/CMakeLists.txt @@ -36,6 +36,8 @@ if (RSA_DISCOVERY_ETCD) target_include_directories(rsa_discovery_etcd PRIVATE $ $ + ) + target_include_directories(rsa_discovery_etcd SYSTEM PRIVATE ${CURL_INCLUDE_DIR} ${JANSSON_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR} http://git-wip-us.apache.org/repos/asf/celix/blob/5a0e5ed9/remote_services/remote_service_admin_dfi/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/remote_services/remote_service_admin_dfi/CMakeLists.txt b/remote_services/remote_service_admin_dfi/CMakeLists.txt index 1aba671..5870d71 100644 --- a/remote_services/remote_service_admin_dfi/CMakeLists.txt +++ b/remote_services/remote_service_admin_dfi/CMakeLists.txt @@ -36,8 +36,9 @@ if (RSA_REMOTE_SERVICE_ADMIN_DFI) $ ) target_include_directories(rsa_dfi PRIVATE src $) + target_include_directories(rsa_dfi SYSTEM PRIVATE ${CURL_INCLUDE_DIRS} ${JANSSON_INCLUDE_DIRS}) target_link_libraries(rsa_dfi PRIVATE - Celix::dfi_static + Celix::dfi Celix::log_helper Celix::rsa_common ${CURL_LIBRARIES} ${JANSSON_LIBRARIES}) http://git-wip-us.apache.org/repos/asf/celix/blob/5a0e5ed9/shell/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt index d127513..dbc9916 100644 --- a/shell/CMakeLists.txt +++ b/shell/CMakeLists.txt @@ -43,7 +43,8 @@ if (SHELL) src/inspect_command src/help_command ) - target_include_directories(shell PRIVATE src ${CURL_INCLUDE_DIRS}) + target_include_directories(shell PRIVATE src) + target_include_directories(shell SYSTEM PRIVATE ${CURL_INCLUDE_DIRS}) target_link_libraries(shell PRIVATE Celix::shell_api ${CURL_LIBRARIES} Celix::log_service_api Celix::log_helper) install_celix_bundle(shell EXPORT celix COMPONENT shell)