mirror of
https://git.gfz-potsdam.de/naaice/poet.git
synced 2025-12-15 20:38:23 +01:00
Fix build process to only produce benchmarks when needed
This commit is contained in:
parent
e11caba0b3
commit
d7c23c6b3c
@ -1,21 +1,32 @@
|
|||||||
|
|
||||||
function(ADD_BENCH_TARGET TARGET POET_BENCH_LIST RT_FILES OUT_PATH)
|
function(ADD_BENCH_TARGET TARGET POET_BENCH_LIST RT_FILES OUT_PATH)
|
||||||
add_custom_target(${TARGET})
|
|
||||||
|
|
||||||
set(bench_install_dir share/poet/${OUT_PATH})
|
set(bench_install_dir share/poet/${OUT_PATH})
|
||||||
|
|
||||||
|
# create empty list
|
||||||
|
set(OUT_FILES_LIST "")
|
||||||
|
|
||||||
foreach(BENCH_FILE ${${POET_BENCH_LIST}})
|
foreach(BENCH_FILE ${${POET_BENCH_LIST}})
|
||||||
get_filename_component(BENCH_NAME ${BENCH_FILE} NAME_WE)
|
get_filename_component(BENCH_NAME ${BENCH_FILE} NAME_WE)
|
||||||
set(OUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${BENCH_NAME}.rds)
|
set(OUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${BENCH_NAME}.rds)
|
||||||
|
|
||||||
add_custom_command(TARGET ${TARGET}
|
add_custom_command(
|
||||||
|
OUTPUT ${OUT_FILE}
|
||||||
COMMAND $<TARGET_FILE:poet_init> -o ${OUT_FILE} -s ${CMAKE_CURRENT_SOURCE_DIR}/${BENCH_FILE}
|
COMMAND $<TARGET_FILE:poet_init> -o ${OUT_FILE} -s ${CMAKE_CURRENT_SOURCE_DIR}/${BENCH_FILE}
|
||||||
COMMENT "Running poet_init on ${BENCH_FILE}"
|
COMMENT "Running poet_init on ${BENCH_FILE}"
|
||||||
DEPENDS poet_init
|
DEPENDS poet_init ${CMAKE_CURRENT_SOURCE_DIR}/${BENCH_FILE}
|
||||||
VERBATIM
|
VERBATIM
|
||||||
|
COMMAND_EXPAND_LISTS
|
||||||
)
|
)
|
||||||
|
|
||||||
install(FILES ${OUT_FILE} DESTINATION ${bench_install_dir})
|
list(APPEND OUT_FILES_LIST ${OUT_FILE})
|
||||||
|
|
||||||
endforeach(BENCH_FILE ${${POET_BENCH_LIST}})
|
endforeach(BENCH_FILE ${${POET_BENCH_LIST}})
|
||||||
|
|
||||||
|
add_custom_target(
|
||||||
|
${TARGET}
|
||||||
|
DEPENDS ${OUT_FILES_LIST})
|
||||||
|
|
||||||
|
install(FILES ${OUT_FILES_LIST} DESTINATION ${bench_install_dir})
|
||||||
|
|
||||||
# install all ADD_FILES to the same location
|
# install all ADD_FILES to the same location
|
||||||
install(FILES ${${RT_FILES}} DESTINATION ${bench_install_dir})
|
install(FILES ${${RT_FILES}} DESTINATION ${bench_install_dir})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user