WebGL sample compliation

Hi

Im trying to build. WebGL sample.

I managed to build FreeType and OCCT libraries using emsdk, but I cant build sample itself.

While configuring this sample in Cmake-gui I have error message. (both windows ans linux)

CMake Error at CMakeLists.txt:33 (find_package):
Could not find a package configuration file provided by "freetype" with any
of the following names:

freetypeConfig.cmake
freetype-config.cmake

Add the installation prefix of "freetype" to CMAKE_PREFIX_PATH or set
"freetype_DIR" to a directory containing one of the above files. If
"freetype" provides a separate development package or SDK, be sure it has
been installed.

 

Setting freetype_DIR to freetype installation path does not work. Adding installation path to CMAKE_PREFIX_PATH has no effect. Simply I don't have freetypeConfig.cmake freetype-config.cmake files there

Any sugestions?

Regards

Adam

Kirill Gavrilov's picture

If you've built FreeType without using CMake, then you have to extend CMake scripts for WebGL sample with FreeType search paths (similar to "adm/cmake/freetype.cmake" used for building OCCT itself).
Alterantively, you can re-build FreeType using CMake - in this case FreeType installation folder will have "lib/cmake/freetype/freetype-config.cmake" configuration file, so that freetype_DIR in WebGL sample should point to this "lib/cmake/freetype" folder.

Adam Wnek's picture

Thank you for reply,

Actually I have edited CMakeLists.txt in webgl sample to fit my local paths where emscirpten complied libraries have been installed. I just finished and it works. :)  Now I have some basic understanding how it works, and I can try prepare my own small WebAssembly application

Regards

Adam

Andy Du's picture

Hi Kirill,
My case is "If you've built FreeType without using CMake, then you have to extend CMake scripts for WebGL sample with FreeType search paths (similar to "adm/cmake/freetype.cmake" used for building OCCT itself).",
I tried to add the free path into CmakeLists.txt of WebGL sample, but not success.
The line I added is, I use the absolute path:
set(freetype "C:/OpenCASCADE-7.5.0-vc14-64/opencascade-7.5.0/adm/cmake/freetype.cmake")
Do you have any suggestions?

Thanks,
Andy

Paul BIGEON's picture

Hi

Another issue regarding the compilation that I've had, using :

OCCT 7.6.0 dev
Emscripten 1.39.7 ( MinGW 4.6.2-32bit )

Compiling seems ok, but when it comes to linking :

Anyone found a way to get through this one ?

Thanks,

Paul

Kirill Gavrilov's picture

Is there some reason for using an old Emscripten 1.x branch instead of Emscripten 2.x (opened since August '2020)?
And where MinGW 4.6.2-32bit comes from? I see only mingw-7.1.0-64bit in Emscripten SDK.

Don't recall "unknown suffix" error, so cannot help here...

Paul BIGEON's picture

Hi and thank you for your reply,

I'm using my already existing Emscripten environment based on the Qt for WebAssembly requirements.
This might be the issue now that you point that out ...

I'll give it a try with updated Emscripten and MinGW.

Regards,

Paul

Paul BIGEON's picture

Hi and thanks for your prompt reply,

I did use the Qt 5.15.2 for WebAssembly tutorial and the recommended version for Emscripten is 1.39.7 ...

I Installed and activated Emscripten 2.0.23 and mingw-7.1.0-64bit as you indicated, and now the process goes a bit further, yet it splashes this new error :

A bit of search on the github issues indicates that it could be linked to newest version of Emscripten not handling things the same as they used to in previous releases.

I'll have a go at different versions and see which one can fit then ...

Regards,

Paul

Kirill Gavrilov's picture

My guess is that you are trying now to build the Sample without clean rebuild of OCCT libraries...

I haven't updated Emscripten for a while, so my currently installed version is older - it is 2.0.11. But I hope that they haven't broken something with newer updates (apart from useless deprecation that can be seen in your log)...

Paul BIGEON's picture

It worked with 2.0.11, I did not rebuilt OCCT ...

Well the sample is built and linked correctly now.

Thanks for your help as always !

Regards

Paul