aboutsummaryrefslogtreecommitdiffhomepage
path: root/content/2022-05-30-cmake-cargo-example/Makefile
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2022-05-30 20:44:53 +0200
committerJohannes Stoelp <johannes.stoelp@gmail.com>2022-05-30 20:44:53 +0200
commita93e90cf3c50344a2582acb0e60187dbef90ee28 (patch)
tree2fd049370f4bf5df5792258d3471f582d1bf7449 /content/2022-05-30-cmake-cargo-example/Makefile
parent3389d0a128d874d930e22f256b2646dd86b3b402 (diff)
downloadblog-a93e90cf3c50344a2582acb0e60187dbef90ee28.tar.gz
blog-a93e90cf3c50344a2582acb0e60187dbef90ee28.zip
cmake: add example how to integrate cargo
Diffstat (limited to 'content/2022-05-30-cmake-cargo-example/Makefile')
-rw-r--r--content/2022-05-30-cmake-cargo-example/Makefile14
1 files changed, 14 insertions, 0 deletions
diff --git a/content/2022-05-30-cmake-cargo-example/Makefile b/content/2022-05-30-cmake-cargo-example/Makefile
new file mode 100644
index 0000000..e269cb2
--- /dev/null
+++ b/content/2022-05-30-cmake-cargo-example/Makefile
@@ -0,0 +1,14 @@
+TYPE ?= Debug
+BDIR := BUILD/$(TYPE)
+
+calc: config
+ cmake --build $(BDIR) --target calc
+
+config: CMakeLists.txt
+ cmake -B $(BDIR) -DCMAKE_BUILD_TYPE=$(TYPE) .
+
+run: calc
+ $(BDIR)/calc
+
+clean:
+ $(RM) -r BUILD