Skip to content

Commit

Permalink
scopify!
Browse files Browse the repository at this point in the history
  • Loading branch information
wusatosi committed Feb 3, 2025
1 parent 8f99a76 commit 0aea22d
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 139 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,17 @@ jobs:
# Portable commands only
cmake --build build --config Release --parallel --verbose
cmake --build build --config Release --target all_verify_interface_header_sets
cmake --install build --config Release --prefix /opt/beman.exemplar
ls -R /opt/beman.exemplar
cmake --install build --config Release --prefix /opt/beman.scope
ls -R /opt/beman.scope
- name: Test Release
run: ctest --test-dir build --build-config Release
- name: Build Debug
run: |
# Portable commands only
cmake --build build --config Debug --parallel --verbose
cmake --build build --config Debug --target all_verify_interface_header_sets
cmake --install build --config Debug --prefix /opt/beman.exemplar
ls -R /opt/beman.exemplar
cmake --install build --config Debug --prefix /opt/beman.scope
ls -R /opt/beman.scope
- name: Test Debug
run: ctest --test-dir build --build-config Debug

Expand All @@ -147,9 +147,9 @@ jobs:
matrix:
args:
- name: "Disable build testing"
arg: "-DBEMAN_EXEMPLAR_BUILD_TESTS=OFF"
arg: "-DBEMAN_SCOPE_BUILD_TESTS=OFF"
- name: "Disable example building"
arg: "-DBEMAN_EXEMPLAR_BUILD_EXAMPLES=OFF"
arg: "-DBEMAN_SCOPE_BUILD_EXAMPLES=OFF"
name: "CMake: ${{ matrix.args.name }}"
steps:
- uses: actions/checkout@v4
Expand All @@ -172,15 +172,15 @@ jobs:
# Portable commands only
cmake --build build --config Release --parallel --verbose
cmake --build build --config Release --target all_verify_interface_header_sets
cmake --install build --config Release --prefix /opt/beman.exemplar
ls -R /opt/beman.exemplar
cmake --install build --config Release --prefix /opt/beman.scope
ls -R /opt/beman.scope
- name: Build Debug
run: |
# Portable commands only
cmake --build build --config Debug --parallel --verbose
cmake --build build --config Debug --target all_verify_interface_header_sets
cmake --install build --config Debug --prefix /opt/beman.exemplar
ls -R /opt/beman.exemplar
cmake --install build --config Debug --prefix /opt/beman.scope
ls -R /opt/beman.scope
compiler-test:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -249,8 +249,8 @@ jobs:
run: |
cmake --build build --config Debug --verbose
cmake --build build --config Debug --target all_verify_interface_header_sets
cmake --install build --config Debug --prefix /opt/beman.exemplar
find /opt/beman.exemplar -type f
cmake --install build --config Debug --prefix /opt/beman.scope
find /opt/beman.scope -type f
- name: Test Debug
run: ctest --test-dir build --build-config Debug

Expand Down
21 changes: 8 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,28 @@

cmake_minimum_required(VERSION 3.25)

project(
beman.exemplar # CMake Project Name, which is also the name of the top-level
# targets (e.g., library, executable, etc.).
DESCRIPTION "A Beman library exemplar"
LANGUAGES CXX
)
project(beman.scope DESCRIPTION "Generic Scope Guard" LANGUAGES CXX)

enable_testing()

# [CMAKE.SKIP_TESTS]
option(
BEMAN_EXEMPLAR_BUILD_TESTS
BEMAN_SCOPE_BUILD_TESTS
"Enable building tests and test infrastructure. Default: ON. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
)

# [CMAKE.SKIP_EXAMPLES]
option(
BEMAN_EXEMPLAR_BUILD_EXAMPLES
BEMAN_SCOPE_BUILD_EXAMPLES
"Enable building examples. Default: ON. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
)

include(FetchContent)
include(GNUInstallDirs)

if(BEMAN_EXEMPLAR_BUILD_TESTS)
if(BEMAN_SCOPE_BUILD_TESTS)
# Fetch GoogleTest
FetchContent_Declare(
googletest
Expand All @@ -41,12 +36,12 @@ if(BEMAN_EXEMPLAR_BUILD_TESTS)
FetchContent_MakeAvailable(googletest)
endif()

add_subdirectory(src/beman/exemplar)
add_subdirectory(src/beman/scope)

if(BEMAN_EXEMPLAR_BUILD_TESTS)
add_subdirectory(tests/beman/exemplar)
if(BEMAN_SCOPE_BUILD_TESTS)
add_subdirectory(tests/beman/scope)
endif()

if(BEMAN_EXEMPLAR_BUILD_EXAMPLES)
if(BEMAN_SCOPE_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
Loading

0 comments on commit 0aea22d

Please sign in to comment.