Skip to content

fix(cmake): unbundled build failure with disabled features (#5196)#5197

Merged
matejk merged 3 commits intopoco-1.15.1from
5196-fix-1.15-cmake-regressions
Feb 11, 2026
Merged

fix(cmake): unbundled build failure with disabled features (#5196)#5197
matejk merged 3 commits intopoco-1.15.1from
5196-fix-1.15-cmake-regressions

Conversation

@matejk
Copy link
Copy Markdown
Contributor

@matejk matejk commented Feb 11, 2026

Summary

Fixes #5196: CMake build failure when using POCO_UNBUNDLED=ON with features like PDF disabled (-DENABLE_PDF=OFF) and their corresponding system libraries not installed.

  • dependencies/png, expat, sqlite3: When unbundled, only find_package() for libraries that are actually needed by enabled features. Previously, disabled features still triggered unnecessary (and sometimes failing) find_package() calls.
  • dependencies/hpdf: Early return() with warning when POCO_UNBUNDLED is set and PNG::PNG target doesn't exist, preventing the target_link_libraries error on a missing target.
  • CMakeLists.txt: Fix status message logic — POCO_UNBUNDLED forces POCO_SQLITE_UNBUNDLED=ON, so checking POCO_SQLITE_UNBUNDLED inside the POCO_UNBUNDLED branch was always true. Restored the correct 3-branch structure.
  • CMakeLists.txt: Force ENABLE_FOUNDATION=ON since all components depend on it.

Test plan

  • cmake -DENABLE_PDF=OFF -DPOCO_UNBUNDLED=ON succeeds without libpng installed
  • cmake -DENABLE_DATA_SQLITE=OFF -DPOCO_SQLITE_UNBUNDLED=ON succeeds without sqlite warning
  • cmake -DENABLE_XML=OFF -DPOCO_UNBUNDLED=ON succeeds without libexpat installed
  • cmake -DENABLE_PDF=ON -DPOCO_UNBUNDLED=ON correctly requires system libpng
  • cmake -DENABLE_FOUNDATION=OFF builds Foundation anyway
  • Default bundled build unaffected
  • Tested 111 option combinations across bundled, sqlite-unbundled, and fully unbundled modes with 0 failures

@matejk matejk force-pushed the 5196-fix-1.15-cmake-regressions branch from bf58b77 to 64f5fe6 Compare February 11, 2026 08:18
@matejk matejk changed the base branch from main to poco-1.15.1 February 11, 2026 14:17
@matejk matejk merged commit 8a2c8b2 into poco-1.15.1 Feb 11, 2026
100 checks passed
@matejk matejk deleted the 5196-fix-1.15-cmake-regressions branch February 11, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.15.0 CMake build failure with -DENABLE_PDF:BOOL=FALSE

1 participant