diff --git a/source.sh b/source.sh index 049da08..55bd819 100644 --- a/source.sh +++ b/source.sh @@ -14,31 +14,25 @@ prepare() { # The build function is executed in the source directory # This function is used to compile the source code -build() { - mkdir build - cd build - - cmake -DCMAKE_INSTALL_PREFIX=/usr \ +build() { + cmake -B build \ + -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_TESTING=ON \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 .. - cmake --build . + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + cmake --build build } # The check function is executed in the source directory # This function is used to run tests to verify the package has been compiled correctly check() { - cd build - - ctest + ctest --test-dir build } # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package() { - cd build - - DESTDIR="$BPM_OUTPUT" cmake --install . + DESTDIR="$BPM_OUTPUT" cmake --install build # Install package license install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/double-conversion/LICENSE