Request for Official CMake Build Support in PDFium

17 views
Skip to first unread message

金金丁

unread,
Apr 15, 2026, 9:29:12 PM (3 days ago) Apr 15
to pdfium


Dear PDFium Maintainers,

I am writing to formally request the addition of official CMake build support to the PDFium project.

As you know, PDFium currently relies on gn and ninja for its build system. While these tools are highly efficient for Chromium-based projects, many downstream developers and integrators work within ecosystems where CMake is the industry standard.

The inclusion of an official CMakeLists.txt would significantly benefit the community in several ways:

  1. Easier Integration: It would allow developers to include PDFium as a sub-project using add_subdirectory() or via package managers like vcpkg and conan more seamlessly.

  2. Cross-Platform Consistency: CMake provides a unified interface for generating project files for Visual Studio, Xcode, and other popular IDEs without requiring developers to learn gn.

  3. Wider Adoption: Reducing the barrier to entry for building PDFium would likely lead to more contributions and wider usage in non-Chromium C++ applications.

We are aware of several community-maintained CMake wrappers for PDFium, but having an officially supported version would ensure better stability, security updates, and alignment with the main codebase.

Are there any plans to implement CMake support in the near future? If the project is open to it, I would also be happy to discuss how the community might assist in contributing or testing a CMake-based build configuration.

Thank you for your time and for your continued work on this excellent library.

Best regards,


Lei Zhang

unread,
Apr 15, 2026, 9:38:26 PM (3 days ago) Apr 15
to 金金丁, pdfium
Instead of asking PDFium to maintain an additional build system that
PDFium itself does not use, have you considered using a GN to CMake
converter such as [1]?

[1] https://github.com/google/skia/blob/main/gn/gn_to_cmake.py
> --
> You received this message because you are subscribed to the Google Groups "pdfium" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/pdfium/7296e383-90e0-4d96-a14a-7e47adfc8fc5n%40googlegroups.com.

geisserml

unread,
Apr 16, 2026, 8:34:16 AM (3 days ago) Apr 16
to pdfium
Thanks for the pointer, but is [1] really applicable to pdfium? I tried
```
gn gen out/Default --ide=json
python3 gn/gn_to_cmake.py out/Default/project.json
```
but gn_to_cmake.py basically seems to freeze in GetObjectSourceDependencies and not finish?

However, I agree pdfium itself providing another build system is not feasible and does not make sense.
Though it might help if pdfium's current build system and what you can do with it were a bit more documented, like in pdfium's README, e.g. how to do a portable native build.

Lei Zhang

unread,
Apr 16, 2026, 12:47:13 PM (3 days ago) Apr 16
to geisserml, pdfium
On Thu, Apr 16, 2026 at 5:34 AM geisserml <geis...@gmail.com> wrote:
>
> Thanks for the pointer, but is [1] really applicable to pdfium? I tried
> ```
> gn gen out/Default --ide=json
> python3 gn/gn_to_cmake.py out/Default/project.json
> ```
> but gn_to_cmake.py basically seems to freeze in GetObjectSourceDependencies and not finish?

Thank you for trying it out. I was making a handwavy suggestion and
have never tried it. Maybe it works for Skia's build, but needs some
more adjustments for PDFium?

> Though it might help if pdfium's current build system and what you can do with it were a bit more documented, like in pdfium's README, e.g. how to do a portable native build.

Please file more bugs on the issue tracker. There's always room for improvement.
Reply all
Reply to author
Forward
0 new messages