Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
3ab13f2
Adding installation support (again)
sean-parent Nov 11, 2025
b69d45f
Update README.md
sean-parent Nov 11, 2025
e4d9f54
Fixing quoting issue.
sean-parent Nov 11, 2025
bcb610f
Update ci.yml
sean-parent Nov 12, 2025
79bc0a0
Update ci.yml
sean-parent Nov 12, 2025
7d2ce0b
Fixing quotes for Windows bash.
sean-parent Nov 12, 2025
eb92bfd
Trying again to fix quoting...
sean-parent Nov 12, 2025
b2d8e3c
Removing CPMFindPackage CI test
sean-parent Nov 12, 2025
e927f5b
Update ci.yml
sean-parent Nov 12, 2025
832313c
making the ci.yml file into a cmake template
sean-parent Nov 12, 2025
77c30bc
Fixing force init for CI and simplifying CI template.
sean-parent Nov 12, 2025
13cf43f
Adding contracts for CMake functions.
sean-parent Nov 12, 2025
562ad63
Update CI workflow to conditionally run CMake steps
sean-parent Nov 12, 2025
69e1aff
Merge branch 'sean-parent/install' of https://github.com/stlab/cpp-li…
sean-parent Nov 12, 2025
49eaf58
Add PACKAGE_NAME to install setup and improve version detection
sean-parent Nov 14, 2025
fc7d4e4
Automate find_dependency generation for installed packages
sean-parent Nov 14, 2025
c1bce1c
Refactor to use PACKAGE_NAME for target and CI consistency
sean-parent Nov 17, 2025
39419e2
Add custom dependency mapping for CMake package generation
sean-parent Nov 17, 2025
e940916
Refactor template and CI setup to use PACKAGE_NAME
sean-parent Nov 18, 2025
0516b9b
Remove redundant install-test job from CI workflow
sean-parent Nov 18, 2025
e4a3ee5
Improve dependency mapping and version override support
sean-parent Nov 18, 2025
4f09b3b
Update CI to set compiler env vars conditionally
sean-parent Nov 18, 2025
579b1ed
Update README for CPM repository naming compatibility
sean-parent Nov 20, 2025
f13bae3
Add interactive setup script and update README
sean-parent Nov 21, 2025
a4670d0
Improve setup instructions and input handling - WIP
sean-parent Nov 23, 2025
3c81f5e
Add CI workflow and comprehensive dependency mapping tests
sean-parent Dec 12, 2025
05b463e
Update docs and install logic; add troubleshooting
sean-parent Dec 12, 2025
da92c05
Update ci.yml
sean-parent Dec 12, 2025
256d0e7
Simplify CI workflow to use only Ubuntu and update test names
sean-parent Dec 12, 2025
fba98d9
Implement dependency provider for accurate install dependency tracking
sean-parent Dec 12, 2025
5423d14
Remove CMake < 3.24 fallback support and simplify implementation
sean-parent Dec 12, 2025
31df212
Simplify README - remove design rationale and redundant examples
sean-parent Dec 12, 2025
9aad344
Fix CI test project to demonstrate correct usage order
sean-parent Dec 12, 2025
25cf15c
Update README to reflect changes in CMake version and project setup o…
sean-parent Dec 12, 2025
4cc037d
Update CMake setup for cpp-library and enhance property handling
sean-parent Dec 12, 2025
414ea74
Refactor CMake setup to include CTest after project() call
sean-parent Dec 12, 2025
b1f2cbe
Refactor CMake dependency provider setup and enhance argument parsing
sean-parent Dec 12, 2025
e4c031c
Update setup.cmake
sean-parent Dec 12, 2025
29dcde0
Initial plan
Copilot Dec 12, 2025
f9b864f
Add note to check for latest cpp-library version in README examples
Copilot Dec 12, 2025
0dcb1da
Remove TEST_SUMMARY.md file from tests directory to streamline docume…
sean-parent Dec 12, 2025
22c7da1
Merge branch 'sean-parent/install-with-provider' of https://github.co…
sean-parent Dec 12, 2025
d2950da
Update tests/install/test_dependency_mapping.cmake
sean-parent Dec 12, 2025
361700e
Add provider merging tests and enhance dependency handling
sean-parent Dec 12, 2025
86be78a
Merge branch 'sean-parent/install-with-provider' of https://github.co…
sean-parent Dec 12, 2025
75af6cd
Update cpp-library.cmake
sean-parent Dec 12, 2025
f76187b
Update setup.cmake
sean-parent Dec 12, 2025
4bf995b
Enhance CMake header guard generation and improve dependency handling
sean-parent Dec 12, 2025
ff8cd7b
Merge branch 'sean-parent/install-with-provider' of https://github.co…
sean-parent Dec 12, 2025
0dcc7a2
Merge pull request #13 from stlab/copilot/sub-pr-12
sean-parent Dec 13, 2025
affec68
Remove test_bug1.cmake file, which contained tests for regex handling…
sean-parent Dec 13, 2025
3d75542
Merge branch 'sean-parent/install-with-provider' of https://github.co…
sean-parent Dec 13, 2025
219221c
Enhance CMake functionality and improve error messaging
sean-parent Dec 13, 2025
e1f2a81
Refine CMake regex handling for clean name calculation and version ex…
sean-parent Dec 13, 2025
89eeddd
Enhance CMake dependency handling and improve regex safety
sean-parent Dec 13, 2025
40f1197
Refactor CMake dependency provider to preserve CONFIG flag and handle…
sean-parent Dec 13, 2025
0851512
Defer install module inclusion until after project() in CMake
sean-parent Dec 15, 2025
65dbed9
Remove install preset from README
sean-parent Dec 16, 2025
e7baccf
Removing readme reference to specific version.
sean-parent Dec 16, 2025
7535323
Defer enable_testing() to directory scope for CTest
sean-parent Dec 16, 2025
c13e524
Fix handling of CONFIG and keywords in component merging
sean-parent Dec 16, 2025
4a3cb8c
Set CPM_SOURCE_CACHE in CMake presets and update docs
sean-parent Dec 16, 2025
14e9674
Standardize version usage and improve setup automation
sean-parent Dec 16, 2025
d85c6cd
Handle QUIET dependencies in dependency provider
sean-parent Dec 16, 2025
a1cb536
Update usage example for dependency tracking
sean-parent Dec 16, 2025
b809931
Use EVAL CODE for enable_testing in cpp-library.cmake
sean-parent Dec 16, 2025
9903dd3
Improve CMake usage and clarify dependency tracking
sean-parent Dec 17, 2025
5d0565f
Improve clang-tidy support for MSVC and update docs
sean-parent Dec 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 155 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# CI workflow for cpp-library project itself

