MACRO(BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT BBTK_PACKAGE_NAME BBTK_PACKAGE_BBS_BOXES BBTK_PACKAGE_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}")
-
# Creates the file ${BBTK_PACKAGE_NAME}.bbs
+ SET(OUTPUT_PATH ${BBTK_BBS_INSTALL_PATH})
+ SET(OUTPUT_FILE ${PROJECT_BINARY_DIR}/${OUTPUT_PATH}/${BBTK_PACKAGE_NAME}.bbs)
FILE(WRITE
"${OUTPUT_FILE}"
"#-----------------------------------------\n"
FILE(APPEND
"${OUTPUT_FILE}"
"#-----------------------------------------\n"
- "include ${bbs}\n"
+ "include ${BBTK_PACKAGE_NAME}/${bbs}\n"
)
ENDFOREACH(bbs)
+ FILE(APPEND
+ "${OUTPUT_FILE}"
+ "#-----------------------------------------\n"
+ "endpackage\n"
+ "#-- EOF ----------------------------------\n"
+ )
+ INSTALL(
+ FILES ${OUTPUT_FILE}
+ DESTINATION ${OUTPUT_PATH}
+ )
+
+ # Creates the file ${BBTK_PACKAGE_NAME}-appli.bbs
+ SET(OUTPUT_PATH ${BBTK_BBS_INSTALL_PATH})
+ SET(OUTPUT_FILE ${PROJECT_BINARY_DIR}/${OUTPUT_PATH}/${BBTK_PACKAGE_NAME}-appli.bbs)
+ FILE(WRITE
+ "${OUTPUT_FILE}"
+ "#-----------------------------------------\n"
+ "# Applications 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_APPLI})
GET_FILENAME_COMPONENT(filename "${bbs}" NAME_WE)
FILE(APPEND
"${OUTPUT_FILE}"
"#-----------------------------------------\n"
"define ${filename}\n"
- "include ${bbs}\n"
+ "include ${BBTK_PACKAGE_NAME}/${bbs}\n"
"endefine\n"
)
ENDFOREACH(bbs)
"endpackage\n"
"#-- EOF ----------------------------------\n"
)
-
-# ADD_CUSTOM_TARGET(${BBTK_PACKAGE_NAME}.bbs ALL
-# DEPENDS ${OUTPUT_FILE}
-# )
-
INSTALL(
FILES ${OUTPUT_FILE}
DESTINATION ${OUTPUT_PATH}
)
+
+# ADD_CUSTOM_TARGET(${BBTK_PACKAGE_NAME}.bbs ALL
+# DEPENDS ${OUTPUT_FILE}
+# )
+
ENDMACRO(BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT)