Failed to build occt with Enscripten due to cannot find freetype

Hi all,
Can anybody help to build occt with Enscripten?

I tried to build occt with enscripten:
1. Download occt source code, cmake, enscripten, etc.
2. Open cmake, set the source code path to occt;
3. Set the make program to E:/Github/emsdk/mingw/4.6.2_32bit/mingw32-make.exe;
4. Set the tool chain file to E:/Github/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake;
5. Click configuration, error shows up:
CMake Error at CMakeLists.txt:746 (message):
Could not find headers of used third-party products:
3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build
3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2
6. Freetype is optional to occt, so I tried to skip it, remove the lines in CmakeLists.txt:
if (USE_FREETYPE)
message (STATUS "Info: Freetype is used by OCCT")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE")
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2")
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build")
OCCT_CHECK_AND_UNSET ("INSTALL_FREETYPE")
endif()
7. Configuration and generate source code, try to build, get error, see occerror.png:
src\Font\Font_FontMgr.cxx: fatal error: 'ft2build.h' file not found

Then I also tried to build freetype from source code, and get stuck, see failed2buildft.png:
BROTLIDEC_INCLUDE_DIRS-NOTFOUND
BROTLIDEC_LIBRARIES-NOTFOUND
BZIP2_INCLUDE_DIR-NOTFOUND
BZIP2_LIBRARY_DEBUG-NOTFOUND
BZIP2_LIBRARY_RELEASE-NOTFOUND

Thanks,
Andy

Kirill Gavrilov's picture

FreeType is not optional for OCCT 7.5.0 - you cannot just remove lines from CMake as C++ source code still relies on this dependency. You will need building FreeType library using Emscripten (also using CMake with help of Emscripten wrappers).
It is optional within development snapshot of OCCT 7.6.0dev (master branch in git), though, where you may set USE_FREETYPE to OFF within CMake configure stage.