From b7a8bfce9f14fa4b019b792676b53353e4d59541 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Wed, 18 Oct 2023 04:34:48 -0700 Subject: [PATCH] Fix broken scripts, add script to run and test via CMake. --- .circleci/config.yml | 10 +++++----- cmake/packaging.cmake | 18 +++++++++--------- scripts/install-depdendencies.sh | 2 +- scripts/setup-cmake.sh | 14 ++++++++++++++ 4 files changed, 29 insertions(+), 15 deletions(-) create mode 100755 scripts/setup-cmake.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 3fdf736..477c14f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,19 +9,19 @@ jobs: # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. # See: https://circleci.com/docs/configuration-reference/#executor-job docker: - - image: cimg/base:stable + - image: kisom/sc-dev:latest # Add steps to the job # See: https://circleci.com/docs/configuration-reference/#steps steps: - checkout - run: - name: "Install dependencies" - command: "./scripts/install-dependencies.sh" + name: "Setup cmake build" + command: "./scripts/setup-cmake.sh" - # Orchestrate jobs using workflows # See: https://circleci.com/docs/configuration-reference/#workflows workflows: - say-hello-workflow: + ctest: jobs: - - say-hello + - ctest diff --git a/cmake/packaging.cmake b/cmake/packaging.cmake index ae2d21f..fc2654e 100644 --- a/cmake/packaging.cmake +++ b/cmake/packaging.cmake @@ -20,15 +20,15 @@ set(CPACK_DEBIAN_PACKAGE_SECTION devel) set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON) set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) -if(LINUX) -set(CPACK_GENERATOR "DEB;STGZ;TGZ") -elseif(APPLE) -set(CPACK_GENERATOR "productbuild") -elseif(MSVC OR MSYS OR MINGW) -set(CPACK_GENERATOR "NSIS;ZIP") -else() -set(CPACK_GENERATOR "ZIP") -endif() +if (LINUX) + set(CPACK_GENERATOR "DEB;STGZ;TGZ") +elseif (APPLE) + set(CPACK_GENERATOR "productbuild") +elseif (MSVC OR MSYS OR MINGW) + set(CPACK_GENERATOR "NSIS;ZIP") +else () + set(CPACK_GENERATOR "ZIP") +endif () set(CPACK_SOURCE_GENERATOR "TGZ;ZIP") diff --git a/scripts/install-depdendencies.sh b/scripts/install-depdendencies.sh index 780d05b..0eb69ba 100755 --- a/scripts/install-depdendencies.sh +++ b/scripts/install-depdendencies.sh @@ -33,7 +33,7 @@ install_debianesque () { fi echo "[+] installing tools" - sudo $SUDO apt-get $APTARGS install git clang scdoc python3-pip + sudo $SUDO apt-get $APTARGS install git clang scdoc python3-pip doxygen graphviz } install_unsupported () { diff --git a/scripts/setup-cmake.sh b/scripts/setup-cmake.sh new file mode 100755 index 0000000..6449cd6 --- /dev/null +++ b/scripts/setup-cmake.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +###################################################################### +# @author : kyle (kyleimap.cc) +# @file : setup-cmake +# @created : Wednesday Oct 18, 2023 04:24:21 PDT +# +# @description : Prepare a CMake build environment, build, and test. +###################################################################### + +set -eux + +mkdir -p build && cd build +cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. && make all test && ctest