mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-12 03:59:07 +08:00
18 lines
787 B
Plaintext
18 lines
787 B
Plaintext
|
hello_imgui provides CMake targets and hello_imgui_add_app:
|
||
|
|
||
|
Usage with `hello_imgui_add_app` (recommended)
|
||
|
set(CMAKE_CXX_STANDARD 17)
|
||
|
find_package(hello-imgui CONFIG REQUIRED)
|
||
|
hello_imgui_add_app(test test.cpp) # see example below
|
||
|
|
||
|
Usage with `target_link_libraries`
|
||
|
set(CMAKE_CXX_STANDARD 17)
|
||
|
find_package(hello-imgui CONFIG REQUIRED)
|
||
|
# Note the subtle difference between the package name and the target name: hello-imgui vs hello_imgui!
|
||
|
target_link_libraries(main PRIVATE hello-imgui::hello_imgui)
|
||
|
# this mode will ignore all of hello_imgui cmake tooling, and will not deploy the assets
|
||
|
|
||
|
Example test.cpp:
|
||
|
#include "hello_imgui/hello_imgui.h"
|
||
|
int main() { HelloImGui::Run([](){ ImGui::Text("Hello, world!"); ImGui::ShowDemoWindow(); }); }
|