1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
From: =?utf-8?q?Timo_R=C3=B6hling?= <timo.roehling@fkie.fraunhofer.de>
Date: Sun, 5 Apr 2020 13:53:03 +0200
Subject: Add CMake configuration to examples
---
examples/callback_api/CMakeLists.txt | 7 +++++++
examples/callback_api/Makefile | 2 --
examples/callback_api/main.cc | 3 +--
examples/obj_sticher/CMakeLists.txt | 7 +++++++
examples/voxelize/CMakeLists.txt | 7 +++++++
examples/voxelize/Makefile | 2 --
examples/voxelize/main.cc | 3 +--
7 files changed, 23 insertions(+), 8 deletions(-)
create mode 100644 examples/callback_api/CMakeLists.txt
delete mode 100644 examples/callback_api/Makefile
create mode 100644 examples/obj_sticher/CMakeLists.txt
create mode 100644 examples/voxelize/CMakeLists.txt
delete mode 100644 examples/voxelize/Makefile
diff --git a/examples/callback_api/CMakeLists.txt b/examples/callback_api/CMakeLists.txt
new file mode 100644
index 0000000..c43f452
--- /dev/null
+++ b/examples/callback_api/CMakeLists.txt
@@ -0,0 +1,7 @@
+project(callback_api_example)
+
+find_package(tinyobjloader REQUIRED)
+
+add_executable(${PROJECT_NAME} main.cc)
+target_link_libraries(${PROJECT_NAME} tinyobjloader::tinyobjloader)
+
diff --git a/examples/callback_api/Makefile b/examples/callback_api/Makefile
deleted file mode 100644
index 45d60d8..0000000
--- a/examples/callback_api/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-all:
- clang++ -I../../ -Wall -g -o example main.cc
diff --git a/examples/callback_api/main.cc b/examples/callback_api/main.cc
index 1911501..703a620 100644
--- a/examples/callback_api/main.cc
+++ b/examples/callback_api/main.cc
@@ -5,8 +5,7 @@
// You need to implement your own Mesh data struct constrution based on this
// example in practical.
//
-#define TINYOBJLOADER_IMPLEMENTATION
-#include "tiny_obj_loader.h"
+#include <tiny_obj_loader.h>
#include <cassert>
#include <cstdio>
diff --git a/examples/obj_sticher/CMakeLists.txt b/examples/obj_sticher/CMakeLists.txt
new file mode 100644
index 0000000..10eaf97
--- /dev/null
+++ b/examples/obj_sticher/CMakeLists.txt
@@ -0,0 +1,7 @@
+project(obj_sticher)
+
+find_package(tinyobjloader REQUIRED)
+
+add_executable(${PROJECT_NAME} obj_sticher.cc obj_writer.cc)
+target_link_libraries(${PROJECT_NAME} tinyobjloader::tinyobjloader)
+
diff --git a/examples/voxelize/CMakeLists.txt b/examples/voxelize/CMakeLists.txt
new file mode 100644
index 0000000..69ce0be
--- /dev/null
+++ b/examples/voxelize/CMakeLists.txt
@@ -0,0 +1,7 @@
+project(voxelize)
+
+find_package(tinyobjloader REQUIRED)
+
+add_executable(${PROJECT_NAME} main.cc)
+target_link_libraries(${PROJECT_NAME} tinyobjloader::tinyobjloader)
+
diff --git a/examples/voxelize/Makefile b/examples/voxelize/Makefile
deleted file mode 100644
index 98189d9..0000000
--- a/examples/voxelize/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-all:
- g++ -o voxelizer main.cc
diff --git a/examples/voxelize/main.cc b/examples/voxelize/main.cc
index 6f11939..841b768 100644
--- a/examples/voxelize/main.cc
+++ b/examples/voxelize/main.cc
@@ -1,8 +1,7 @@
#define VOXELIZER_IMPLEMENTATION
#include "voxelizer.h"
-#define TINYOBJLOADER_IMPLEMENTATION
-#include "../../tiny_obj_loader.h"
+#include <tiny_obj_loader.h>
bool Voxelize(const char* filename, float voxelsizex, float voxelsizey, float voxelsizez, float precision)
{
|