# OpenCV 4.12.0 CMake Shows freetype2: NO / harfbuzz: NO (vcpkg, VS2022, Windows 11)

**URL:** <https://forum.opencv.org/t/opencv-4-12-0-cmake-shows-freetype2-no-harfbuzz-no-vcpkg-vs2022-windows-11/23959>\
**Category:** C++\
**Tags:** windows, build, freetype, vcpkg\
**Created:** [September 6, 2025, 6:29am UTC](https://forum.opencv.org/t/opencv-4-12-0-cmake-shows-freetype2-no-harfbuzz-no-vcpkg-vs2022-windows-11/23959 "2025-09-06T06:29:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hiroki\_Okamoto](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/hiroki_okamoto/32/13693_2.png) [@Hiroki\_Okamoto](https://forum.opencv.org/u/Hiroki_Okamoto)\
**Post date:** [September 6, 2025, 6:29am UTC](https://forum.opencv.org/t/opencv-4-12-0-cmake-shows-freetype2-no-harfbuzz-no-vcpkg-vs2022-windows-11/23959/1 "2025-09-06T06:29:55Z")

</div>

OS: Windows 11  
OpenCV version: 4.12.0  
CMake GUI: 4.0.3  
Generator: Visual Studio 17 2022 (x64)  
Compiler: MSVC (Visual Studio 2022)  
Architecture: x64  
(Build type: (e.g. Release + Debug) – can add if needed)

Goal: Enable FreeType (and optionally HarfBuzz) support.  
Problem: CMake keeps showing: – freetype2: NO – harfbuzz: NO even after enabling WITH\_FREETYPE=ON (and having opencv\_contrib modules path set).

What I did:

1. Installed libraries via vcpkg (freetype, harfbuzz, etc.).  
(Commands used, for example – can add exact ones if helpful: vcpkg install freetype:x64-windows harfbuzz:x64-windows )

2. Before the first configure I set:

3. Ran Configure.

4. Set:

5. Re-configured, but the summary still shows: – freetype2: NO – harfbuzz: NO

Tried manually setting (no effect):

- PKG\_CONFIG\_EXECUTABLE

- PKG\_CONFIG\_PATH

- FREETYPE\_INCLUDE\_DIR\_ft2build

- FREETYPE\_INCLUDE\_DIR\_freetype2

- HARFBUZZ\_INCLUDE\_DIRS (Also tried clearing cache and re-configuring from a fresh build directory.)

Questions:

1. What is the correct way to make OpenCV detect FreeType (and HarfBuzz) with vcpkg on Windows (VS2022)?

2. Do I need to set additional variables such as FREETYPE\_LIBRARY / HARFBUZZ\_LIBRARIES manually, or should find\_package() work automatically with the vcpkg toolchain file?

3. Is pkg-config actually required for this detection on Windows in OpenCV 4.12.0?

4. Does the order of enabling WITH\_FREETYPE or clearing the CMake cache matter?

5. Is there any known issue with OpenCV 4.12.0 + vcpkg regarding freetype/harfbuzz detection?

Can provide if needed:

- Full CMake output (config + generation)

- Relevant excerpts from CMakeCache.txt (FREETYPE / HARFBUZZ entries)

- Exact vcpkg triplet (currently assuming x64-windows)

- vcpkg list output

- Command-line (non-GUI) CMake attempt

Any guidance appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![EntityParrot](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/entityparrot/32/14254_2.png) [@EntityParrot](https://forum.opencv.org/u/EntityParrot)\
**Post date:** [May 9, 2026, 1:06am UTC](https://forum.opencv.org/t/opencv-4-12-0-cmake-shows-freetype2-no-harfbuzz-no-vcpkg-vs2022-windows-11/23959/2 "2026-05-09T01:06:32Z")

</div>

I’m not sure if you are still struggling with this issue, but I recently encountered a situation almost identical to yours. After a quick inspection of the CMake files, I discovered that it appears no attempt was being made to locate the PkgConfig module on the Windows platform (with MSVC?); consequently, it was unable to find FreeType and HarfBuzz via PkgConfig. By inserting the line `find_package(PkgConfig QUIET)` just before loading those two modules, I was able to get CMake to successfully locate the corresponding libraries. While this solution is admittedly rather unprofessional, it at least helped me resolve my build issues. I hope this helps you as well.

A screenshot illustrating the solution is provided below.

> **Summary**
>
> ![image](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/8/8c520f54a3b599ffb4d9837dcb37a9c3f0974517.png)
