diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/KicadUtilsConfig.cmake | 1 | ||||
-rw-r--r-- | cmake/kicad_generate_header.cmake | 17 |
2 files changed, 13 insertions, 5 deletions
diff --git a/cmake/KicadUtilsConfig.cmake b/cmake/KicadUtilsConfig.cmake index 1cb682d..a2e6419 100644 --- a/cmake/KicadUtilsConfig.cmake +++ b/cmake/KicadUtilsConfig.cmake @@ -1,3 +1,4 @@ +set(kicad_generate_header_cmd KicadUtils::generate-header) include("${CMAKE_CURRENT_LIST_DIR}/kicad_generate_header.cmake") include("${CMAKE_CURRENT_LIST_DIR}/kicad_pcb_plot.cmake") include("${CMAKE_CURRENT_LIST_DIR}/KicadUtilsTargets.cmake") diff --git a/cmake/kicad_generate_header.cmake b/cmake/kicad_generate_header.cmake index 0514a34..bf7ad2e 100644 --- a/cmake/kicad_generate_header.cmake +++ b/cmake/kicad_generate_header.cmake @@ -41,19 +41,26 @@ function(kicad_generate_header) set(template "${kicad_gen_TEMPLATE}") endif () - set(lib "-l;${CMAKE_CURRENT_SOURCE_DIR}") - foreach (l IN LISTS kicad_gen_TEMPLATE_LIB_LIST) - list(APPEND lib -l "${l}") - endforeach () + if (kicad_gen_TEMPLATE_LIB_LIST) + foreach (l IN LISTS kicad_gen_TEMPLATE_LIB_LIST) + list(APPEND lib -l "${l}") + endforeach () + endif () + if (KICAD_GEN_TEMPLATE_LIBS) + foreach (l IN LISTS KICAD_GEN_TEMPLATE_LIBS) + list(APPEND lib -l "${l}") + endforeach () + endif () set(output_file "${output_dir}/${output}") file(RELATIVE_PATH output_file_rel "${output_rel_dir}" ${output_file}) # message("kicad_generate_header: output_file=${output_file}") # message("kicad_generate_header: output_file_rel=${output_file_rel}") + message("kicad_generate_header: kicad_generate_header_cmd=${kicad_generate_header_cmd}") add_custom_command(OUTPUT "${output_file}" - COMMAND KicadUtils::generate-header -n ${NET} -r ${REF} -o ${output_file} ${t} ${template} ${lib} + COMMAND ${kicad_generate_header_cmd} -n ${NET} -r ${REF} -o ${output_file} ${t} ${template} ${lib} MAIN_DEPENDENCY ${NET} COMMENT "Generating ${output_file_rel}") |