Comments (4)
I've realized that the simplest way is just to disable freetype in imgui, set HELLOIMGUI_USE_FREETYPE to OFF
.
cmake_minimum_required(VERSION 3.12)
project(generic_gui_tester)
set(CMAKE_CXX_STANDARD 17)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build everything as dlls" FORCE)
add_subdirectory(libs/glfw-3.3.9)
set(HELLOIMGUI_USE_GLFW_OPENGL3 ON CACHE BOOL "Use GLFW and OpenGL3 for HelloImGui" FORCE)
set(HELLOIMGUI_USE_FREETYPE OFF CACHE BOOL "Use freetype for imoji support in HelloImGui" FORCE)
add_subdirectory(libs/hello_imgui)
include_directories(libs/hello_imgui)
add_subdirectory(src)
from hello_imgui.
Hello,
With this commit, you can use freetype and lunasvg as CMake target (i.e. call add_subdirectory for them).
So as a conclusion:
What's a simple way to get my project working on Windows platform without relying on an internet connection during build time?
Solution 1: Set HELLOIMGUI_USE_FREETYPE=OFF as you found
Solution 2: Add freetype and lunasvg as submodules and call add_subdirectory on them
Solution 3: Add freetype via a package manager (like vcpkg), and luna_svg as a submodule
from hello_imgui.
However it seems that as least on the Windows platform, CMake depends on ZLIB, BZIP2, PNG, HARFBUZZ, BROTLIDEC.
Those are just warning from Freetype CMake scripts, it still builds fine
from hello_imgui.
However it seems that as least on the Windows platform, CMake depends on ZLIB, BZIP2, PNG, HARFBUZZ, BROTLIDEC.
Those are just warning from Freetype CMake scripts, it still builds fine
Thank you for the fix, I tested it and everything now works!
I confirm that I'm now able to successfully provide freetype and luna_svg in an offline manner to hello_imgui library, as of commit:
34742c5cb56b0a4e8f195ff47e46812ad4d101a7
.
Here is my now working code:
cmake_minimum_required(VERSION 3.12)
project(generic_gui_tester)
set(CMAKE_CXX_STANDARD 17)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build everything as dlls" FORCE)
add_subdirectory(libs/glfw-3.3.9)
add_subdirectory(libs/freetype-VER-2-13-2)
add_subdirectory(libs/lunasvg-2.3.9)
set(HELLOIMGUI_USE_GLFW_OPENGL3 ON CACHE BOOL "Use GLFW and OpenGL3 for HelloImGui" FORCE)
set(HELLOIMGUI_USE_FREETYPE ON CACHE BOOL "Use freetype for imoji support in HelloImGui" FORCE)
add_subdirectory(libs/hello_imgui)
include_directories(libs/hello_imgui)
add_subdirectory(src)
This is my build system on which things are working for me offline:
- Compile on Windows 10 22H2
- Install Visual Studio 2022 C++ build tools or Visual Studio 22 community
- Install CMake- either through Visual Studio 2022 installer or the standalone version 3.26.4 for Windows
- Install VS Code and add extensions "C/C++ Extension Pack" by Microsoft, "CMake" by twxs
- Install Python 3.11.3 globally on the Windows OS and make sure to check "add to path" so that it's globally available, then do
pip install pillow
which hello_imgui uses for icon conversion. - Re-open the project with VS Code
- Run VS Code command: "CMake: Delete Cache and Reconfigure" and choose "Visual Studio Community 2022 Release- amd64" as the compiler.
- At the bottom of the VS Code window (the CMake tab) choose
CMake: [Debug]
and change toRelease
.
Here are the contents of my libs
folder:
- freetype-VER-2-13-2
- glfw-3.3.9
- hello_imgui
- lunasvg-2.3.9
- .gitignore
- freetype-VER-2-13-2.tar.gz
- glfw-3.3.9.tar.gz
- hello_imgui.7z
- lunasvg-2.3.9.tar.gz
And the extract_libs.bat file:
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
:: Get the directory where the batch file is located
SET "BATCH_DIR=%~dp0"
SET "LIBS_DIR=!BATCH_DIR!libs\"
:: Path to 7zip executable
SET "SEVEN_ZIP_PATH=C:\Program Files\7-Zip\7z.exe"
:: Check if 7zip is installed
IF NOT EXIST "!SEVEN_ZIP_PATH!" (
echo 7-Zip not found at "!SEVEN_ZIP_PATH!"
exit /b 1
)
echo freetype-VER-2-13-2.tar.gz...
"!SEVEN_ZIP_PATH!" x "!LIBS_DIR!freetype-VER-2-13-2.tar.gz" -o"!LIBS_DIR!"
"!SEVEN_ZIP_PATH!" x "!LIBS_DIR!freetype-VER-2-13-2.tar" -o"!LIBS_DIR!"
DEL "!LIBS_DIR!freetype-VER-2-13-2.tar"
echo Extracting glfw-3.3.9.tar.gz...
"!SEVEN_ZIP_PATH!" x "!LIBS_DIR!glfw-3.3.9.tar.gz" -o"!LIBS_DIR!"
"!SEVEN_ZIP_PATH!" x "!LIBS_DIR!glfw-3.3.9.tar" -o"!LIBS_DIR!"
DEL "!LIBS_DIR!glfw-3.3.9.tar"
echo Extracting hello_imgui-1.0.0.7z...
"!SEVEN_ZIP_PATH!" x "!LIBS_DIR!hello_imgui.7z" -o"!LIBS_DIR!"
echo Extracting lunasvg-2.3.9.tar.gz...
"!SEVEN_ZIP_PATH!" x "!LIBS_DIR!lunasvg-2.3.9.tar.gz" -o"!LIBS_DIR!"
"!SEVEN_ZIP_PATH!" x "!LIBS_DIR!lunasvg-2.3.9.tar" -o"!LIBS_DIR!"
DEL "!LIBS_DIR!lunasvg-2.3.9.tar"
echo Extraction complete.
ENDLOCAL
from hello_imgui.
Related Issues (20)
- Some question about hello_imgui_ini_settings HOT 1
- How to set the no_docking and no_tab_bar for the MainDockSpace ? HOT 3
- Bisect MoveWindowToMonitor HOT 1
- Custom drawing behind GUI not possible due to Impl_Frame_3D_ClearColor() HOT 2
- macOS bundle support HOT 2
- Can I change a borderless window size? HOT 3
- Metal backend + emscripten favicon and shell template HOT 22
- Ability to put user menu items between the App Menu and the View Menu HOT 1
- Sdl Dpi awareness on Windows / multiple monitors HOT 1
- New back-end default HOT 3
- adding generated files to assets directory? HOT 8
- how to add a toolbar (or other fixed windows) that limits the available main docking space? HOT 9
- Is there a way to make input_text to show only the last part of the text while deactivated HOT 2
- offline build HOT 13
- FontAwesome solid vs. regular HOT 4
- Problems with implot from vcpkg HOT 1
- RunnerParams backendType compatibility is broken HOT 1
- text blurry when connected to a non-retina external monitor HOT 4
- Improve HELLOIMGUI_WIN32_NO_CONSOLE implementation HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hello_imgui.