Update source.sh script
This commit is contained in:
@@ -15,30 +15,24 @@ prepare() {
|
|||||||
# The build function is executed in the source directory
|
# The build function is executed in the source directory
|
||||||
# This function is used to compile the source code
|
# This function is used to compile the source code
|
||||||
build() {
|
build() {
|
||||||
mkdir build
|
cmake -B build \
|
||||||
cd build
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
|
|
||||||
cmake -DCMAKE_INSTALL_PREFIX=/usr \
|
|
||||||
-DBUILD_SHARED_LIBS=ON \
|
-DBUILD_SHARED_LIBS=ON \
|
||||||
-DBUILD_TESTING=ON \
|
-DBUILD_TESTING=ON \
|
||||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
|
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||||
cmake --build .
|
cmake --build build
|
||||||
}
|
}
|
||||||
|
|
||||||
# The check function is executed in the source directory
|
# The check function is executed in the source directory
|
||||||
# This function is used to run tests to verify the package has been compiled correctly
|
# This function is used to run tests to verify the package has been compiled correctly
|
||||||
check() {
|
check() {
|
||||||
cd build
|
ctest --test-dir build
|
||||||
|
|
||||||
ctest
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# The package function is executed in the source directory
|
# The package function is executed in the source directory
|
||||||
# This function is used to move the compiled files into the output directory
|
# This function is used to move the compiled files into the output directory
|
||||||
package() {
|
package() {
|
||||||
cd build
|
DESTDIR="$BPM_OUTPUT" cmake --install build
|
||||||
|
|
||||||
DESTDIR="$BPM_OUTPUT" cmake --install .
|
|
||||||
|
|
||||||
# Install package license
|
# Install package license
|
||||||
install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/double-conversion/LICENSE
|
install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/double-conversion/LICENSE
|
||||||
|
|||||||
Reference in New Issue
Block a user