# Relative path to the data used by bbc from bin folder
SET(bbc_DATA_REL_PATH_FROM_BIN ../${BBTK_DATA_REL_PATH}/${bbc_DATA_REL_PATH_FROM_DATA})
+
+
IF(UNIX)
# Build tree
+ SET(bbc_CMAKE_OPTION_FOR_BUILD_TREE "-DBBTK_DIR=${PROJECT_BINARY_DIR}")
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/main.cxx.in
${BBTK_DATA_BUILD_PATH}/${bbc_DATA_REL_PATH_FROM_DATA}/main.cxx.in
@ONLY IMMEDIATE
)
# Install tree
+ SET(bbc_CMAKE_OPTION_FOR_BUILD_TREE "")
+ CONFIGURE_FILE(
+ ${CMAKE_CURRENT_SOURCE_DIR}/bbc.sh.in
+ ${CMAKE_CURRENT_BINARY_DIR}/bbc
+ @ONLY IMMEDIATE
+ )
INSTALL(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/main.cxx.in ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in
DESTINATION ${BBTK_DATA_INSTALL_PATH}/${bbc_DATA_REL_PATH_FROM_DATA}
)
INSTALL(
- PROGRAMS ${BBTK_BINARY_DIR}/bin/bbc
+ PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/bbc
DESTINATION bin
)
sed s,OUTPUT,${OUTPUT},g ${DATADIR}/CMakeLists.txt.in > ${WORKDIR}/CMakeLists.txt
sed s,EXEC_FUNCTION,${EXEC_FUNCTION},g ${DATADIR}/main.cxx.in > ${WORKDIR}/main.cxx
cd ${WORKDIR}
-bbs2cpp ${IN} > log.txt
-cmake . > log.txt
+${BINPATH}/bbs2cpp ${IN} > log.txt
+cmake . @bbc_CMAKE_OPTION_FOR_BUILD_TREE@ > log.txt
make > log.txt
mv ${OUTPUT} ${CUR}/
cd ${CUR}