diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2024-05-21 01:29:20 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2024-05-21 01:29:20 +0200 |
commit | b54b8f5b25403cf3b9623804b2491ec78a8b913e (patch) | |
tree | 8100b69a2fd1e37d1eb400a33c92ec3c984f208b /cmake | |
parent | 0bbc18869720ad042b668742ca48e5cb8a37491a (diff) | |
download | blogc-b54b8f5b25403cf3b9623804b2491ec78a8b913e.tar.gz blogc-b54b8f5b25403cf3b9623804b2491ec78a8b913e.tar.bz2 blogc-b54b8f5b25403cf3b9623804b2491ec78a8b913e.zip |
build: replace autotools with cmake
this patch removes all the autoconf/automake/libtool build
infrastructure and replaces it with cmake.
notable default behavior changes:
- man pages are not pre-built, and are not built by default, must be
enabled with `-DBUILD_MANPAGES=ON`.
removed features:
- srpm packaging, to be reintroduced at some point.
- deb packaging, now handled externally via rafaelmartins/deb.rgm.io
more stuff must be missing, please report bugs!
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/cpack/install_license_and_readme.cmake | 20 | ||||
-rw-r--r-- | cmake/cpack/install_version.cmake | 9 | ||||
-rwxr-xr-x | cmake/scripts/test.sh | 23 |
3 files changed, 52 insertions, 0 deletions
diff --git a/cmake/cpack/install_license_and_readme.cmake b/cmake/cpack/install_license_and_readme.cmake new file mode 100644 index 0000000..c41bc46 --- /dev/null +++ b/cmake/cpack/install_license_and_readme.cmake @@ -0,0 +1,20 @@ +# SPDX-FileCopyrightText: 2024 Rafael G. Martins <rafael@rafaelmartins.eng.br> +# SPDX-License-Identifier: BSD-3-Clause + +if(NOT CPACK_SOURCE_INSTALLED_DIRECTORIES) + if(CPACK_SYSTEM_NAME MATCHES "^win") + set(_license "LICENSE.txt") + else() + set(_license "LICENSE") + endif() + + file(COPY_FILE + "${CPACK_RESOURCE_FILE_LICENSE}" + "${CMAKE_INSTALL_PREFIX}/${_license}" + ) + + file(COPY_FILE + "${CPACK_RESOURCE_FILE_README}" + "${CMAKE_INSTALL_PREFIX}/README.md" + ) +endif() diff --git a/cmake/cpack/install_version.cmake b/cmake/cpack/install_version.cmake new file mode 100644 index 0000000..c37b786 --- /dev/null +++ b/cmake/cpack/install_version.cmake @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: 2024 Rafael G. Martins <rafael@rafaelmartins.eng.br> +# SPDX-License-Identifier: BSD-3-Clause + +if(CPACK_SOURCE_INSTALLED_DIRECTORIES) + file(WRITE + "${CMAKE_INSTALL_PREFIX}/version.cmake" + "set(BLOGC_VERSION \"${CPACK_PACKAGE_VERSION}\")" + ) +endif() diff --git a/cmake/scripts/test.sh b/cmake/scripts/test.sh new file mode 100755 index 0000000..cbf0de4 --- /dev/null +++ b/cmake/scripts/test.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# SPDX-FileCopyrightText: 2024 Rafael G. Martins <rafael@rafaelmartins.eng.br> +# SPDX-License-Identifier: BSD-3-Clause + +set -Eeuo pipefail + +if [[ "${VARIANT:-}" = "memcheck" ]]; then + export VALGRIND=valgrind + export TESTS_ENVIRONMENT=" + ${VALGRIND} \ + --tool=memcheck \ + --leak-check=full \ + --leak-resolution=high \ + --num-callers=20 \ + --error-exitcode=1 \ + --show-possibly-lost=no" +fi + +if [[ "${1}" == *.sh ]]; then + exec "${@}" +else + exec ${TESTS_ENVIRONMENT:-} "${@}" +fi |