Gating network behind compile flag
This commit is contained in:
@@ -4,11 +4,16 @@
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
function(dusk_run_python CMAKE_TARGET_NAME PYTHON_MODULE)
|
||||
cmake_parse_arguments(DUSK_RUN_PYTHON "" "OUTPUT" "DEPENDS;ARGS" ${ARGN})
|
||||
find_package(Python3 COMPONENTS Interpreter REQUIRED)
|
||||
|
||||
add_custom_target(${CMAKE_TARGET_NAME} ALL
|
||||
add_custom_command(
|
||||
OUTPUT ${DUSK_RUN_PYTHON_OUTPUT}
|
||||
WORKING_DIRECTORY ${DUSK_ROOT_DIR}
|
||||
COMMAND
|
||||
${Python3_EXECUTABLE} -m ${PYTHON_MODULE} ${ARGN}
|
||||
${Python3_EXECUTABLE} -m ${PYTHON_MODULE} ${DUSK_RUN_PYTHON_ARGS}
|
||||
DEPENDS ${DUSK_RUN_PYTHON_DEPENDS}
|
||||
VERBATIM
|
||||
)
|
||||
add_custom_target(${CMAKE_TARGET_NAME} DEPENDS ${DUSK_RUN_PYTHON_OUTPUT})
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user