-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_with_cmake_vcpkg.sh
executable file
·130 lines (115 loc) · 2.25 KB
/
build_with_cmake_vcpkg.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/bash
LINK_OPTION="-shared"
GENERATE_PRESET="ninja-multi-vcpkg${LINK_OPTION}"
BUILD_PRESET="ninja-vcpkg-release${LINK_OPTION}"
TEST_PRESET="test-release-shared"
PACKAGE_PRESET_ZIP="package-zip-release${LINK_OPTION}"
PACKAGE_PRESET_TGZ="package-tar-gz-release${LINK_OPTION}"
PACKAGE_PRESET_DEB="package-deb-release${LINK_OPTION}"
PACKAGE_PRESET_RPM="package-rpm-release${LINK_OPTION}"
#PACKAGE_PRESET_NSIS64="package-nsis64-release${LINK_OPTION}"
BUILDS="builds"
#WORKFLOW_PRESET="workflow-ninja-vcpkg-linux"
if [ "$1" == "--clean" ]
then
echo "#####"
echo "# Cleaning builds folder"
echo "#####"
if [ -d ${BUILDS} ]
then
rm -r ${BUILDS}
else
echo
echo "Nothing to clean"
fi
fi
if [ "${WORKFLOW_PRESET}" != "" ]
then
echo "#####"
echo "# Calling CMake workflow: ${WORKFLOW_PRESET}"
echo "#####"
cmake --workflow --preset "${WORKFLOW_PRESET}"
exit
fi
echo "#####"
echo "# Creating CMake build files"
echo "#####"
cmake --preset ${GENERATE_PRESET}
if [ $? != "0" ]
then
exit
elif [ "${BUILD_PRESET}" != "" ]
then
echo
echo "#####"
echo "# Building NosoCpp"
echo "#####"
cmake --build --preset ${BUILD_PRESET}
fi
## CTest
if [ $? != "0" ]
then
exit
elif [ "${TEST_PRESET}" != "" ]
then
echo
echo "#####"
echo "# Testing NosoCpp"
echo "#####"
ctest --preset ${TEST_PRESET}
fi
if [ $? != "0" ]
then
exit
elif [ "${PACKAGE_PRESET_ZIP}" != "" ]
then
echo
echo "#####"
echo "# Packaging NosoCpp *.zip"
echo "#####"
cpack --preset ${PACKAGE_PRESET_ZIP}
fi
if [ $? != "0" ]
then
exit
elif [ "${PACKAGE_PRESET_TGZ}" != "" ]
then
echo
echo "#####"
echo "# Packaging NosoCpp *.tar.gz"
echo "#####"
cpack --preset ${PACKAGE_PRESET_TGZ}
fi
if [ $? != "0" ]
then
exit
elif [ "${PACKAGE_PRESET_DEB}" != "" ]
then
echo
echo "#####"
echo "# Packaging NosoCpp *.deb"
echo "#####"
cpack --preset ${PACKAGE_PRESET_DEB}
fi
if [ $? != "0" ]
then
exit
elif [ "${PACKAGE_PRESET_RPM}" != "" ]
then
echo
echo "#####"
echo "# Packaging NosoCpp *.rpm"
echo "#####"
cpack --preset ${PACKAGE_PRESET_RPM}
fi
if [ $? != "0" ]
then
exit
elif [ "${PACKAGE_PRESET_NSIS64}" != "" ]
then
echo
echo "#####"
echo "# Packaging NosoCpp install.exe"
echo "#####"
cpack --preset ${PACKAGE_PRESET_NSIS64}
fi