You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2018/01/30 11:09:32 UTC
celix git commit: CELIX-417: Fixes some issues with the moved
cmake_celix dir and imported bundle targets
Repository: celix
Updated Branches:
refs/heads/feature/CELIX-417-cmake-refactor ae8e2e3c6 -> 984b19f0c
CELIX-417: Fixes some issues with the moved cmake_celix dir and imported bundle targets
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/984b19f0
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/984b19f0
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/984b19f0
Branch: refs/heads/feature/CELIX-417-cmake-refactor
Commit: 984b19f0c3bc1b285b02aa6080470cbd5887ebeb
Parents: ae8e2e3
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Jan 30 12:09:22 2018 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Jan 30 12:09:22 2018 +0100
----------------------------------------------------------------------
cmake/cmake_celix/DockerPackaging.cmake | 47 ++++++++++++--------
cmake/cmake_celix/Runtimes.cmake | 6 +--
cmake/cmake_celix/main.c.in | 24 ----------
examples/dm_example_cxx/phase3/CMakeLists.txt | 2 +-
.../phase3_locking/CMakeLists.txt | 2 +-
5 files changed, 34 insertions(+), 47 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/984b19f0/cmake/cmake_celix/DockerPackaging.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/DockerPackaging.cmake b/cmake/cmake_celix/DockerPackaging.cmake
index cb1442c..37c08a3 100644
--- a/cmake/cmake_celix/DockerPackaging.cmake
+++ b/cmake/cmake_celix/DockerPackaging.cmake
@@ -75,18 +75,6 @@ function(add_celix_docker)
list(APPEND CLEANFILES "$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOC>")
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CLEANFILES}")
- if (DOCKER_LAUNCHER_SRC)
- get_filename_component(SRC_FILENAME ${DOCKER_LAUNCHER_SRC} NAME)
- set(LAUNCHER_SRC "${PROJECT_BINARY_DIR}/celix/gen/${DOCKER_TARGET}-${SRC_FILENAME}")
- set(LAUNCHER_ORG "${DOCKER_LAUNCHER_SRC}")
- elseif (DOCKER_CXX)
- set(LAUNCHER_SRC "${PROJECT_BINARY_DIR}/celix/gen/${DOCKER_TARGET}-main.cc")
- set(LAUNCHER_ORG "${CELIX_CMAKE_DIRECTORY}/cmake_celix/main.c.in")
- else()
- set(LAUNCHER_SRC "${PROJECT_BINARY_DIR}/celix/gen/${DOCKER_TARGET}-main.c")
- set(LAUNCHER_ORG "${CELIX_CMAKE_DIRECTORY}/cmake_celix/main.c.in")
- endif()
-
if (DOCKER_LAUNCHER)
add_custom_target(${DOCKER_TARGET})
if (IS_ABSOLUTE "${DOCKER_LAUNCHER}")
@@ -98,8 +86,12 @@ function(add_celix_docker)
set(LAUNCHER "$<TARGET_FILE:${DOCKER_LAUNCHER}>")
set(DOCKER_ENTRYPOINT "ENTRYPOINT [\"/bin/$<TARGET_FILE_NAME:${DOCKER_TARGET}>\"]")
endif()
- else ()
-
+ elseif (DOCKER_LAUNHCER_SRC)
+ add_executable(${DOCKER_TARGET} EXCLUDE_FROM_ALL ${DOCKER_LAUNCHER_SRC})
+ target_link_libraries(${DOCKER_TARGET} PRIVATE Celix::framework)
+ set(LAUNCHER "$<TARGET_FILE:${DOCKER_TARGET}>")
+ set(DOCKER_ENTRYPOINT "ENTRYPOINT [\"/bin/$<TARGET_FILE_NAME:${DOCKER_TARGET}>\"]")
+ else()
if (DOCKER_CXX)
set(LAUNCHER_SRC "${CMAKE_CURRENT_BINARY_DIR}/${DOCKER_TARGET}-docker-main.cc")
else()
@@ -138,7 +130,7 @@ $<JOIN:$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_EMBEDDED_PROPERTIES>,\\n\\
if (DOCKER_CREATE_FS)
add_custom_command(TARGET ${DOCKER_TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOC>
- COMMAND cd $<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOC> && /bin/bash ${CELIX_CMAKE_DIRECTORY}/cmake_celix/create_target_filesystem.sh -e ${LAUNCHER} > /dev/null
+ COMMAND cd $<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOC> && /bin/bash ${CELIX_CMAKE_DIRECTORY}/create_target_filesystem.sh -e ${LAUNCHER} > /dev/null
WORKING_DIRECTORY "${DOCKER_LOC}"
COMMENT "Creating docker dir for ${DOCKER_TARGET}" VERBATIM
)
@@ -234,16 +226,35 @@ function(celix_docker_bundles)
get_target_property(DEPS ${DOCKER_TARGET} "DOCKER_DEPS")
foreach(BUNDLE IN ITEMS ${ARGN})
+ set(HANDLED FALSE)
if(IS_ABSOLUTE ${BUNDLE} AND EXISTS ${BUNDLE})
get_filename_component(BUNDLE_FILENAME ${BUNDLE} NAME)
set(OUT "${LOC}/${BUNDLES_DIR}/${BUNDLE_FILENAME}")
add_custom_command(OUTPUT ${OUT}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${BUNDLE} ${OUT}
- COMMENT "Copying bundle '${BUNDLE}' to '${LOC}/${BUNDLES_DIR}'"
+ COMMENT "Copying (file) bundle '${BUNDLE}' to '${LOC}/${BUNDLES_DIR}'"
DEPENDS ${BUNDLE}
)
list(APPEND BUNDLES "${BUNDLES_DIR}/${BUNDLE_FILENAME}")
- else() #assuming target
+ set(HANDLED TRUE)
+ elseif (TARGET ${BUNDLE})
+ get_target_property(IMP ${BUNDLE} BUNDLE_IMPORTED)
+ if (IMP) #An imported bundle target -> handle target without DEPENDS
+ string(MAKE_C_IDENTIFIER ${BUNDLE} BUNDLE_ID) #Create id with no special chars (e.g. for target like Celix::shell)
+ set(OUT "${CMAKE_BINARY_DIR}/celix/gen/${CONTAINER_TARGET}-copy-bundle-for-target-${BUNDLE_ID}.timestamp")
+ set(DEST "${LOC}/${BUNDLES_DIR}/$<TARGET_PROPERTY:${BUNDLE},BUNDLE_FILENAME>")
+ add_custom_command(OUTPUT ${OUT}
+ COMMAND ${CMAKE_COMMAND} -E touch ${OUT}
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${LOC}/${BUNDLES_DIR}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_PROPERTY:${BUNDLE},BUNDLE_FILE>" ${DEST}
+ COMMENT "Copying (imported) bundle '${BUNDLE}' to '${LOC}/${BUNDLES_DIR}'"
+ )
+ list(APPEND BUNDLES "${BUNDLES_DIR}/$<TARGET_PROPERTY:${BUNDLE},BUNDLE_FILENAME>")
+ set(HANDLED TRUE)
+ endif ()
+ endif ()
+
+ if(NOT HANDLED) #assuming (future) bundle target
string(MAKE_C_IDENTIFIER ${BUNDLE} BUNDLE_ID) #Create id with no special chars (e.g. for target like Celix::shell)
set(OUT "${CMAKE_BINARY_DIR}/celix/gen/${DOCKER_TARGET}-copy-bundle-for-target-${BUNDLE_ID}.timestamp")
set(DEST "${LOC}/${BUNDLES_DIR}/$<TARGET_PROPERTY:${BUNDLE},BUNDLE_FILENAME>")
@@ -251,7 +262,7 @@ function(celix_docker_bundles)
COMMAND ${CMAKE_COMMAND} -E touch ${OUT}
COMMAND ${CMAKE_COMMAND} -E make_directory ${LOC}/${BUNDLES_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_PROPERTY:${BUNDLE},BUNDLE_FILE>" ${DEST}
- COMMENT "Copying bundle '${BUNDLE}' to '${LOC}/${BUNDLES_DIR}'"
+ COMMENT "Copying (target) bundle '${BUNDLE}' to '${LOC}/${BUNDLES_DIR}'"
DEPENDS ${BUNDLE} $<TARGET_PROPERTY:${BUNDLE},BUNDLE_CREATE_BUNDLE_TARGET>
)
list(APPEND BUNDLES "${BUNDLES_DIR}/$<TARGET_PROPERTY:${BUNDLE},BUNDLE_FILENAME>")
http://git-wip-us.apache.org/repos/asf/celix/blob/984b19f0/cmake/cmake_celix/Runtimes.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/Runtimes.cmake b/cmake/cmake_celix/Runtimes.cmake
index 785a8c0..40c9586 100644
--- a/cmake/cmake_celix/Runtimes.cmake
+++ b/cmake/cmake_celix/Runtimes.cmake
@@ -77,9 +77,9 @@ function(add_runtime)
#replaces @RUNTIME_TARGET_NAME@
#TODO move to another location
- configure_file("${CELIX_CMAKE_DIRECTORY}/cmake_celix/runtime_start.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/start.sh.${RUNTIME_TARGET_NAME}.in.1" @ONLY)
- configure_file("${CELIX_CMAKE_DIRECTORY}/cmake_celix/runtime_stop.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/stop.sh.${RUNTIME_TARGET_NAME}.in.1" @ONLY)
- configure_file("${CELIX_CMAKE_DIRECTORY}/cmake_celix/runtime_common.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/common.sh.${RUNTIME_TARGET_NAME}.in.1" @ONLY)
+ configure_file("${CELIX_CMAKE_DIRECTORY}/runtime_start.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/start.sh.${RUNTIME_TARGET_NAME}.in.1" @ONLY)
+ configure_file("${CELIX_CMAKE_DIRECTORY}/runtime_stop.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/stop.sh.${RUNTIME_TARGET_NAME}.in.1" @ONLY)
+ configure_file("${CELIX_CMAKE_DIRECTORY}/runtime_common.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/common.sh.${RUNTIME_TARGET_NAME}.in.1" @ONLY)
#replaces $<TARGET_PROPERTY:<RUNTIME_NAME>,RUNTIME_DEPLOYMENTS>
http://git-wip-us.apache.org/repos/asf/celix/blob/984b19f0/cmake/cmake_celix/main.c.in
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/main.c.in b/cmake/cmake_celix/main.c.in
deleted file mode 100644
index 455b7dd..0000000
--- a/cmake/cmake_celix/main.c.in
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- *Licensed to the Apache Software Foundation (ASF) under one
- *or more contributor license agreements. See the NOTICE file
- *distributed with this work for additional information
- *regarding copyright ownership. The ASF licenses this file
- *to you under the Apache License, Version 2.0 (the
- *"License"); you may not use this file except in compliance
- *with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- *Unless required by applicable law or agreed to in writing,
- *software distributed under the License is distributed on an
- *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- *specific language governing permissions and limitations
- *under the License.
- */
-
-#include <celix_launcher.h>
-
-int main(int argc, char *argv[]) {
- return celixLauncher_launchWithArgs(argc, argv);
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/celix/blob/984b19f0/examples/dm_example_cxx/phase3/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase3/CMakeLists.txt b/examples/dm_example_cxx/phase3/CMakeLists.txt
index 3728abc..c583f25 100644
--- a/examples/dm_example_cxx/phase3/CMakeLists.txt
+++ b/examples/dm_example_cxx/phase3/CMakeLists.txt
@@ -24,7 +24,7 @@ add_celix_bundle(dm_example_cxx_phase3
src/Phase3Cmp.cc
)
target_include_directories(dm_example_cxx_phase3 PRIVATE src)
-target_link_libraries(dm_example_cxx_phase3 PRIVATE dm_example_cxx_api)
+target_link_libraries(dm_example_cxx_phase3 PRIVATE dm_example_cxx_api pthread)
IF(APPLE)
target_link_libraries(dm_example_cxx_phase3 PRIVATE -Wl,-all_load Celix::dependency_manager_cxx_static)
http://git-wip-us.apache.org/repos/asf/celix/blob/984b19f0/examples/dm_example_cxx/phase3_locking/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase3_locking/CMakeLists.txt b/examples/dm_example_cxx/phase3_locking/CMakeLists.txt
index 35ca3c9..7a6823a 100644
--- a/examples/dm_example_cxx/phase3_locking/CMakeLists.txt
+++ b/examples/dm_example_cxx/phase3_locking/CMakeLists.txt
@@ -24,7 +24,7 @@ add_celix_bundle(dm_example_cxx_phase3_locking
src/Phase3LockingCmp.cc
)
target_include_directories(dm_example_cxx_phase3_locking PRIVATE src)
-target_link_libraries(dm_example_cxx_phase3_locking PRIVATE dm_example_cxx_api)
+target_link_libraries(dm_example_cxx_phase3_locking PRIVATE dm_example_cxx_api pthread)
IF(APPLE)
target_link_libraries(dm_example_cxx_phase3_locking PRIVATE -Wl,-all_load Celix::dependency_manager_cxx_static)