This resulted in the same error, but made me realise that the path to wx-config itself needs to be specified. Indeed the option -DwxWidgets_CONFIG_EXECUTABLE=/home/maxim/opt/wxWidgets-3.0.4/bin/wx-config made the configuration step succeed.
However now 'make' fails with:
/home/maxim/Downloads/hugin-2018.0.0/mybuild/src/hugin1/base_wx/libhuginbasewx.so.0.0: undefined reference to `wxLogStream::wxLogStream(std::__1::basic_ostream<char, std::__1::char_traits<char> >*)'
/home/maxim/Downloads/hugin-2018.0.0/mybuild/src/hugin1/base_wx/libhuginbasewx.so.0.0: undefined reference to `operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, wxScopedCharTypeBuffer<char> const&)'
/home/maxim/Downloads/hugin-2018.0.0/mybuild/src/hugin1/base_wx/libhuginbasewx.so.0.0: undefined reference to `operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, wxString const&)'
This comes from the invocation of:
/usr/bin/c++ -pthread -g -DNDEBUG CMakeFiles/hugin_stitch_project.dir/hugin_stitch_project.cpp.o -o hugin_stitch_project -L/usr/local/lib -L/home/maxim/opt/wxWidgets-3.0.4/lib -L/home/maxim/Downloads/hugin-2018.0.0/mybuild/src/hugin1/base_wx -L/home/maxim/Downloads/hugin-2018.0.0/mybuild/src/hugin_base -L/usr/X11R6/lib -Wl,-rpath,/usr/local/lib:/home/maxim/opt/wxWidgets-3.0.4/lib:/home/maxim/Downloads/hugin-2018.0.0/mybuild/src/hugin1/base_wx:/home/maxim/Downloads/hugin-2018.0.0/mybuild/src/hugin_base: -lhuginbasewx -lhuginbase -lpano13 ../../foreign/levmar/libhuginlevmar.a -lGLEW -lboost_filesystem-mt -lboost_system-mt -lfftw3 -lvigraimpex -lImath -lIlmImf -lIex -lHalf -lIlmThread -lz -ljpeg -ltiff -lpng -lz -lz -lexiv2 -llcms2 -lvigraimpex -lImath -lIlmImf -lIex -lHalf -lIlmThread -lz -ljpeg -ltiff -lpng -lz -lz -lexiv2 -L/home/maxim/opt/wxWidgets-3.0.4/lib -pthread -lwx_baseu-3.0 -lwx_gtk2u_core-3.0 -lwx_gtk2u_aui-3.0 -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_baseu_xml-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_gl-3.0 -lwx_baseu_net-3.0 -lwx_gtk2u_qa-3.0 -lX11 -lGL -lGLU -lsqlite3 -lpano13 -lGLEW -lboost_filesystem-mt -lboost_system-mt -lvigraimpex -ljpeg -lpng -ltiff -lexiv2 -llcms2 -Wl,-rpath-link,/usr/X11R6/lib:/usr/local/lib
The missing symbol appears to actually be defined, but for some reason is not picked up by the linker:
00094790 T _ZN11wxLogStream9DoLogTextERK8wxString
00094e80 T _ZN11wxLogStreamC1EPSo
00094710 T _ZN11wxLogStreamC2EPSo
0009a610 t _ZN11wxLogStreamD0Ev
0009a640 t _ZN11wxLogStreamD1Ev
004517b0 W _ZTI11wxLogStream
002ec04d W _ZTS11wxLogStream
004515e0 W _ZTV11wxLogStream
Thanks!