-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproof.sh
executable file
·94 lines (77 loc) · 2.37 KB
/
proof.sh
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
#/bin/sh
set -e
##
## Prerequisite: get the path to a boost installation
##
WORKDIR=tmp_todel
mkdir -p ${WORKDIR}
rm -r ${WORKDIR}
mkdir -p ${WORKDIR}
pushd ${WORKDIR}
conan install boost/1.75.0@ -g cmake_paths
BOOST_ROOT=$(cat conan_paths.cmake | sed -ne 's/set(CONAN_BOOST_ROOT "\(.*\)")/\1/p')
echo Boost installation path: ${BOOST_ROOT}
echo
popd
rm -r ${WORKDIR}
##
## Build the demo repository
##
WORKDIR=build
mkdir -p ${WORKDIR}
rm -r ${WORKDIR}
mkdir -p ${WORKDIR}
pushd ${WORKDIR}
BUILD_DIR=$(pwd)
cmake .. -C ../64bit.cmake -DBUILD_tests=ON -DCMAKE_INSTALL_PREFIX=${BUILD_DIR}/SDK/myrepository -DBoost_ROOT=${BOOST_ROOT}
cmake --build . --config Release --target install
popd
##
## Build a downstream consumer, mocking-up a separate repository
##
# From build tree
WORKDIR=build-downstream
mkdir -p ${WORKDIR}
rm -r ${WORKDIR}
mkdir -p ${WORKDIR}
pushd ${WORKDIR}
cmake ../downstream -C ../64bit.cmake -DCMAKE_PREFIX_PATH=${BUILD_DIR} -DBoost_ROOT=${BOOST_ROOT}
cmake --build . --config Release
popd
# From install tree
WORKDIR=build-downstream-install
mkdir -p ${WORKDIR}
rm -r ${WORKDIR}
mkdir -p ${WORKDIR}
pushd ${WORKDIR}
cmake ../downstream -C ../64bit.cmake -DCMAKE_PREFIX_PATH=${BUILD_DIR}/SDK/myrepository -DBoost_ROOT=${BOOST_ROOT}
cmake --build . --config Release
popd
##
## Usage
##
# Development: satisfy upstream dependencies with Conan
WORKDIR=build-dev
mkdir -p ${WORKDIR}
rm -r ${WORKDIR}
mkdir -p ${WORKDIR}
pushd ${WORKDIR}
local_sdk_folder=$(pwd)/SDK
conan install ../conan
cmake -C ../64bit.cmake \
-DCMAKE_PROJECT_MyRepository_INCLUDE=conan/customconan.cmake \
-DCMAKE_INSTALL_PREFIX=${local_sdk_folder}/beneficialproject \
..
cmake --build . --config Release --target install
popd
# Development: Export the recipe, build a package and test it (with customconan.cmake)
conan create ./conan 0.0.0@user/testing
conan remove myrepository/0.0.0@user/testing -f
# Development: Export the recipe, build a package and test it (with default conanbuildinfo.cmake)
conan create ./conan 0.0.0@user/testing -tf test_package_default
# Note: recipe is removed later, it is used by a subsequent step
# Command-line usage
conan install myrepository/0.0.0@user/testing
conan install --build myrepository myrepository/0.0.0@user/testing # Should trigger rebuild
# Removal of the recipe
conan remove myrepository/0.0.0@user/testing -f