name: CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main]

jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Run dependency mapping tests
run: cmake -P tests/install/CMakeLists.txt

- name: Run provider merging tests
run: cmake -P tests/install/test_provider_merge.cmake

integration-tests:
name: Integration Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Download CPM.cmake
run: |
mkdir -p cmake
wget -q -O cmake/CPM.cmake https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/get_cpm.cmake

- name: Create test project
run: |
mkdir -p test-project/include/testlib
cd test-project

# Create CMakeLists.txt that uses cpp-library
cat > CMakeLists.txt << 'EOF'
cmake_minimum_required(VERSION 3.24)

# Setup CPM before project()
include(../cmake/CPM.cmake)

# Fetch cpp-library before project()
# Check https://github.com/stlab/cpp-library/releases for the latest version
CPMAddPackage(NAME cpp-library SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
include(${cpp-library_SOURCE_DIR}/cpp-library.cmake)

# Enable dependency tracking before project()
cpp_library_enable_dependency_tracking()

# Now call project()
project(mylib VERSION 1.0.0)

# Create a simple test library
cpp_library_setup(
DESCRIPTION "Test library for cpp-library"
NAMESPACE testlib
HEADERS mylib.hpp
)
EOF

# Create a simple header
cat > include/testlib/mylib.hpp << 'EOF'
#pragma once
namespace testlib {
inline int get_value() { return 42; }
}
EOF

- name: Configure test project
run: |
cd test-project
cmake -B build -DCMAKE_BUILD_TYPE=Release

- name: Build test project
run: |
cd test-project
cmake --build build

- name: Install test project
run: |
cd test-project
cmake --install build --prefix ${{ runner.temp }}/install

- name: Verify installation
run: |
# Check that package config was installed
if [ ! -f "${{ runner.temp }}/install/lib/cmake/testlib-mylib/testlib-mylibConfig.cmake" ]; then
echo "Error: Package config not found"
exit 1
fi
echo "✓ Installation successful"

- name: Test find_package
run: |
mkdir -p test-consumer
cd test-consumer

# Create a consumer project
cat > CMakeLists.txt << 'EOF'
cmake_minimum_required(VERSION 3.20)
project(test-consumer)

find_package(testlib-mylib REQUIRED)

add_executable(consumer main.cpp)
target_link_libraries(consumer PRIVATE testlib::mylib)
EOF

# Create main.cpp
cat > main.cpp << 'EOF'
#include <testlib/mylib.hpp>
#include <iostream>
int main() {
std::cout << "Value: " << testlib::get_value() << std::endl;
return 0;
}
EOF

# Configure with installed package
cmake -B build -DCMAKE_PREFIX_PATH=${{ runner.temp }}/install

# Build
cmake --build build

echo "✓ Consumer project built successfully"

documentation:
name: Documentation Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Check README examples
run: |
# Extract and validate code blocks from README
grep -A 20 '```cmake' README.md | head -50
echo "✓ README documentation looks valid"

- name: Validate template files
run: |
# Check that all template files exist
test -f templates/CMakePresets.json
test -f templates/Config.cmake.in
test -f templates/Doxyfile.in
test -f templates/custom.css
echo "✓ All template files present"

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"cSpell.words": [
"clangd",
"ctest",
"doctest",
"MSVC",
"mylib"
],
"cmake.ignoreCMakeListsMissing": true
}
Loading