aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/CMakeLists.txt19
-rw-r--r--examples/arduino-led/CMakeLists.txt2
-rw-r--r--examples/intel-quark-d2000/CMakeLists.txt6
3 files changed, 13 insertions, 14 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 58048ff..2cb3286 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,11 +1,14 @@
-cmake_minimum_required(VERSION 3.5)
-project(kicad_utils_examples)
+# If we're not included by the msgflo project, find the sources the normal way. This is what you should do in your
+# application
+if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
+ 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")
+ find_package(KicadUtils)
+ 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 ()
endif ()
-add_subdirectory(arduino-led)
-add_subdirectory(intel-quark-d2000)
+#add_subdirectory(arduino-led)
+#add_subdirectory(intel-quark-d2000)
diff --git a/examples/arduino-led/CMakeLists.txt b/examples/arduino-led/CMakeLists.txt
index 7855dff..4cc7341 100644
--- a/examples/arduino-led/CMakeLists.txt
+++ b/examples/arduino-led/CMakeLists.txt
@@ -1,5 +1,3 @@
-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 3920d4b..f3a6cc1 100644
--- a/examples/intel-quark-d2000/CMakeLists.txt
+++ b/examples/intel-quark-d2000/CMakeLists.txt
@@ -1,10 +1,8 @@
-find_package(KicadUtils)
-
kicad_generate_header(
OUTPUT schematic.h
NET schematic/intel-quark-d2000.net
REF U1
- TEMPLATE intel-quark-d2000.py
+ TEMPLATE intel-quark-d2000
TEMPLATE_LIB_LIST .)
if (FALSE)
@@ -13,5 +11,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 schematic-py.h)
+ add_custom_target(intel-quark-d2000 ALL DEPENDS schematic.h)
endif ()