aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2016-08-01 08:20:23 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2016-08-01 08:20:23 +0200
commitbfeeac6e4889d1e9a1083b3c7efc59652981b168 (patch)
treea937d844a59da7c509685dcd1ddd9933772e526f /examples
parentc307e9f234e544386fa3ae53083c7510668e1716 (diff)
downloadkicad-utils-bfeeac6e4889d1e9a1083b3c7efc59652981b168.tar.gz
kicad-utils-bfeeac6e4889d1e9a1083b3c7efc59652981b168.tar.bz2
kicad-utils-bfeeac6e4889d1e9a1083b3c7efc59652981b168.tar.xz
kicad-utils-bfeeac6e4889d1e9a1083b3c7efc59652981b168.zip
o Moving the generation logic to Python, embedding a Python interpreter with the help of pybind11.
o Adding install configuration to CMake to make it easier to reuse the project later on. o Splitting out the examples into its own project to make it easier to test the whole installation setup and python/template loading. o Trying to reorganize the code a bit, not very much better yet.
Diffstat (limited to 'examples')
-rw-r--r--examples/CMakeLists.txt9
-rw-r--r--examples/arduino-led/CMakeLists.txt2
-rw-r--r--examples/intel-quark-d2000/CMakeLists.txt7
-rw-r--r--examples/intel-quark-d2000/intel-quark-d2000.py2
4 files changed, 18 insertions, 2 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 04baca4..58048ff 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,2 +1,11 @@
+cmake_minimum_required(VERSION 3.5)
+project(kicad_utils_examples)
+
+find_package(KicadUtils QUIET)
+
+if (NOT KicadUtils_FOUND)
+ message(FATAL_ERROR "The KicadUtils CMake package was not found. Did you pass the correct value for KicadUtils_DIR?\nIt should probably be something like KicadUtils_DIR=$HOME/opt/kicad-utils/lib/cmake/KicadUtils")
+endif ()
+
add_subdirectory(arduino-led)
add_subdirectory(intel-quark-d2000)
diff --git a/examples/arduino-led/CMakeLists.txt b/examples/arduino-led/CMakeLists.txt
index 06ef920..a615fb7 100644
--- a/examples/arduino-led/CMakeLists.txt
+++ b/examples/arduino-led/CMakeLists.txt
@@ -1,3 +1,5 @@
+find_package(KicadUtils)
+
kicad_generate_header(
OUTPUT schematic.h
NET schematic/arduino-led.net
diff --git a/examples/intel-quark-d2000/CMakeLists.txt b/examples/intel-quark-d2000/CMakeLists.txt
index 1822996..3920d4b 100644
--- a/examples/intel-quark-d2000/CMakeLists.txt
+++ b/examples/intel-quark-d2000/CMakeLists.txt
@@ -1,8 +1,11 @@
+find_package(KicadUtils)
+
kicad_generate_header(
OUTPUT schematic.h
NET schematic/intel-quark-d2000.net
REF U1
- IN_SOURCE)
+ TEMPLATE intel-quark-d2000.py
+ TEMPLATE_LIB_LIST .)
if (FALSE)
# If you have Intel Quark support for CMake something like this would work:
@@ -10,5 +13,5 @@ if (FALSE)
#add_executable(arduino-led arduino-led.ino schematic.h)
#target_include_directories(arduino-led PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/kicad-include)
else ()
- add_custom_target(intel-quark-d2000 ALL DEPENDS schematic.h)
+ add_custom_target(intel-quark-d2000 ALL DEPENDS schematic.h schematic-py.h)
endif ()
diff --git a/examples/intel-quark-d2000/intel-quark-d2000.py b/examples/intel-quark-d2000/intel-quark-d2000.py
new file mode 100644
index 0000000..b69a919
--- /dev/null
+++ b/examples/intel-quark-d2000/intel-quark-d2000.py
@@ -0,0 +1,2 @@
+# noinspection PyUnresolvedReferences
+generateHeader.write("foo")