celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [1/2] celix git commit: CELIX-417: Fixes some issues with fixed library/include location leaking through the exported targets
Date Tue, 06 Feb 2018 16:04:05 GMT
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 <pepijnnoltes@gmail.com>
Authored: Tue Feb 6 17:01:04 2018 +0100
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
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
   $<TARGET_PROPERTY:Celix::framework,INTERFACE_INCLUDE_DIRECTORIES>
-  $<TARGET_PROPERTY:Celix::utils, INTERFACE_INCLUDE_DIRECTORIES>
-  $<TARGET_PROPERTY:Celix::dfi, INTERFACE_INCLUDE_DIRECTORIES>
+  $<TARGET_PROPERTY:Celix::utils,INTERFACE_INCLUDE_DIRECTORIES>
+  $<TARGET_PROPERTY:Celix::dfi,INTERFACE_INCLUDE_DIRECTORIES>
 )
 
 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/$<TARGET_PROPERTY:${BUNDLE_TARGET},BUNDLE_FILENAME>\"
-    BUNDLE_FILENAME \"$<TARGET_PROPERTY:${BUNDLE_TARGET},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/$<TARGET_PROPERTY:${BUNDLE_TARGET},BUNDLE_FILENAME>\"
+        BUNDLE_FILENAME \"$<TARGET_PROPERTY:${BUNDLE_TARGET},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
 		$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
 		$<INSTALL_INTERFACE:include/celix/dfi>
-		${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
-		$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
-		$<INSTALL_INTERFACE:include/celix/dfi>
+#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
     $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/api>
     $<INSTALL_INTERFACE:include/etcdlib>
 )
-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
     $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/api>
     $<INSTALL_INTERFACE:include/etcdlib>
 )
-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
         $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
         $<INSTALL_INTERFACE:include/celix>
 )
-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
 		$<TARGET_PROPERTY:Celix::log_helper,INTERFACE_INCLUDE_DIRECTORIES>
 		$<TARGET_PROPERTY:Celix::rsa_spi,INTERFACE_INCLUDE_DIRECTORIES>
 		$<TARGET_PROPERTY:civetweb,INCLUDE_DIRECTORIES>
+		${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_PROPERTY:Celix::rsa_discovery_common,INCLUDE_DIRECTORIES>
 			$<TARGET_PROPERTY:Celix::civetweb,INCLUDE_DIRECTORIES>
+	)
+        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_OBJECTS:Celix::civetweb>
     )
     target_include_directories(rsa_dfi PRIVATE src $<TARGET_PROPERTY:Celix::civetweb,INCLUDE_DIRECTORIES>)
+    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)


Mime
View raw message