-# Empty package structure
+
+
+# Relative path to the data used by bbCreatePackage from data root folder
+SET(bbCreatePackage_DATA_REL_PATH_FROM_DATA kernel/bbCreatePackage)
+
+# Configure / Install the empty package structure used by bbCreatePackage
+# Copy it into build tree
FILE(GLOB_RECURSE LST_FILE_VOID_CREATE_PACKAGE RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/void-Package *.txt *.in *.cmake )
FOREACH( iLST ${LST_FILE_VOID_CREATE_PACKAGE})
STRING(SUBSTRING ${iLST} 0 3 subStrTmp )
IF( ${subStrTmp} STREQUAL "../" )
# ...
ELSE( ${subStrTmp} STREQUAL "../" )
- IF(WIN32)
- CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/void-Package/${iLST} ${BBTK_BINARY_DIR}/Debug/bbCreate/void-Package/${iLST} COPYONLY )
- CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/void-Package/${iLST} ${BBTK_BINARY_DIR}/Release/bbCreate/void-Package/${iLST} COPYONLY )
- ELSE(WIN32)
- CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/void-Package/${iLST} ${BBTK_BINARY_DIR}/bin/bbCreate/void-Package/${iLST} COPYONLY )
- ENDIF(WIN32)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/void-Package/${iLST}
+ ${BBTK_DATA_BUILD_PATH}/${bbCreatePackage_DATA_REL_PATH_FROM_DATA}/void-Package/${iLST}
+ COPYONLY )
ENDIF( ${subStrTmp} STREQUAL "../" )
ENDFOREACH(iLST)
-
-
-SET(bbCreatePackage_DATA_REL_PATH ../${BBTK_DATA_REL_PATH}/CreatePackage)
-
+# Install the build tree folder
+INSTALL(
+ DIRECTORY ${BBTK_DATA_BUILD_PATH}/${bbCreatePackage_DATA_REL_PATH_FROM_DATA}/void-Package
+ DESTINATION ${BBTK_DATA_INSTALL_PATH}/${bbCreatePackage_DATA_REL_PATH_FROM_DATA}
+ )
+
+# Configure / Install the script bbCreatePackage
+SET(bbCreatePackage_DATA_REL_PATH_FROM_BIN ../${BBTK_DATA_REL_PATH}/${bbCreatePackage_DATA_REL_PATH_FROM_DATA})
IF(WIN32)
-message("EED " ${CMAKE_CURRENT_SOURCE_DIR})
-message("EED " ${CMAKE_CURRENT_BINARY_DIR})
+ # Build tree
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/bbCreatePackage.bat.in
${BBTK_BINARY_DIR}/Debug/bbCreatePackage.bat
${BBTK_BINARY_DIR}/Release/bbCreatePackage.bat
@ONLY IMMEDIATE
)
+ # install tree
INSTALL_FILES(/bin .bat bbCreatePackage)
- # INSTALL_FILES(/bin .bbs bbCreatePackage)
ENDIF(WIN32)
IF(UNIX)
+ # Build tree
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/bbCreatePackage.sh.in
${BBTK_BINARY_DIR}/bin/bbCreatePackage
@ONLY IMMEDIATE
)
-
-# INSTALLS THE PROGRAM
+ # Install tree
INSTALL(
- PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/bbCreatePackage
+ PROGRAMS ${BBTK_BINARY_DIR}/bin/bbCreatePackage
DESTINATION bin
- # PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
-##EED INSTALL(
-##EED FILES void-bbtk-package.tgz
-##EED DESTINATION ${BBTK_DATA_REL_PATH}/bbCreatePackage
-##EED )
-
-
-# CONFIGURE_FILE(
-# ${CMAKE_CURRENT_SOURCE_DIR}/bbCreatePackage.bbs
-# ${CMAKE_CURRENT_BINARY_DIR}/bbCreatePackage.bbs
-# @ONLY IMMEDIATE
-# )
-# INSTALL(
-# FILES ${CMAKE_CURRENT_BINARY_DIR}/bbCreatePackage.bbs
-# DESTINATION bin
-# PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
-# )
ENDIF(UNIX)
fi
# bbCreatePackage path
-#EED TMP=$(which bbCreatePackage|rev)
-#EED BBCP=$(echo ${TMP#*/}|rev)
-#EED INPUT=${BBCP}/@bbCreatePackage_DATA_REL_PATH@/void-bbtk-package.tgz
-pathVoidPackage=bbCreate/void-Package
+TMP=$(which $0|rev)
+BINPATH=$(echo ${TMP#*/}|rev)
+# Input data path
+INPUT=${BINPATH}/@bbCreatePackage_DATA_REL_PATH_FROM_BIN@/void-Package
OUTPUT=$1
PACK=$2
AUTHOR=$3
DESCRIPTION=$4
-ppwwdd=${PWD}
-
echo "output= " $OUTPUT
-echo "BBCP= " $BBCP
-echo "pathVoidPackage= " $pathVoidPackage
-echo "pack="$PACK
-
+echo "bin = " $BINPATH
+echo "input = " $INPUT
+echo "pack = " $PACK
if [ -d $OUTPUT/${PACK} ]
then
exit
fi
-echo "**ls Creating new black box package '$PACK' in folder '$OUTPUT'"
+echo "** Creating new black box package '$PACK' in folder '$OUTPUT'"
if [ ! -d $OUTPUT ]
then
exit
fi
-#EED echo "-> Uncompressing package files"
-#EED cd $OUTPUT
-#EED tar zxvf ${INPUT}
-cp -R ${pathVoidPackage} "$OUTPUT/$PACK"
+cp -R ${INPUT} "$OUTPUT/$PACK"
cd $OUTPUT/$PACK
-#EED sed s,WITHOUT_NAME,${PACK}, CMakeLists.txt > CMakeLists2.txt
-#EED sed s,WITHOUT_AUTHOR,"${AUTHOR}", CMakeLists2.txt > CMakeLists3.txt
-#EED sed s,WITHOUT_DESCRIPTION,"${DESCRIPTION}", CMakeLists3.txt > CMakeLists.txt
-${ppwwdd}/bbSed CMakeLists.txt WITHOUT_NAME "${PACK}" > CMakeLists2.txt
-${ppwwdd}/bbSed CMakeLists2.txt WITHOUT_AUTHOR "${AUTHOR}" > CMakeLists3.txt
-${ppwwdd}/bbSed CMakeLists3.txt WITHOUT_DESCRIPTION "${DESCRIPTION}" > CMakeLists.txt
+${BINPATH}/bbSed CMakeLists.txt WITHOUT_NAME "${PACK}" > CMakeLists2.txt
+${BINPATH}/bbSed CMakeLists2.txt WITHOUT_AUTHOR "${AUTHOR}" > CMakeLists3.txt
+${BINPATH}/bbSed CMakeLists3.txt WITHOUT_DESCRIPTION "${DESCRIPTION}" > CMakeLists.txt
rm -f CMakeLists2.txt CMakeLists3.txt
echo "Done !"