File: build

package info (click to toggle)
tinygltf 2.9.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,512 kB
  • sloc: cpp: 8,600; sh: 45; makefile: 27
file content (37 lines) | stat: -rwxr-xr-x 674 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
set -e

run()
{
	echo '$' "$@"
	"$@"
}

tmpdir="$(mktemp -d)"
trap "rm -rf $tmpdir" EXIT
cd "$tmpdir"

cat >"CMakeLists.txt" << EOF
cmake_minimum_required(VERSION 3.13...3.26)
project(test)
find_package(TinyGLTF REQUIRED)
add_executable(test_tinygltf test_tinygltf.cpp)
target_link_libraries(test_tinygltf TinyGLTF::TinyGLTF)
EOF

cat >"test_tinygltf.cpp" << EOF
#include <tiny_gltf.h>

int main (int argc, char** argv)
{
	tinygltf::Model model;
	tinygltf::TinyGLTF ctx;
	return 0;
}
EOF
run cmake .
run make VERBOSE=ON
run ./test_tinygltf
run g++ -o test_tinygltf_pkgconfig test_tinygltf.cpp `pkg-config --cflags --libs tinygltf`
run ./test_tinygltf_pkgconfig