File: build-examples

package info (click to toggle)
field3d 1.7.3-6
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,684 kB
  • sloc: cpp: 25,324; ansic: 2,594; python: 222; sh: 72; makefile: 26
file content (56 lines) | stat: -rwxr-xr-x 1,448 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
# Copyright 2016 Ghislain Antony Vaillant
#
# This file is part of the autopkgtest testsuite for Field3D.

set -e

# Presence of $AUTOPKGTEST_TMP implies that someone will handle cleanup for us, so we
# can avoid duplicating the effort (signal handling, etc.) here.
if [ -z "$AUTOPKGTEST_TMP" ]
then
	echo "Required envvar \"$AUTOPKGTEST_TMP\"is not set" >&2
	exit 1
fi

# Copy example source code.
cp -r /usr/share/doc/field3d-doc/examples/* "$AUTOPKGTEST_TMP"
cd "$AUTOPKGTEST_TMP"

# Create the CMake project.
cat <<EOF > CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(dummy)

set(Boost_COMPONENTS system thread)
find_package(Boost COMPONENTS \${Boost_COMPONENTS} REQUIRED)
include_directories(\${Boost_INCLUDE_DIRS})
link_directories(\${Boost_LIBRARY_DIRS})

find_package(HDF5 REQUIRED)
include_directories(\${HDF5_INCLUDE_DIRS})
link_directories(\${HDF5_LIBRARY_DIRS})

find_package(PkgConfig)
pkg_check_modules(OPENEXR QUIET OpenEXR)
include_directories(\${OPENEXR_INCLUDE_DIRS})

link_libraries(Field3D
               \${Boost_LIBRARIES}
               \${HDF5_LIBRARIES}
               \${OPENEXR_LIBRARIES})

add_executable(create_and_write create_and_write/main.cpp)
add_executable(mixed_types mixed_types/main.cpp)
add_executable(read read/main.cpp)
add_executable(sparse_field_io sparse_field_io/main.cpp)

EOF

# Configure and build.
mkdir build && cd build
cmake ./..
echo "configure: OK"
make
echo "build: OK"