diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/kicad_gerber.cmake | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cmake/kicad_gerber.cmake b/cmake/kicad_gerber.cmake index c56ed19..4e8c850 100644 --- a/cmake/kicad_gerber.cmake +++ b/cmake/kicad_gerber.cmake @@ -25,6 +25,10 @@ function(kicad_gerber) get_filename_component(pcb_file "${ARGS_PCB_FILE}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") get_filename_component(basename "${pcb_file}" NAME_WE) + if (NOT DEFINED KicadUtilsPython) + set(KicadUtilsPython python) + endif () + if (NOT ARGS_TARGET) set(target "${basename}-gerber") else () @@ -56,10 +60,11 @@ function(kicad_gerber) endif() execute_process( - COMMAND "${KicadUtilsPyDir}/kicad_gerber.py" + COMMAND "${KicadUtilsPython}" "${KicadUtilsPyDir}/kicad_gerber.py" --pcb "${pcb_file}" --output-directory "${out_dir}" - --detect-files-only ${CMAKE_CURRENT_BINARY_DIR}/${target}-gerber-index.txt + --detect-files-only + --index ${CMAKE_CURRENT_BINARY_DIR}/${target}-gerber-index.txt ${protel} ${uppercase_extensions} ${extended_gerber_attributes} @@ -107,6 +112,7 @@ function(kicad_gerber) OUTPUT ${ARGS_ZIP_FILE} MAIN_DEPENDENCY "${pcb_file}" DEPENDS ${outputs} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND cmake -E remove -f ${ARGS_ZIP_FILE} COMMAND zip -q ${ARGS_ZIP_FILE} -j ${outputs}) endif () |