diff --git a/config/templates/cmake b/config/templates/cmake index 0d7c31f..8689be0 100644 --- a/config/templates/cmake +++ b/config/templates/cmake @@ -15,27 +15,20 @@ 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 .. - make + cmake -B build -DCMAKE_INSTALL_PREFIX=/usr + 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 - - make test + 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 - - make DESTDIR="$BPM_OUTPUT" install + DESTDIR="$BPM_OUTPUT" cmake --install build # Install package license install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/$NAME/LICENSE diff --git a/config/templates/meson b/config/templates/meson index 16169d5..53146e3 100644 --- a/config/templates/meson +++ b/config/templates/meson @@ -15,27 +15,20 @@ prepare() { # The build function is executed in the source directory # This function is used to compile the source code build() { - mkdir build - cd build - - meson setup --prefix=/usr .. - meson compile + meson setup build --prefix=/usr + meson compile -C 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 - - meson test + meson test -C 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 - - meson install --destdir="$BPM_OUTPUT" + meson install -C build --destdir="$BPM_OUTPUT" # Install package license install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/$NAME/LICENSE