You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by ab...@apache.org on 2012/06/22 14:40:18 UTC
svn commit: r1352864 - in /incubator/celix/trunk: ./ cmake/
deployment_admin/ device_access/ examples/ log_service/ log_writer/
remote_services/ shell/ shell_tui/
Author: abroekhuis
Date: Fri Jun 22 12:40:16 2012
New Revision: 1352864
URL: http://svn.apache.org/viewvc?rev=1352864&view=rev
Log:
Project Setup
Added build options for modular building as a first step to a dependency based build system
Added:
incubator/celix/trunk/cmake/Dependencies.cmake
incubator/celix/trunk/examples/target.cmake
- copied, changed from r1352863, incubator/celix/trunk/target.cmake
Removed:
incubator/celix/trunk/target.cmake
Modified:
incubator/celix/trunk/CMakeLists.txt
incubator/celix/trunk/cmake/Includes.cmake
incubator/celix/trunk/deployment_admin/CMakeLists.txt
incubator/celix/trunk/device_access/CMakeLists.txt
incubator/celix/trunk/examples/CMakeLists.txt
incubator/celix/trunk/log_service/CMakeLists.txt
incubator/celix/trunk/log_writer/CMakeLists.txt
incubator/celix/trunk/remote_services/CMakeLists.txt
incubator/celix/trunk/shell/CMakeLists.txt
incubator/celix/trunk/shell_tui/CMakeLists.txt
Modified: incubator/celix/trunk/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/CMakeLists.txt?rev=1352864&r1=1352863&r2=1352864&view=diff
==============================================================================
--- incubator/celix/trunk/CMakeLists.txt (original)
+++ incubator/celix/trunk/CMakeLists.txt Fri Jun 22 12:40:16 2012
@@ -46,22 +46,17 @@ include(cmake/Includes.cmake)
add_subdirectory(utils)
add_subdirectory(framework)
add_subdirectory(launcher)
-
add_subdirectory(dependency_manager)
-add_subdirectory(shell)
-add_subdirectory(shell_tui)
-
-add_subdirectory(log_service)
-add_subdirectory(log_writer)
-
+## New sub project must use a buildoption to be able to enable/disable the project using the CMake Editor
+## Sub projects depending on another sub project automatically enable these dependencies
+## For this to work, the order off "add_subdirectory" has to be correct (ie backwards)
add_subdirectory(examples)
-
-add_subdirectory(remote_services)
-
-add_subdirectory(deployment_admin)
-
add_subdirectory(device_access)
-
-include(target.cmake)
+add_subdirectory(deployment_admin)
+add_subdirectory(remote_services)
+add_subdirectory(shell_tui)
+add_subdirectory(shell)
+add_subdirectory(log_writer)
+add_subdirectory(log_service)
#enable_testing()
Added: incubator/celix/trunk/cmake/Dependencies.cmake
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/cmake/Dependencies.cmake?rev=1352864&view=auto
==============================================================================
--- incubator/celix/trunk/cmake/Dependencies.cmake (added)
+++ incubator/celix/trunk/cmake/Dependencies.cmake Fri Jun 22 12:40:16 2012
@@ -0,0 +1,26 @@
+# dep_opt(name "descr" default DEPS a b c
+#option(BUILD_DEVICE_ACCESS "Option to enable building the Device Access Service bundles" OFF)
+#if(BUILD_DEVICE_ACCESS)
+# get_property(log_doc CACHE BUILD_LOG_SERVICE PROPERTY HELPSTRING)
+# set(BUILD_LOG_SERVICE "ON" CACHE BOOL "c" FORCE)
+
+MACRO(dep_opt)
+ PARSE_ARGUMENTS(OPTION "DEPS" "" ${ARGN})
+ LIST(GET OPTION_DEFAULT_ARGS 0 OPTION_NAME)
+ LIST(GET OPTION_DEFAULT_ARGS 1 OPTION_DESCRIPTION)
+ LIST(GET OPTION_DEFAULT_ARGS 2 OPTION_DEFAULT)
+
+ string(TOUPPER ${OPTION_NAME} UC_OPTION_NAME)
+ set(NAME "BUILD_${UC_OPTION_NAME}")
+
+ option(${NAME} "${OPTION_DESCRIPTION}" ${OPTION_DEFAULT})
+
+ IF (${NAME})
+ FOREACH (DEP ${OPTION_DEPS})
+ string(TOUPPER ${DEP} UC_DEP)
+ set(DEP_NAME "BUILD_${UC_DEP}")
+ get_property(doc_string CACHE ${DEP_NAME} PROPERTY HELPSTRING)
+ set(${DEP_NAME} "ON" CACHE BOOL "${doc_string}" FORCE)
+ ENDFOREACH (DEP)
+ ENDIF (${NAME})
+ENDMACRO(dep_opt)
\ No newline at end of file
Modified: incubator/celix/trunk/cmake/Includes.cmake
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/cmake/Includes.cmake?rev=1352864&r1=1352863&r2=1352864&view=diff
==============================================================================
--- incubator/celix/trunk/cmake/Includes.cmake (original)
+++ incubator/celix/trunk/cmake/Includes.cmake Fri Jun 22 12:40:16 2012
@@ -27,5 +27,6 @@ include_directories(${APRUTIL_INCLUDE_DI
#include_directories("framework/private/include")
include_directories("framework/public/include")
+include(cmake/Dependencies.cmake)
include(cmake/Packaging.cmake)
include(cmake/Test.cmake)
\ No newline at end of file
Modified: incubator/celix/trunk/deployment_admin/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/deployment_admin/CMakeLists.txt?rev=1352864&r1=1352863&r2=1352864&view=diff
==============================================================================
--- incubator/celix/trunk/deployment_admin/CMakeLists.txt (original)
+++ incubator/celix/trunk/deployment_admin/CMakeLists.txt Fri Jun 22 12:40:16 2012
@@ -14,26 +14,28 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
-add_definitions(-DUSE_FILE32API)
-
-include_directories("/opt/local/include")
-include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
-include_directories("${PROJECT_SOURCE_DIR}/deployment_admin/private/include")
-include_directories("${PROJECT_SOURCE_DIR}/deployment_admin/public/include")
-
-link_directories("/opt/local/lib")
-bundle(deployment_admin SOURCES
- private/src/deployment_package
- private/src/deployment_admin
- private/src/deployment_admin_activator
- private/src/ioapi
- private/src/miniunz
- private/src/unzip
- private/src/log
- private/src/log_store
- private/src/log_sync
-)
-target_link_libraries(deployment_admin framework curl)
-
-deploy("deployment-admin" BUNDLES deployment_admin shell shell_tui log_service log_writer)
+dep_opt(DEPLOYMENT_ADMIN "Option to enable building the Deployment Admin Service bundles" OFF DEPS shell_tui)
+if (BUILD_DEPLOYMENT_ADMIN)
+ add_definitions(-DUSE_FILE32API)
+
+ include_directories("/opt/local/include")
+ include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+ include_directories("${PROJECT_SOURCE_DIR}/deployment_admin/private/include")
+ include_directories("${PROJECT_SOURCE_DIR}/deployment_admin/public/include")
+
+ link_directories("/opt/local/lib")
+ bundle(deployment_admin SOURCES
+ private/src/deployment_package
+ private/src/deployment_admin
+ private/src/deployment_admin_activator
+ private/src/ioapi
+ private/src/miniunz
+ private/src/unzip
+ private/src/log
+ private/src/log_store
+ private/src/log_sync
+ )
+ target_link_libraries(deployment_admin framework curl)
+
+ deploy("deployment-admin" BUNDLES deployment_admin shell shell_tui log_service log_writer)
+endif (BUILD_DEPLOYMENT_ADMIN)
Modified: incubator/celix/trunk/device_access/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/CMakeLists.txt?rev=1352864&r1=1352863&r2=1352864&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/CMakeLists.txt (original)
+++ incubator/celix/trunk/device_access/CMakeLists.txt Fri Jun 22 12:40:16 2012
@@ -14,11 +14,12 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
-add_subdirectory(device_access)
-add_subdirectory(driver_locator)
-
-add_subdirectory(example)
-
-deploy("device_access_example" BUNDLES device_manager driver_locator shell shell_tui log_service base_driver)
-
+dep_opt(DEVICE_ACCESS "Option to enable building the Device Access Service bundles" OFF DEPS LOG_SERVICE SHELL shell_tui)
+if(BUILD_DEVICE_ACCESS)
+ add_subdirectory(device_access)
+ add_subdirectory(driver_locator)
+
+ add_subdirectory(example)
+
+ deploy("device_access_example" BUNDLES device_manager driver_locator shell shell_tui log_service base_driver)
+endif(BUILD_DEVICE_ACCESS)
Modified: incubator/celix/trunk/examples/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/CMakeLists.txt?rev=1352864&r1=1352863&r2=1352864&view=diff
==============================================================================
--- incubator/celix/trunk/examples/CMakeLists.txt (original)
+++ incubator/celix/trunk/examples/CMakeLists.txt Fri Jun 22 12:40:16 2012
@@ -14,24 +14,28 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
-add_subdirectory(hello_world)
-add_subdirectory(mongoose)
-
-#add_subdirectory(receiver)
-#add_subdirectory(receiver-2.0)
-#add_subdirectory(sender)
-
-#add_subdirectory(echo_service/client)
-#add_subdirectory(echo_service/server)
-add_subdirectory(whiteboard)
-add_subdirectory(echo_service)
-
-add_subdirectory(osgi-in-action/chapter04-correct-lookup)
-add_subdirectory(osgi-in-action/chapter04-correct-listener)
-add_subdirectory(osgi-in-action/chapter01-greeting-example)
-add_subdirectory(osgi-in-action/chapter04-paint-example)
-
-deploy(chapter01-greeting-example BUNDLES shell shell_tui log_service chapter01-greeting-example-client chapter01-greeting-example)
-deploy(chapter04-correct-listener BUNDLES shell shell_tui log_service chapter04-correct-listener)
-deploy("chapter04-paint-example" BUNDLES chapter04-paint-example circle square triangle shell shell_tui log_service log_writer)
+dep_opt(EXAMPLES "Option to enable building the Examples" "OFF" DEPS SHELL_TUI)
+if (BUILD_EXAMPLES)
+ add_subdirectory(hello_world)
+ add_subdirectory(mongoose)
+
+ #add_subdirectory(receiver)
+ #add_subdirectory(receiver-2.0)
+ #add_subdirectory(sender)
+
+ #add_subdirectory(echo_service/client)
+ #add_subdirectory(echo_service/server)
+ add_subdirectory(whiteboard)
+ add_subdirectory(echo_service)
+ #add_subdirectory(component_testing)
+
+ add_subdirectory(osgi-in-action/chapter04-correct-lookup)
+ add_subdirectory(osgi-in-action/chapter04-correct-listener)
+ add_subdirectory(osgi-in-action/chapter01-greeting-example)
+ add_subdirectory(osgi-in-action/chapter04-paint-example)
+
+ deploy(chapter01-greeting-example BUNDLES shell shell_tui log_service chapter01-greeting-example-client chapter01-greeting-example)
+ deploy(chapter04-correct-listener BUNDLES shell shell_tui log_service chapter04-correct-listener)
+ deploy("chapter04-paint-example" BUNDLES chapter04-paint-example circle square triangle shell shell_tui log_service log_writer)
+ include(target.cmake)
+endif(BUILD_EXAMPLES)
Copied: incubator/celix/trunk/examples/target.cmake (from r1352863, incubator/celix/trunk/target.cmake)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/target.cmake?p2=incubator/celix/trunk/examples/target.cmake&p1=incubator/celix/trunk/target.cmake&r1=1352863&r2=1352864&rev=1352864&view=diff
==============================================================================
(empty)
Modified: incubator/celix/trunk/log_service/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/log_service/CMakeLists.txt?rev=1352864&r1=1352863&r2=1352864&view=diff
==============================================================================
--- incubator/celix/trunk/log_service/CMakeLists.txt (original)
+++ incubator/celix/trunk/log_service/CMakeLists.txt Fri Jun 22 12:40:16 2012
@@ -14,22 +14,24 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
-bundle(log_service SOURCES
- private/src/log
- private/src/log_entry
- private/src/log_factory
- private/src/log_service_impl
- private/src/log_service_activator
- private/src/log_reader_service_impl
- )
-include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
-include_directories("${PROJECT_SOURCE_DIR}/log_service/public/include")
-include_directories("${PROJECT_SOURCE_DIR}/log_service/private/include")
-target_link_libraries(log_service framework)
-
-package(log_service FILES public/include/log_service.h)
-
-FILE(GLOB files public/include/log_service.h)
-INSTALL(FILES ${files} DESTINATION include/log_service COMPONENT framework)
-INSTALL(FILES ${PROJECT_BINARY_DIR}/bundles/log_service.zip DESTINATION bundles COMPONENT framework)
\ No newline at end of file
+option(LOG_SERVICE "Option to enable building the Log Service bundles" "OFF")
+if(BUILD_LOG_SERVICE)
+ bundle(log_service SOURCES
+ private/src/log
+ private/src/log_entry
+ private/src/log_factory
+ private/src/log_service_impl
+ private/src/log_service_activator
+ private/src/log_reader_service_impl
+ )
+ include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+ include_directories("${PROJECT_SOURCE_DIR}/log_service/public/include")
+ include_directories("${PROJECT_SOURCE_DIR}/log_service/private/include")
+ target_link_libraries(log_service framework)
+
+ package(log_service FILES public/include/log_service.h)
+
+ FILE(GLOB files public/include/log_service.h)
+ INSTALL(FILES ${files} DESTINATION include/log_service COMPONENT framework)
+ INSTALL(FILES ${PROJECT_BINARY_DIR}/bundles/log_service.zip DESTINATION bundles COMPONENT framework)
+endif(BUILD_LOG_SERVICE)
\ No newline at end of file
Modified: incubator/celix/trunk/log_writer/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/log_writer/CMakeLists.txt?rev=1352864&r1=1352863&r2=1352864&view=diff
==============================================================================
--- incubator/celix/trunk/log_writer/CMakeLists.txt (original)
+++ incubator/celix/trunk/log_writer/CMakeLists.txt Fri Jun 22 12:40:16 2012
@@ -14,12 +14,14 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
-bundle(log_writer SOURCES dependency_activator log_writer)
-include_directories("${PROJECT_SOURCE_DIR}/celix")
-include_directories("${PROJECT_SOURCE_DIR}/dependency_manager")
-include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
-include_directories("${PROJECT_SOURCE_DIR}/log_service/public/include")
-target_link_libraries(log_writer framework dependency_manager)
-
-INSTALL(FILES ${PROJECT_BINARY_DIR}/bundles/log_writer.zip DESTINATION bundles COMPONENT framework)
+dep_opt(LOG_WRITER "Option to enable building the Log Writer bundle" "OFF" DEPS LOG_SERVICE)
+if (BUILD_LOG_WRITER)
+ bundle(log_writer SOURCES dependency_activator log_writer)
+ include_directories("${PROJECT_SOURCE_DIR}/celix")
+ include_directories("${PROJECT_SOURCE_DIR}/dependency_manager")
+ include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+ include_directories("${PROJECT_SOURCE_DIR}/log_service/public/include")
+ target_link_libraries(log_writer framework dependency_manager)
+
+ INSTALL(FILES ${PROJECT_BINARY_DIR}/bundles/log_writer.zip DESTINATION bundles COMPONENT framework)
+endif (BUILD_LOG_WRITER)
\ No newline at end of file
Modified: incubator/celix/trunk/remote_services/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/CMakeLists.txt?rev=1352864&r1=1352863&r2=1352864&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/CMakeLists.txt (original)
+++ incubator/celix/trunk/remote_services/CMakeLists.txt Fri Jun 22 12:40:16 2012
@@ -14,18 +14,19 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
-#add_subdirectory(mongoose)
-add_subdirectory(utils)
-
-add_subdirectory(topology_manager)
-add_subdirectory(remote_service_admin)
-add_subdirectory(discovery)
-
-add_subdirectory(example_service)
-add_subdirectory(example_endpoint)
-add_subdirectory(example_proxy)
-add_subdirectory(calc_shell)
-
-deploy("remote-services" BUNDLES discovery topology_manager remote_service_admin example shell shell_tui log_service log_writer)
-deploy("remote-services-client" BUNDLES discovery topology_manager remote_service_admin shell shell_tui log_service log_writer calc_shell)
+dep_opt(REMOTE_SERVICE_ADMIN "Option to enable building the Remote Service Admin Service bundles" OFF DEPS shell_tui)
+if (BUILD_REMOTE_SERVICE_ADMIN)
+ add_subdirectory(utils)
+
+ add_subdirectory(topology_manager)
+ add_subdirectory(remote_service_admin)
+ add_subdirectory(discovery)
+
+ add_subdirectory(example_service)
+ add_subdirectory(example_endpoint)
+ add_subdirectory(example_proxy)
+ add_subdirectory(calc_shell)
+
+ deploy("remote-services" BUNDLES discovery topology_manager remote_service_admin example shell shell_tui log_service log_writer)
+ deploy("remote-services-client" BUNDLES discovery topology_manager remote_service_admin shell shell_tui log_service log_writer calc_shell)
+endif (BUILD_REMOTE_SERVICE_ADMIN)
Modified: incubator/celix/trunk/shell/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/shell/CMakeLists.txt?rev=1352864&r1=1352863&r2=1352864&view=diff
==============================================================================
--- incubator/celix/trunk/shell/CMakeLists.txt (original)
+++ incubator/celix/trunk/shell/CMakeLists.txt Fri Jun 22 12:40:16 2012
@@ -14,18 +14,20 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
-bundle(shell SOURCES shell command
- ps_command start_command stop_command
- install_command update_command
- uninstall_command log_command
- inspect_command)
-include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
-include_directories("${PROJECT_SOURCE_DIR}/log_service/public/include")
-target_link_libraries(shell framework curl)
-
-package(shell FILES shell.h command.h)
-
-FILE(GLOB files shell.h command.h)
-INSTALL(FILES ${files} DESTINATION include/shell COMPONENT framework)
-INSTALL(FILES ${PROJECT_BINARY_DIR}/bundles/shell.zip DESTINATION bundles COMPONENT framework)
\ No newline at end of file
+dep_opt(SHELL "Option to enable building the Shell bundles" "OFF" DEPS LOG_SERVICE)
+if (BUILD_SHELL)
+ bundle(shell SOURCES shell command
+ ps_command start_command stop_command
+ install_command update_command
+ uninstall_command log_command
+ inspect_command)
+ include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+ include_directories("${PROJECT_SOURCE_DIR}/log_service/public/include")
+ target_link_libraries(shell framework curl)
+
+ package(shell FILES shell.h command.h)
+
+ FILE(GLOB files shell.h command.h)
+ INSTALL(FILES ${files} DESTINATION include/shell COMPONENT framework)
+ INSTALL(FILES ${PROJECT_BINARY_DIR}/bundles/shell.zip DESTINATION bundles COMPONENT framework)
+endif (BUILD_SHELL)
\ No newline at end of file
Modified: incubator/celix/trunk/shell_tui/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/shell_tui/CMakeLists.txt?rev=1352864&r1=1352863&r2=1352864&view=diff
==============================================================================
--- incubator/celix/trunk/shell_tui/CMakeLists.txt (original)
+++ incubator/celix/trunk/shell_tui/CMakeLists.txt Fri Jun 22 12:40:16 2012
@@ -14,12 +14,14 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
-bundle(shell_tui SOURCES shell_tui)
-include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
-include_directories("${PROJECT_SOURCE_DIR}/shell")
-target_link_libraries(shell_tui framework)
-
-package(shell_tui)
-
-INSTALL(FILES ${PROJECT_BINARY_DIR}/bundles/shell_tui.zip DESTINATION bundles COMPONENT framework)
\ No newline at end of file
+dep_opt(SHELL_TUI "Option to enable building the Shell Textual User Interface bundles" OFF DEPS SHELL)
+if (BUILD_SHELL_TUI)
+ bundle(shell_tui SOURCES shell_tui)
+ include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+ include_directories("${PROJECT_SOURCE_DIR}/shell")
+ target_link_libraries(shell_tui framework)
+
+ package(shell_tui)
+
+ INSTALL(FILES ${PROJECT_BINARY_DIR}/bundles/shell_tui.zip DESTINATION bundles COMPONENT framework)
+endif (BUILD_SHELL_TUI)
\ No newline at end of file