From 0fdef74c73a662b127aba102df21b405b9094bb7 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Wed, 10 Sep 2025 18:16:25 +0300 Subject: [PATCH] Update cmake and meson templates --- config/templates/cmake | 15 ++++----------- config/templates/meson | 15 ++++----------- 2 files changed, 8 insertions(+), 22 deletions(-) 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