aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-09-27 15:07:11 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-09-27 15:07:11 +0200
commitca4fd8d4cf43a8624a9c902682e157f80708d47b (patch)
tree15fd68b83533af072b87cb6fde85218e36ca92a1 /cmake
parent4de1811d0258900099eab778a0ec01931d5bd21d (diff)
downloadkicad-utils-ca4fd8d4cf43a8624a9c902682e157f80708d47b.tar.gz
kicad-utils-ca4fd8d4cf43a8624a9c902682e157f80708d47b.tar.bz2
kicad-utils-ca4fd8d4cf43a8624a9c902682e157f80708d47b.tar.xz
kicad-utils-ca4fd8d4cf43a8624a9c902682e157f80708d47b.zip
kicad_gerber.cmake: Adding KicadUtilsPython option to select whichHEADmaster
python binary to use. kicad_gerber.py: Sync from ee-python, support executing self with python3 if running under v2 and other way around. Useful if kicad is using the other version.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/kicad_gerber.cmake10
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 ()