Hello,

On Friday, 11 February 2022 at 20:11:52 UTC+1 ... wrote:

>
> Can you say what you mean by  "emcmake ignores or forgets all environment 
> variables set within the shell,"?    emcmake should behave identically to 
> cmake itself.. its really just a very small wrapper around cmake.  If you 
> notice any differences between the way cmake honors environment variables 
> and the way emcmake does please open bug on the issue tracker.
>

For one, emcmake cmake couldn't find make, even though the command line I 
start emscripten from has no such difficulties: I can call cmake and make 
just fine. For emscripten I had to supply the full path to make it work at 
all. Also, I failed to use environment variables as a means to specify 
paths in subsequent commands; I had to specify each path literally, and 
directly within each emscripten command. I am not quite sure though of the 
exact way how emscripten accesses environment variables, how they are 
(supposed to be) passed on to cmake, the CMakeLists file and then make. I 
had hoped that emcmake cmake could take advantage of all the environment 
variables visible to emscripten, but apparently it doesn't work that way.
 

>
>
>> I should point out that I haven't worked with *ix and makefiles for 30 
>> years, and although I got plenty of advice from colleagues, it's still 
>> possible I did not execute the build and install commands as expected by 
>> emscripten. If someone could post the exact commands needed to build and 
>> install a package with emscripten using the ubuntu bash shell (inside a 
>> Docker environment), that could be very helpful - maybe that would help me 
>> create the missing .cmake files?
>>
>
> Unfortunately there are many ways to build and consume libraries (and 
> header files) so there is no one answer (e.g. pkg-config, autoconf, cmake, 
> all do things differently).   One simple option is to create your own 
> install directory (like a mini sysroot) where you install all your 
> libraries and headers (via `make install` or some other method) and then 
> you can pass `-I/path/to/my/headers` and `-L/path/to/my/libraries` to 
> emcc.   Alternatively, you can install directly into the emscripten sysroot 
> which lives (by default) in `<emscripten_dir>/cache/sysroot`, in which case 
> they should be available without any extra `-I` or `-L` arguments.  Another 
> option is to use something like `vcpkg` which has (at least some) support 
> for emscripten already: https://vcpkg.io/en/index.html.    For what its 
> worth, I am hoping to simplify, improve and document the situation 
> regarding installing and consuming libraries.
>

While I'm not finished yet, I could at least resolve some of the trouble: 
it turned out that the OpenCascade documentation incorrectly points to old 
versions of FreeType, which either can't be built with cmake, or don't have 
(and don't build) the freetype-config.cmake file. Once i used a newer 
version I could build everything with cmake. 

I'm still not sure why I couldn't build Freetype without it though: it 
should be possible by supplying the correct paths, but that never worked. 
However, it doesn't work with just cmake either, so apparently that's not 
related to emscripten.
Thanks for the headsup. Maybe that information will come in handy later.

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/307e5494-ab94-40a3-a8dd-cf3bd81dbb60n%40googlegroups.com.

Reply via email to