aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2016-09-21 23:19:33 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2016-09-21 23:19:33 +0200
commitca61cafa2bd04235203d43026710e3522bcdd088 (patch)
treebef97f796ab20c69c44d2a431eb9fdca3f4e32cb /cmake
parent46c0b0c41342ea8c4f6f82ef1ff7fa470a97a583 (diff)
downloadkicad-utils-ca61cafa2bd04235203d43026710e3522bcdd088.tar.gz
kicad-utils-ca61cafa2bd04235203d43026710e3522bcdd088.tar.bz2
kicad-utils-ca61cafa2bd04235203d43026710e3522bcdd088.tar.xz
kicad-utils-ca61cafa2bd04235203d43026710e3522bcdd088.zip
kicad_gerber: Support for renaming layers and uppercasing all extensions.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/kicad_gerber.cmake25
1 files changed, 14 insertions, 11 deletions
diff --git a/cmake/kicad_gerber.cmake b/cmake/kicad_gerber.cmake
index 330c5bd..580fa10 100644
--- a/cmake/kicad_gerber.cmake
+++ b/cmake/kicad_gerber.cmake
@@ -1,7 +1,7 @@
function(kicad_gerber)
- set(options ALL)
+ set(options ALL UPPERCASE_EXTENSIONS)
set(one_value_args TARGET PCB_FILE DIR ZIP_FILE NAMING_STYLE)
- set(multi_value_args)
+ set(multi_value_args LAYER_EXTENSION)
cmake_parse_arguments(ARGS "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})
if (NOT ARGS_PCB_FILE)
@@ -15,7 +15,7 @@ function(kicad_gerber)
if (ARGS_NAMING_STYLE STREQUAL MODERN)
elseif (ARGS_NAMING_STYLE STREQUAL PROTEL)
- set(protel --protel-extension)
+ set(protel --protel-extensions)
else ()
message(SEND_ERROR "Unsupported NAMING_STYLE: ${ARGS_NAMING_STYLE}")
return()
@@ -36,11 +36,19 @@ function(kicad_gerber)
return()
endif ()
+ foreach (le ${ARGS_LAYER_EXTENSION})
+ list(APPEND les --layer-extension ${le})
+ endforeach ()
+
+ if (ARGS_UPPERCASE_EXTENSIONS)
+ set(uppercase_extensions --uppercase-extensions)
+ endif ()
+
set(out_dir "${ARGS_DIR}")
set(prefix "${out_dir}/${basename}")
execute_process(
- COMMAND "${KicadUtilsPyDir}/kicad_gerber.py" --pcb "${pcb_file}" --output-directory "${out_dir}" ${protel} --detect-files-only
+ COMMAND "${KicadUtilsPyDir}/kicad_gerber.py" --pcb "${pcb_file}" --output-directory "${out_dir}" ${protel} ${uppercase_extensions} ${les} --detect-files-only
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${target}-gerber-index.txt
OUTPUT_VARIABLE out
ERROR_VARIABLE err
@@ -53,16 +61,11 @@ function(kicad_gerber)
return()
endif ()
-# foreach (o ${out})
-# list(APPEND outputs ${prefix}${o})
-# endforeach ()
-
- # message("out=${out}")
- message("outputs=${outputs}")
+ message("outputs=${outputs}")
add_custom_command(
OUTPUT ${outputs}
COMMAND cmake -E make_directory "${out_dir}"
- COMMAND "${KicadUtilsPyDir}/kicad_gerber.py" --pcb "${pcb_file}" --output-directory "${out_dir}" ${protel}
+ COMMAND "${KicadUtilsPyDir}/kicad_gerber.py" --pcb "${pcb_file}" --output-directory "${out_dir}" ${protel} ${uppercase_extensions} ${les}
MAIN_DEPENDENCY "${pcb_file}")
if (ARGS_ALL)