pthom / hello_imgui

Hello, Dear ImGui: unleash your creativity in app development and prototyping
https://pthom.github.io/hello_imgui
MIT License
678 stars 103 forks source link

offline build #91

Closed rexainn closed 9 months ago

rexainn commented 10 months ago

How can I change the CMakeLists or any other file to make sure "we don't download dlg from the github"?

I can download the dlg on my own laptop and pass it on the server, but I can't download from "https://github.com/nyorain/dlg.git/" while building hello_imgui.

image

pthom commented 10 months ago

Try to run git submodule update --init manually instead of relying on CMake to do it for you. It seems that cmake fails on https in your case.

Keep me informed, please

rexainn commented 10 months ago

The problem is that git submodule update --init not works, because my server can't access github. So I need to manually install on my laptop and pass it on the server. But I don't know where to store dlg in the hello_imgui.

rexainn commented 10 months ago

And dlg is the dependency of freetype, it's not in the git submodule

pthom commented 10 months ago

git submodule update --init does not work?

That is the first important issue. Can you clone a anything from github? How did you clone the repository in the first place? May be you are facing a temporary issue with github. In the meantime -DHELLOIMGUI_USE_FREETYPE=OFF

pthom commented 10 months ago

... but you will likely fail on the next dependency: glfw

pthom commented 10 months ago

Otherwise, for a build without connection, first install the dependencies with vcpkg (you will need to have installed freetype and glfw)

rexainn commented 10 months ago

nope...in china, the github need vpn to access, but my server can't set a vpn. So I download everything needed on my own laptop, and pass it on the server through sftp.

So I want to know how can I make all the dependencies from the local dir, and not download again from the github on the server.

rexainn commented 10 months ago

Ok, so I need to build entirely freetype and glfw first, then build imgui_bundle, then it will not download them again.

rexainn commented 10 months ago

I've built freetype successfully, but when I run pip install -v . for imgui-bundle, it still try to download and build freetype from github.

image

Success on freetype before:

 sudo make install
