DiscussionsIssue archiveOCCT:Configuration

Archived issue #0033339

Configuration - Implicit dependency on libfontconfig introduced by Font_FontMgr

Open CASCADEOCCT:Configurationnew2 public notes

Search issues

Description

In case of Linux Font_FontMgr.cxx includes <fontconfig/fontconfig.h> at line 92 supposing that it is always installed to the system.
However, this one depends on FreeType library that could be compiled and distributed as a local 3rdparty (see https://dev.opencascade.org/doc/overview/html/build_upgrade_building_3rdparty.html#dev_guides__building_3rdparty_linux_2_2).

If user installs libfontconfig using apt-get it automatically pulls its dependencies including FreeType making local 3rdparty practically useless.
Even if OCCT does not use libfontconfig's functionality related to FreeType explicitly, it will always depend on two versions of FreeType, both on system and locally deployed one.

Public activity

2 archived notes

Participants are labeled by their role within this record.

01Commenter 1
After building occt you only depend on shared libraries.
So, including file into cxx can't impact on after build behavior.

Related community issue:
https://dev.opencascade.org/content/using-custom-fontconfig

For choose which FreeType package you want to use into your compilation process you need to configure cmake or genproj file.
Dear Commenter 2, can you clarify what are you want with current ticket?
We have a few ways to resolve problem:
 - Add CMake option to find libfontconfig and append include directories
 - Try to find fontconfig within 3rdparty and define special compiler definition
 - Copy and adaptive general our own fontconfig for each linux distributions
 - Create our own FreeType 3rd party deliveries with existing configuration
02Author
Commenter 3
After building occt you only depend on shared libraries.
So, including file into cxx can't impact on after build behavior.

Correct. However, the impact is that it is linked to system library, thus implicitly to system FreeType library which version could be different comparing to the one used from 3rdparty directory explicitly.

Related community issue:
https://dev.opencascade.org/content/using-custom-fontconfig

Thanks for this link.

We have a few ways to resolve problem:
 - Add CMake option to find libfontconfig and append include directories
 - Try to find fontconfig within 3rdparty and define special compiler definition
 - Copy and adaptive general our own fontconfig for each linux distributions
 - Create our own FreeType 3rd party deliveries with existing configuration

IMHO, in case of custom FreeType library, it would be helpful to have fontconfig as an another 3rdparty library (for Linux) linked against that same custom FreeType.
Probably, is it also helpful to add USE_FONTCONFIG CMake variable to allow user to choose which version of fontconfig library should be used.

Here we should have an another 3rdparty dependency which user should have possibility to compile manually.
Another question is how to set necessary environment so fontconfig could find exact version of freetype installed to custom location, if we could do so at all.
Anyway, we should update occt documentation regarding this point to provide excessive info.