-
Modern CMake Infrastructure (CMake 3.20+)
- Root CMakeLists.txt with proper project configuration
- C++20 standard enforced
- Export compile commands for IDE integration
- Proper build type handling
-
Dependency Management
- FetchContent used for all dependencies:
- fmt 10.2.1 (string formatting)
- spdlog 1.13.0 (logging)
- CLI11 2.4.1 (command-line parsing)
- nlohmann_json 3.11.3 (JSON parsing)
- GoogleTest 1.14.0 (testing framework)
- Option to use system dependencies (FINCH_USE_SYSTEM_DEPS)
- FetchContent used for all dependencies:
-
CMake Helper Modules (in
cmake/directory)- CompilerWarnings.cmake: Comprehensive warning flags for GCC, Clang, and MSVC
- Sanitizers.cmake: Debug build sanitizer support (ASAN, UBSAN, etc.)
- Dependencies.cmake: Centralized dependency management
- FinchConfig.cmake.in: Package configuration template
-
Project Structure
finch-corelibrary targetfinchexecutable with CLI interface- Test infrastructure with GoogleTest
- Example programs
- Proper target properties and compile features
-
Build Features
- Cross-platform support (Linux, macOS, Windows)
- Debug/Release build configurations
- Optional components (tests, examples, docs)
- Coverage support infrastructure
- CPack configuration for packaging
-
Current Status
- ✅ CMake configures successfully
- ✅ Project builds without errors
- ✅ Tests pass (2/2)
- ✅ Executables run correctly
- ✅ Version information properly generated
# Configure
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
# Build
make -j8
# Run tests
ctest --output-on-failure
# Run executables
./bin/finch --help
./examples/hello_finchFINCH_BUILD_TESTS: Build test suite (default: ON)FINCH_BUILD_EXAMPLES: Build examples (default: ON)FINCH_BUILD_DOCS: Build documentation (default: OFF)FINCH_ENABLE_COVERAGE: Enable coverage reporting (default: OFF)FINCH_ENABLE_SANITIZERS: Enable sanitizers in Debug builds (default: ON)FINCH_WARNINGS_AS_ERRORS: Treat compiler warnings as errors (default: OFF)FINCH_USE_SYSTEM_DEPS: Use system-installed dependencies (default: OFF)
- Installation rules temporarily disabled due to FetchContent dependency export complexity
- Some GCC-specific warnings removed from Clang builds to avoid unknown warning errors
- Replace dummy source files with actual implementation
- Re-enable installation rules with proper dependency handling
- Add more comprehensive tests
- Implement actual finch functionality (analyze, convert, validate commands)
- Eventually use finch to generate Buck2 files for this project (eating our own dogfood)
The CMake build system is now ready for development and serves as a good example of modern CMake practices that finch will eventually convert to Buck2.