From 2b1ebe5f1c885888b35d860a8c083e5abdc53678 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Wed, 26 Jun 2013 13:31:16 +0200 Subject: [PATCH] 2042 Feature bbpConfigurator --- kernel/cmake/BBTKConfigurePackagePaths.cmake | 2 + kernel/cmake/BBTKConfigurePackage_bbs.cmake | 1 + kernel/cmake/BBTKConfigurePackage_src.cmake | 3 + .../BBTKCreatePackageIncludeScript.cmake | 142 ++++++++++++------ kernel/cmake/BBTKKernelConfig.cmake | 3 + kernel/cmake/BBTKSetDeducedPaths.cmake | 7 + 6 files changed, 115 insertions(+), 43 deletions(-) diff --git a/kernel/cmake/BBTKConfigurePackagePaths.cmake b/kernel/cmake/BBTKConfigurePackagePaths.cmake index 27352ef..634a2a7 100644 --- a/kernel/cmake/BBTKConfigurePackagePaths.cmake +++ b/kernel/cmake/BBTKConfigurePackagePaths.cmake @@ -47,6 +47,7 @@ IF(WIN32) SET(BBTK_BBS2CPP "${BBTK_BIN_PATH}/bbs2cpp") SET(BBTK_BBC "${BBTK_BIN_PATH}/bbc") SET(BBTK_BBFY "${BBTK_BIN_PATH}/bbfy") + SET(BBTK_BBPCONFIGURATOR "${BBTK_BIN_PATH}/bbpConfigurator") SET(BBTK_BBDOC "${BBTK_BIN_PATH}/bbdoc") ELSE(WIN32) @@ -57,6 +58,7 @@ ELSE(WIN32) SET(BBTK_BBS2CPP "${BBTK_BIN_PATH}/bbs2cpp") SET(BBTK_BBC "${BBTK_BIN_PATH}/bbc") SET(BBTK_BBFY "${BBTK_BIN_PATH}/bbfy") + SET(BBTK_BBPCONFIGURATOR "${BBTK_BIN_PATH}/bbpConfigurator") SET(BBTK_BBDOC "${BBTK_BIN_PATH}/bbdoc") ENDIF(WIN32) diff --git a/kernel/cmake/BBTKConfigurePackage_bbs.cmake b/kernel/cmake/BBTKConfigurePackage_bbs.cmake index c7d7253..bd5d496 100644 --- a/kernel/cmake/BBTKConfigurePackage_bbs.cmake +++ b/kernel/cmake/BBTKConfigurePackage_bbs.cmake @@ -27,6 +27,7 @@ #---------------------------------------------------------------------------- IF(${BBTK_PACKAGE_NAME}_INCLUDE_ALL_BBS_BOXES) + FILE(GLOB ${BBTK_PACKAGE_NAME}_BBS_BOXES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/kernel/cmake/BBTKConfigurePackage_src.cmake b/kernel/cmake/BBTKConfigurePackage_src.cmake index 55036d4..6aa4425 100644 --- a/kernel/cmake/BBTKConfigurePackage_src.cmake +++ b/kernel/cmake/BBTKConfigurePackage_src.cmake @@ -98,6 +98,8 @@ ENDIF(NOT PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR}) IF(${BBTK_PACKAGE_NAME}_COMPILE_ALL_XML) FILE(GLOB ${BBTK_PACKAGE_NAME}_XML_SOURCES "." "*.xml") ENDIF(${BBTK_PACKAGE_NAME}_COMPILE_ALL_XML) + + #---------------------------------------------------------------------------- FOREACH(xmlfile ${${BBTK_PACKAGE_NAME}_XML_SOURCES}) GET_FILENAME_COMPONENT(filename "${xmlfile}" NAME_WE) @@ -109,6 +111,7 @@ FOREACH(xmlfile ${${BBTK_PACKAGE_NAME}_XML_SOURCES}) # SET(command00 Path=c:/creatis/dlls__RR__%WXWIN%/lib/vc_dll/__RR__%VTK_DIR%__RR__%ITK_DIR%/../../bin/__RR__%PATH%) # STRING(REPLACE "__RR__" "\;" SETPATH ${command00} ) # SET(SETPATH set ${command0} &&) + ADD_CUSTOM_COMMAND( OUTPUT ${BBFY_CXX_OUT} COMMAND diff --git a/kernel/cmake/BBTKCreatePackageIncludeScript.cmake b/kernel/cmake/BBTKCreatePackageIncludeScript.cmake index 29d89ad..fd1ec5c 100644 --- a/kernel/cmake/BBTKCreatePackageIncludeScript.cmake +++ b/kernel/cmake/BBTKCreatePackageIncludeScript.cmake @@ -81,32 +81,81 @@ MACRO(BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT BBTK_PACKAGE_NAME BBTK_PACKAGE_BB ## --Configure and installing bbs boxes-- # --Creates the file ${BBTK_PACKAGE_NAME}.bbp-- + +## bbpConfigurator create de PACKAGE.bbp file +## bbConfigurator + + SET(OUTPUT_FILE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}.bbp) - FILE(WRITE - "${OUTPUT_FILE}" - "#-----------------------------------------\n" - "# Include script for bbtk package '${BBTK_PACKAGE_NAME}'\n" - "# Automatically generated by cmake (macro BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT)\n") - FILE(APPEND - "${OUTPUT_FILE}" - "#-----------------------------------------\n" - "load ${BBTK_PACKAGE_NAME}\n" - "#-----------------------------------------\n" - "package ${BBTK_PACKAGE_NAME}\n" - ) - - #FILE(APPEND - # "${OUTPUT_FILE}" - # "#-----------------------------------------\n" - # "include ${BBTK_PACKAGE_NAME}/boxes/*\n" - # ) - - FOREACH(bbs ${BBTK_PACKAGE_BBS_BOXES}) - FILE(APPEND - "${OUTPUT_FILE}" - "#-----------------------------------------\n" - "include ${BBTK_PACKAGE_NAME}/${bbs}\n" + + IF (WIN32) + MAKE_DLL_PATH() + # SET(command00 Path=c:/creatis/dlls__RR__%WXWIN%/lib/vc_dll/__RR__%VTK_DIR%__RR__%ITK_DIR%/../../bin/__RR__%PATH%) + # STRING(REPLACE "__RR__" "\;" SETPATH ${command00} ) + # SET(SETPATH set ${command0} &&) + + + ADD_CUSTOM_TARGET( bb${BBTK_PACKAGE_NAME}.bbp ALL +## COMMAND "set Path=${DLL_PATH} && ${BBTK_BBPCONFIGURATOR} ${CMAKE_CURRENT_SOURCE_DIR}\boxes\ ${BBTK_PACKAGE_NAME} ${BBTK_BBS_BUILD_PATH}/" + COMMAND ${BBTK_BBPCONFIGURATOR} ${CMAKE_CURRENT_SOURCE_DIR}/boxes/ ${BBTK_PACKAGE_NAME} ${BBTK_BBS_BUILD_PATH}/ + ) + + + ELSE(WIN32) + SET(LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH}:${LIBRARY_OUTPUT_PATH}") + ADD_CUSTOM_TARGET( bb${BBTK_PACKAGE_NAME}.bbp ALL +## COMMAND export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} && ${BBTK_BBPCONFIGURATOR} ${CMAKE_CURRENT_SOURCE_DIR}/boxes/ ${BBTK_PACKAGE_NAME} ${BBTK_BBS_BUILD_PATH}/ + COMMAND ${BBTK_BBPCONFIGURATOR} ${CMAKE_CURRENT_SOURCE_DIR}/boxes/ ${BBTK_PACKAGE_NAME} ${BBTK_BBS_BUILD_PATH}/ + ) + + + + + + ADD_CUSTOM_COMMAND( + OUTPUT ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}.bbp +## COMMAND export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} && ${BBTK_BBFY} ${xmlfile} ${BBTK_PACKAGE_NAME} ${CMAKE_CURRENT_BINARY_DIR}/ -q + COMMAND ls +# COMMAND ${BBTK_BBPCONFIGURATOR} ${CMAKE_CURRENT_SOURCE_DIR}/boxes/ ${BBTK_PACKAGE_NAME} ${BBTK_BBS_BUILD_PATH}/ +## DEPENDS +## ${xmlfile} +## ${BBTK_BBPCREATOR_DEPENDENCY} ) + + ENDIF(WIN32) + + + +##EED 24/06/2013 +## FILE(WRITE +## "${OUTPUT_FILE}" +## "#-----------------------------------------\n" +## "# Include script for bbtk package '${BBTK_PACKAGE_NAME}'\n" +## "# Automatically generated by cmake (macro BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT)\n") +## FILE(APPEND +## "${OUTPUT_FILE}" +## "#-----------------------------------------\n" +## "load ${BBTK_PACKAGE_NAME}\n" +## "#-----------------------------------------\n" +## "package ${BBTK_PACKAGE_NAME}\n" +## ) +## +## #FILE(APPEND +## # "${OUTPUT_FILE}" +## # "#-----------------------------------------\n" +## # "include ${BBTK_PACKAGE_NAME}/boxes/*\n" +## # ) +## + + FOREACH(bbs ${BBTK_PACKAGE_BBS_BOXES}) + +##EED 24/06/2013 +## FILE(APPEND +## "${OUTPUT_FILE}" +## "#-----------------------------------------\n" +## "include ${BBTK_PACKAGE_NAME}/${bbs}\n" +## ) + CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/${bbs} ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}/${bbs} @@ -116,29 +165,32 @@ MACRO(BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT BBTK_PACKAGE_NAME BBTK_PACKAGE_BB IF(WIN32) - INSTALL( - FILES ${CMAKE_CURRENT_SOURCE_DIR}/${bbs} -# DESTINATION ${BBTK_BBS_INSTALL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path} - DESTINATION ${BBTK_BBS_REL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path} - ) -ELSE(WIN32) -INSTALL( - FILES ${CMAKE_CURRENT_SOURCE_DIR}/${bbs} - DESTINATION ${BBTK_BBS_INSTALL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path} -# DESTINATION ${BBTK_BBS_REL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path} - ) -ENDIF(WIN32) + INSTALL( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/${bbs} +# DESTINATION ${BBTK_BBS_INSTALL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path} + DESTINATION ${BBTK_BBS_REL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path} + ) + ELSE(WIN32) + INSTALL( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/${bbs} + DESTINATION ${BBTK_BBS_INSTALL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path} +# DESTINATION ${BBTK_BBS_REL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path} + ) + ENDIF(WIN32) + ENDFOREACH(bbs) - ## --Configure and installing bbs appli-- - FILE(APPEND - "${OUTPUT_FILE}" - "#-----------------------------------------\n" - "endpackage\n" - "#-- EOF ----------------------------------\n" - ) +##EED 24/06/2013 +## ## --Configure and installing bbs appli-- +## FILE(APPEND +## "${OUTPUT_FILE}" +## "#-----------------------------------------\n" +## "endpackage\n" +## "#-- EOF ----------------------------------\n" +## ) + IF(WIN32) INSTALL( FILES ${OUTPUT_FILE} @@ -152,6 +204,10 @@ ELSE(WIN32) # DESTINATION ${BBTK_BBS_REL_PATH} ) ENDIF(WIN32) + + + + # Creates the file ${BBTK_PACKAGE_NAME}-appli.bbp SET(OUTPUT_FILE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}-appli.bbp) FILE(WRITE diff --git a/kernel/cmake/BBTKKernelConfig.cmake b/kernel/cmake/BBTKKernelConfig.cmake index bdb2f45..dc25843 100644 --- a/kernel/cmake/BBTKKernelConfig.cmake +++ b/kernel/cmake/BBTKKernelConfig.cmake @@ -87,6 +87,7 @@ IF(WIN32) SET(BBTK_BBC ${BBTK_BIN_PATH}/bbc.exe) SET(BBTK_BBI ${BBTK_BIN_PATH}/bbi.exe) SET(BBTK_BBFY ${BBTK_BIN_PATH}/bbfy.exe) + SET(BBTK_BBPCONFIGURATOR ${BBTK_BIN_PATH}/bbpConfigurator.exe) ELSE(WIN32) # For Xcode : have to test the cmake generator ! @@ -99,6 +100,7 @@ ELSE(WIN32) SET(BBTK_BBS2CPP ${BBTK_BIN_PATH}/bbs2cpp) SET(BBTK_BBC ${BBTK_BIN_PATH}/bbc) SET(BBTK_BBFY ${BBTK_BIN_PATH}/bbfy) + SET(BBTK_BBPCONFIGURATOR ${BBTK_BIN_PATH}/bbpConfigurator) ENDIF(WIN32) SET(BBTK_PACKAGE_LIB_PATH ${BBTK_LIB_PATH}) @@ -112,6 +114,7 @@ MESSAGE(STATUS "* BBTK_BBI =${BBTK_BBI}") MESSAGE(STATUS "* BBTK_BBS2CPP =${BBTK_BBS2CPP}") MESSAGE(STATUS "* BBTK_BBC =${BBTK_BBC}") MESSAGE(STATUS "* BBTK_BBFY =${BBTK_BBFY}") +MESSAGE(STATUS "* BBTK_BBPCONFIGURATOR =${BBTK_BBPCONFIGURATOR}") #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- diff --git a/kernel/cmake/BBTKSetDeducedPaths.cmake b/kernel/cmake/BBTKSetDeducedPaths.cmake index 92210a7..bf1bf56 100644 --- a/kernel/cmake/BBTKSetDeducedPaths.cmake +++ b/kernel/cmake/BBTKSetDeducedPaths.cmake @@ -106,6 +106,13 @@ IF(BBTK_CORE_PACKAGE) SET(BBTK_BBFY_DEPENDENCY ${BBTK_BBFY}) ENDIF(EXISTS "${BBTK_BBFY}") + IF(EXISTS "${BBTK_BBPCONFIGURATOR}") + SET(BBTK_BBPCONFIGURATOR_DEPENDENCY) + ELSE(EXISTS "${BBTK_BBPCONFIGURATOR}") + SET(BBTK_BBPCONFIGURATOR_DEPENDENCY ${BBTK_BBPCONFIGURATOR}) + ENDIF(EXISTS "${BBTK_BBPCONFIGURATOR}") + + ENDIF(BBTK_CORE_PACKAGE) #----------------------------------------------------------------------------- -- 2.47.1