matusnovak / finegui

The FineGui is a standalone library that provides a simple utf8 enabled graphical user interface with a linear layout system similar to Android GUI development. The library also offers experimental XML parser that generates GUI structure for you.
http://matusnovak.github.io/finegui/
MIT License
11 stars 3 forks source link

zlib CMake missing? #1

Open RobLoach opened 5 years ago

RobLoach commented 5 years ago

After running the following, the error occurs...

git submodule update --init
mkdir build
cd build
cmake ..
Scanning dependencies of target ZLIB
[  1%] Creating directories for 'ZLIB'
[  2%] No download step for 'ZLIB'
[  4%] No patch step for 'ZLIB'
[  5%] No update step for 'ZLIB'
[  7%] Performing configure step for 'ZLIB'
CMake Error: The source directory "/home/rob/Documents/finegui/libs/finegraphics/libs/zlib" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
CMakeFiles/ZLIB.dir/build.make:106: recipe for target 'ZLIB-prefix/src/ZLIB-stamp/ZLIB-configure' failed
make[5]: *** [ZLIB-prefix/src/ZLIB-stamp/ZLIB-configure] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ZLIB.dir/all' failed
make[4]: *** [CMakeFiles/ZLIB.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make[3]: *** [all] Error 2
CMakeFiles/FINEGRAPHICS.dir/build.make:111: recipe for target 'FINEGRAPHICS-prefix/src/FINEGRAPHICS-stamp/FINEGRAPHICS-build' failed
make[2]: *** [FINEGRAPHICS-prefix/src/FINEGRAPHICS-stamp/FINEGRAPHICS-build] Error 2
CMakeFiles/Makefile2:141: recipe for target 'CMakeFiles/FINEGRAPHICS.dir/all' failed
make[1]: *** [CMakeFiles/FINEGRAPHICS.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
matusnovak commented 5 years ago

Hi @RobLoach

You may have forgot to recursively pull all git submodules, try the following:

git submodule update --init --recursive

Note that compiling dependencies is only needed when building with examples. If you need to build the library only, run cmake with -DBUILD_EXAMPLES:BOOL=OFF.

Let me know if that helps.

RobLoach commented 5 years ago

That got a bit further!

[ 87%] Linking CXX executable example_nanovg_backend_all
FREETYPE2-prefix/src/FREETYPE2-build/libfreetype.a(autofit.c.o): In function `af_face_globals_new':
autofit.c:(.text+0x4747): undefined reference to `hb_ft_font_create'
autofit.c:(.text+0x4757): undefined reference to `hb_buffer_create'
FREETYPE2-prefix/src/FREETYPE2-build/libfreetype.a(autofit.c.o): In function `af_face_globals_free':
autofit.c:(.text+0x48bf): undefined reference to `hb_font_destroy'
autofit.c:(.text+0x48cf): undefined reference to `hb_buffer_destroy'
FREETYPE2-prefix/src/FREETYPE2-build/libfreetype.a(autofit.c.o): In function `af_shaper_get_coverage':
autofit.c:(.text+0xf68a): undefined reference to `hb_font_get_face'
autofit.c:(.text+0xf6eb): undefined reference to `hb_ot_tags_from_script'
autofit.c:(.text+0xf74b): undefined reference to `hb_set_create'
autofit.c:(.text+0xf777): undefined reference to `hb_ot_layout_collect_lookups'
autofit.c:(.text+0xf783): undefined reference to `hb_set_is_empty'
autofit.c:(.text+0xf790): undefined reference to `hb_set_create'
autofit.c:(.text+0xf7c9): undefined reference to `hb_ot_layout_lookup_collect_glyphs'
autofit.c:(.text+0xf7e0): undefined reference to `hb_set_next'
autofit.c:(.text+0xf7e9): undefined reference to `hb_set_create'
autofit.c:(.text+0xf815): undefined reference to `hb_ot_layout_collect_lookups'
autofit.c:(.text+0xf81a): undefined reference to `hb_set_create'
autofit.c:(.text+0xf853): undefined reference to `hb_ot_layout_lookup_collect_glyphs'
autofit.c:(.text+0xf86a): undefined reference to `hb_set_next'
autofit.c:(.text+0xf98d): undefined reference to `hb_ot_layout_lookup_would_substitute'
autofit.c:(.text+0xf9aa): undefined reference to `hb_set_next'
autofit.c:(.text+0xf9ff): undefined reference to `hb_set_subtract'
autofit.c:(.text+0xfa6c): undefined reference to `hb_set_next'
autofit.c:(.text+0xfa85): undefined reference to `hb_set_destroy'
autofit.c:(.text+0xfa91): undefined reference to `hb_set_destroy'
autofit.c:(.text+0xfa9d): undefined reference to `hb_set_destroy'
autofit.c:(.text+0xfaa9): undefined reference to `hb_set_destroy'
FREETYPE2-prefix/src/FREETYPE2-build/libfreetype.a(autofit.c.o): In function `af_shaper_buf_create':
autofit.c:(.text+0xfad5): undefined reference to `hb_buffer_create'
FREETYPE2-prefix/src/FREETYPE2-build/libfreetype.a(autofit.c.o): In function `af_shaper_buf_destroy':
autofit.c:(.text+0xfaf3): undefined reference to `hb_buffer_destroy'
FREETYPE2-prefix/src/FREETYPE2-build/libfreetype.a(autofit.c.o): In function `af_shaper_get_cluster':
autofit.c:(.text+0xfb98): undefined reference to `hb_font_set_scale'
autofit.c:(.text+0xfc6e): undefined reference to `hb_buffer_clear_contents'
autofit.c:(.text+0xfc8c): undefined reference to `hb_buffer_add_utf8'
autofit.c:(.text+0xfc98): undefined reference to `hb_buffer_guess_segment_properties'
autofit.c:(.text+0xfcb7): undefined reference to `hb_shape'
autofit.c:(.text+0xfcde): undefined reference to `hb_buffer_clear_contents'
autofit.c:(.text+0xfcfc): undefined reference to `hb_buffer_add_utf8'
autofit.c:(.text+0xfd08): undefined reference to `hb_buffer_guess_segment_properties'
autofit.c:(.text+0xfd22): undefined reference to `hb_shape'
autofit.c:(.text+0xfd35): undefined reference to `hb_buffer_get_glyph_infos'
autofit.c:(.text+0xfd4c): undefined reference to `hb_buffer_get_glyph_infos'
autofit.c:(.text+0xfdc4): undefined reference to `hb_buffer_clear_contents'
autofit.c:(.text+0xfdd0): undefined reference to `hb_buffer_get_length'
FREETYPE2-prefix/src/FREETYPE2-build/libfreetype.a(autofit.c.o): In function `af_shaper_get_elem':
autofit.c:(.text+0xfe3a): undefined reference to `hb_buffer_get_glyph_infos'
autofit.c:(.text+0xfe51): undefined reference to `hb_buffer_get_glyph_positions'
collect2: error: ld returned 1 exit status
CMakeFiles/example_nanovg_backend_all.dir/build.make:100: recipe for target 'example_nanovg_backend_all' failed
make[2]: *** [example_nanovg_backend_all] Error 1
CMakeFiles/Makefile2:403: recipe for target 'CMakeFiles/example_nanovg_backend_all.dir/all' failed
make[1]: *** [CMakeFiles/example_nanovg_backend_all.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

Would like to try building the examples.

matusnovak commented 5 years ago

Ahhhh, CMake recognised your OS has HarfBuzz installed, but is missing when linking. FreeType automatically looks for it and adds it.

You can fix it by adding -DWITH_HarfBuzz=OFF to FreeType cmake args.

Change this line https://github.com/matusnovak/finegui/blob/master/ExternalLibs.cmake#L85 to the following:

CMAKE_ARGS -DWITH_HarfBuzz=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true

I am currently cleaning up the files, adding some more examples, and fixing some issues such as this one. Will be pushing some changes in a day or two, so these kind of problems won't happen.