# Sqlitecpp Build Cmake

> Build SQLiteCpp with CMake. Use for CMake builds, tests, options, or build scripts.

- Skill: `srombauts/sqlitecpp-build-cmake` (Agent Skill)
- Install (CLI): `npx skillmds@latest add srombauts/sqlitecpp-build-cmake`
- Raw SKILL.md: https://api.skillmd.com/api/skills/srombauts/sqlitecpp-build-cmake/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: srombauts (https://skillmd.com/u/srombauts)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/srombauts/sqlitecpp-build-cmake

---


# SQLiteCpp CMake Build

## Quick builds
- Windows (VS 2026):
  - `mkdir build`
  - `cd build`
  - `cmake -G "Visual Studio 18 2026" -DSQLITECPP_BUILD_TESTS=ON -DSQLITECPP_BUILD_EXAMPLES=ON ..`
  - `cmake --build . --config Release`
- Unix/macOS:
  - `mkdir build && cd build`
  - `cmake -DCMAKE_BUILD_TYPE=Debug -DSQLITECPP_BUILD_TESTS=ON -DSQLITECPP_BUILD_EXAMPLES=ON ..`
  - `cmake --build .`

## Build scripts
- `build.bat` (Windows) enables shared libs, tests, examples, and runs `ctest`.
- `build.sh` (Unix) enables ASAN, shared libs, tests, examples, and runs `ctest`.

## Common options
- `SQLITECPP_BUILD_TESTS` (OFF): build unit tests.
- `SQLITECPP_BUILD_EXAMPLES` (OFF): build examples.
- `BUILD_SHARED_LIBS` (OFF): build shared libs (DLLs).
- `SQLITECPP_INTERNAL_SQLITE` (ON): use bundled sqlite3 source.
- `SQLITE_ENABLE_COLUMN_METADATA` (ON): enable `getColumnOriginName()`.
- `SQLITECPP_RUN_CPPLINT` (ON): run cpplint target.
- `SQLITECPP_RUN_CPPCHECK` (ON): run cppcheck target.
- `SQLITECPP_RUN_DOXYGEN` (OFF): generate docs.
- `SQLITECPP_USE_ASAN` (OFF): address sanitizer.
- `SQLITECPP_USE_GCOV` (OFF): GCov coverage.
- `SQLITECPP_DISABLE_STD_FILESYSTEM` (OFF): disable std::filesystem support.
- `SQLITECPP_DISABLE_EXPANDED_SQL` (OFF): disable sqlite3_expanded_sql support.

## Tests
- `ctest --output-on-failure`
- `ctest --output-on-failure -V`
- `ctest --output-on-failure -R "Database"`

## Notes
- Tests can use a system `GTest`; otherwise they fall back to the `googletest` submodule.
- If the submodule is needed: `git submodule update --init --recursive`.
- The minimum CMake version is not required to remain at 3.5. Raising it is acceptable when a modest
  version bump enables cleaner target-based CMake or matches bundled dependency requirements. Choose
  the new minimum deliberately and update CMake configuration, documentation, and CI consistently.
- The bundled GoogleTest 1.16 project already requires CMake 3.13 when tests use the submodule, even
  though SQLiteCpp currently declares CMake 3.5 at the top level.