[sudo] password for gdp:
[100%] Built target freetype
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/include/freetype2
-- Installing: /usr/local/include/freetype2/ft2build.h
-- Installing: /usr/local/include/freetype2/freetype
-- Installing: /usr/local/include/freetype2/freetype/fterrors.h
-- Installing: /usr/local/include/freetype2/freetype/tttables.h
-- Installing: /usr/local/include/freetype2/freetype/ftgzip.h
-- Installing: /usr/local/include/freetype2/freetype/ftoutln.h
-- Installing: /usr/local/include/freetype2/freetype/ftotval.h
-- Installing: /usr/local/include/freetype2/freetype/otsvg.h
-- Installing: /usr/local/include/freetype2/freetype/ftgxval.h
-- Installing: /usr/local/include/freetype2/freetype/ftadvanc.h
-- Installing: /usr/local/include/freetype2/freetype/ftlzw.h
-- Installing: /usr/local/include/freetype2/freetype/fterrdef.h
-- Installing: /usr/local/include/freetype2/freetype/ftstroke.h
-- Installing: /usr/local/include/freetype2/freetype/ftsystem.h
-- Installing: /usr/local/include/freetype2/freetype/ftcolor.h
-- Installing: /usr/local/include/freetype2/freetype/t1tables.h
-- Installing: /usr/local/include/freetype2/freetype/ftmm.h
-- Installing: /usr/local/include/freetype2/freetype/ftbitmap.h
-- Installing: /usr/local/include/freetype2/freetype/freetype.h
-- Installing: /usr/local/include/freetype2/freetype/fttrigon.h
-- Installing: /usr/local/include/freetype2/freetype/ftlist.h
-- Installing: /usr/local/include/freetype2/freetype/config
-- Installing: /usr/local/include/freetype2/freetype/config/public-macros.h
-- Installing: /usr/local/include/freetype2/freetype/config/mac-support.h
-- Installing: /usr/local/include/freetype2/freetype/config/ftheader.h
-- Installing: /usr/local/include/freetype2/freetype/config/ftstdlib.h
-- Installing: /usr/local/include/freetype2/freetype/config/integer-types.h
-- Installing: /usr/local/include/freetype2/freetype/config/ftmodule.h
-- Installing: /usr/local/include/freetype2/freetype/ftsizes.h
-- Installing: /usr/local/include/freetype2/freetype/ftfntfmt.h
-- Installing: /usr/local/include/freetype2/freetype/ftbdf.h
-- Installing: /usr/local/include/freetype2/freetype/ftpfr.h
-- Installing: /usr/local/include/freetype2/freetype/ftsynth.h
-- Installing: /usr/local/include/freetype2/freetype/ftbzip2.h
-- Installing: /usr/local/include/freetype2/freetype/ftparams.h
-- Installing: /usr/local/include/freetype2/freetype/ftmac.h
-- Installing: /usr/local/include/freetype2/freetype/ftrender.h
-- Installing: /usr/local/include/freetype2/freetype/ftchapters.h
-- Installing: /usr/local/include/freetype2/freetype/ftmodapi.h
-- Installing: /usr/local/include/freetype2/freetype/tttags.h
-- Installing: /usr/local/include/freetype2/freetype/ftcid.h
-- Installing: /usr/local/include/freetype2/freetype/ftlogging.h
-- Installing: /usr/local/include/freetype2/freetype/ftwinfnt.h
-- Installing: /usr/local/include/freetype2/freetype/ftgasp.h
-- Installing: /usr/local/include/freetype2/freetype/ftmoderr.h
-- Installing: /usr/local/include/freetype2/freetype/ftcache.h
-- Installing: /usr/local/include/freetype2/freetype/ftlcdfil.h
-- Installing: /usr/local/include/freetype2/freetype/fttypes.h
-- Installing: /usr/local/include/freetype2/freetype/ftglyph.h
-- Installing: /usr/local/include/freetype2/freetype/ttnameid.h
-- Installing: /usr/local/include/freetype2/freetype/ftincrem.h
-- Installing: /usr/local/include/freetype2/freetype/ftimage.h
-- Installing: /usr/local/include/freetype2/freetype/ftbbox.h
-- Installing: /usr/local/include/freetype2/freetype/ftdriver.h
-- Installing: /usr/local/include/freetype2/freetype/ftsnames.h
-- Installing: /usr/local/include/freetype2/freetype/config/ftconfig.h
-- Installing: /usr/local/include/freetype2/freetype/config/ftoption.h
-- Installing: /usr/local/lib/pkgconfig/freetype2.pc
-- Installing: /usr/local/lib/libfreetype.a
-- Installing: /usr/local/lib/cmake/freetype/freetype-config.cmake
-- Installing: /usr/local/lib/cmake/freetype/freetype-config-noconfig.cmake
-- Installing: /usr/local/lib/cmake/freetype/freetype-config-version.cmake
pthom commented 10 months ago

Because it needs a newer version of freetype than the one available with apt-get.

Use vcpkg, or add submodule for freetype and glfw + add_subdirectory for them before adding imgui_bundle

rexainn commented 10 months ago

It's the newest version from official: https://github.com/freetype/freetype, I built it from source.

I'm sorry but how can I add submodule + add_subdirectory for imgui_bundle? I think this is the point. I've built the freetype but not in a imgui_bundle known way.

pthom commented 10 months ago

I just understood you are trying to build a pip package, which you did not mention clearly.

There is no easy way to bypass the download for pip building now.

My advice: build a wheel on a machine connected to the internet and use this wheel on your server.

pthom commented 10 months ago

I added some doc for vcpkg + offline usage:

https://github.com/pthom/imgui_bundle/blob/548e1e021b3e0c87e82c5f4dd0d9d1e73eaa4b45/CMakeLists.txt#L225-L253