In order to use wxWidgets, it should first be ported over to
Emscripten. You mention you don't really depend on wxWidgets to use,
but it looks like CMake has not been configured to agree, and it is
treating the presence of wxWidgets a mandatory package. Try editing
the CMake script to treat wxWidgets as optional so that it will
continue even though it is not found, or skip the search altogether
As for the g++ -> em++ substitution, unfortunately porting projects is
not easy as that, and it is not possible to just change the compiler
while keeping the input parameters the same. Some of the troubling
lines that catch attention are -I/usr/include/OpenEXR,
-I/usr/local/include and -fopenmp . Emscripten is a cross compiler, so
it should never be fed system include directories such as
/usr/include, since those contain headers that associate with native
compiled libraries. Also, there is no port of OpenMP to Emscripten, so
-fopenmp cannot be passed.
The typical workflow to porting large projects over to Emscripten are
to port each of the depended projects one at a time, to custom checked
out subdirectories, and then finally port the main project and adjust
its build system to refer to your own cross compiled versions of the
ported depended libraries. Some libraries are available already via
the Emscripten Ports system
although OpenEXR or wxWidgets have not been ported afaik.
Oh also, when targeting CMake-based projects to Emscripten, try
invoking cmake via "emcmake cmake path/to/CMakeLists.txt". What you're
doing with CMAKE_TOOLCHAIN_FILE is also fine, though emcmake can be a
bit shorter to type.
2018-01-30 0:17 GMT+02:00 Avner Moshkovitz <avner.moshkov...@gmail.com>:
> I'm trying to build the "hugin" package (https://launchpad.net/hugin) with
> The cmake command runs fine in native Linux, but the equivalent emscripten
> command returns errors.
> With g++ the following command finishes successfully (and following that I
> can build the executables with "make all")
> cmake ../
> With emscripten, the following command:
> cmake --trace-expand \
> ../ \
> 2>&1 | tee /tmp/tmp4.txt
> gives an error:
> CMake Error at
> Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES
> I actually need to build a portion of the hugin package that does not rquire
> wxwidgets, but I did not find a way to do that.
> I tried substituting em++ for g++ in the build command:
> /usr/bin/g++ \
> -DGLEW_STATIC -DHUGIN_HSI
> -I/home/avnerm/Downloads/hugin-2017.0.0/mybuild/src \
> -I/home/avnerm/Downloads/hugin-2017.0.0/src/hugin_base \
> -I/home/avnerm/Downloads/hugin-2017.0.0/src/celeste \
> -I/home/avnerm/Downloads/hugin-2017.0.0/mybuild/src/celeste \
> -I/home/avnerm/Downloads/hugin-2017.0.0/src \
> -I/home/avnerm/anaconda3/include \
> -I/usr/include/OpenEXR \
> -I/usr/local/include \
> -I/home/avnerm/anaconda3/include/python3.6m \
> -O2 -g -DNDEBUG -fopenmp -pthread -std=gnu++11 \
> -c /home/avnerm/Downloads/hugin-2017.0.0/src/tools/pano_trafo.cpp \
> -o CMakeFiles/pano_trafo.dir/pano_trafo.cpp.o
> which gives an error:
> fatal error: 'lcms2.h' file not found
> (the file is located in /usr/include/ and I cannot add the it to the include
> path according to this)
> What can I do to fix the build error?
> 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 emscripten-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.