#----------------------------------------------------------------------------
IF(BBTK_PACKAGE_INCLUDE_ALL_BBS_BOXES)
- FILE(GLOB BBTK_PACKAGE_BBS_BOXES "boxes" "*.bbs")
+ FILE(GLOB
+ BBTK_PACKAGE_BBS_BOXES
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ "boxes/*.bbs"
+ )
+
+# !! Produces a cmake seg. fault :
+# FILE(GLOB
+# BBTK_PACKAGE_BBS_BOXES
+# "boxes/"
+# )
+
+
ENDIF(BBTK_PACKAGE_INCLUDE_ALL_BBS_BOXES)
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
IF(BBTK_PACKAGE_INCLUDE_ALL_BBS_APPLI)
- FILE(GLOB BBTK_PACKAGE_BBS_APPLI "appli" "*.bbs")
+ FILE(GLOB BBTK_PACKAGE_BBS_APPLI
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ "appli/*.bbs"
+ )
ENDIF(BBTK_PACKAGE_INCLUDE_ALL_BBS_APPLI)
#----------------------------------------------------------------------------
SET(OUTPUT_PATH ${BBTK_BBS_INSTALL_PATH}/${BBTK_PACKAGE_NAME})
SET(OUTPUT_FILE ${PROJECT_BINARY_DIR}/${OUTPUT_PATH}/${BBTK_PACKAGE_NAME}.bbs)
- MESSAGE(ERROR "${BBTK_PACKAGE_BBS_BOXES} - ${BBTK_PACKAGE_BBS_APPLI}")
+ # MESSAGE(ERROR "${BBTK_PACKAGE_BBS_BOXES} - ${BBTK_PACKAGE_BBS_APPLI}")
# Creates the file ${BBTK_PACKAGE_NAME}.bbs
FILE(WRITE
"${OUTPUT_FILE}"
- "# Include script for bbtk package '${BBTK_PACKAGE_NAME}' - automatically generated by cmake (macro BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT)\n")
+ "#-----------------------------------------\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"
)
FOREACH(bbs ${BBTK_PACKAGE_BBS_BOXES})
FILE(APPEND
"${OUTPUT_FILE}"
+ "#-----------------------------------------\n"
"include ${bbs}\n"
)
ENDFOREACH(bbs)
FOREACH(bbs ${BBTK_PACKAGE_BBS_APPLI})
+ GET_FILENAME_COMPONENT(filename "${bbs}" NAME_WE)
FILE(APPEND
"${OUTPUT_FILE}"
- "define ${bbs}\n"
+ "#-----------------------------------------\n"
+ "define ${filename}\n"
"include ${bbs}\n"
- "endefine"
+ "endefine\n"
)
ENDFOREACH(bbs)
FILE(APPEND
"${OUTPUT_FILE}"
- "endpackage\n"
+ "#-----------------------------------------\n"
+ "endpackage\n"
+ "#-- EOF ----------------------------------\n"
)
# ADD_CUSTOM_TARGET(${BBTK_PACKAGE_NAME}.bbs ALL