On one of our Windows build workers we have a FontConfig installation as follows:
I’m in the process of porting our application from VTK 8 to 9.
During building of VTK itself, this installation is found fine, and the vtkRenderingFreeTypeFontConfig module which we want is built and linked against this FontConfig installation (confirmed with depends.exe on vtkRenderingFreeTypeFontConfig-9.2.dll).
However, during the CMake configuration of our own application, we’re now getting:
. . . -- Found OpenGL: opengl32 found components: OpenGL -- Configuring incomplete, errors occurred! See also "C:/Users/Elvis/Dev/buildbot_worker/b-insight-win/build/build/CMakeFiles/CMakeOutput.log". See also "C:/Users/Elvis/Dev/buildbot_worker/b-insight-win/build/build/CMakeFiles/CMakeError.log". CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message): Could NOT find FontConfig (missing: FONTCONFIG_LIBRARY FONTCONFIG_INCLUDE_DIR) Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE) C:/Users/Elvis/Dev/VTK-9.2.6-inst/lib/cmake/vtk-9.2/FindFontConfig.cmake:28 (find_package_handle_standard_args) C:/Users/Elvis/Dev/VTK-9.2.6-inst/lib/cmake/vtk-9.2/VTK-vtk-module-find-packages.cmake:303 (find_package) C:/Users/Elvis/Dev/VTK-9.2.6-inst/lib/cmake/vtk-9.2/vtk-config.cmake:152 (include) CMakeLists.txt:36 (find_package)
This used to work fine with VTK 8. I don’t believe VTK would try to find FontConfig during configuration of the application back in VTK 8 times - I can’t see how it could have, because we were not passing any special CMake or environment variables, so it wouldn’t know that FontConfig is under
So there seems to possibly be some difference with the introduction of the new module system, and VTK is now looking for FontConfig even during configuration of a VTK-using application?
I looked at VTK’s CMake/FindFontConfig.cmake, and it’s doing (excerpt):
find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h) find_library(FONTCONFIG_LIBRARY NAMES fontconfig) # handle the QUIETLY and REQUIRED arguments and set FONTCONFIG_FOUND to TRUE if # all listed variables are TRUE include(FindPackageHandleStandardArgs) find_package_handle_standard_args(FontConfig DEFAULT_MSG FONTCONFIG_LIBRARY FONTCONFIG_INCLUDE_DIR)
So following CMake docs for find_path and find_library, I tried prepending
C:\Users\Elvis\Dev\libfontconfig_2.13.1-4_msvc16\bin\x64 to the PATH environment variable and passing
-DCMAKE_INCLUDE_PATH=C:/Users/Elvis/Dev/libfontconfig_2.13.1-4_msvc16, but the error is the same.
@ben.boeckel Do you have some idea what might be going on?