Mahdi Habibi
Mahdi Habibi

Reputation: 69

vcpkg Cmake Can not find a package configuration for "hello-imgui"

I'm trying to install im-gui package using vcpkg. But I get an cmake error saying cmake can't find the im-gui package.

Using these settings from the manuals I have already successfully compiled a code fmt library so I suppose it should work for other packages as well.

Using a m1 mac. I got vcpkg.json:

{
  "dependencies": [
    "hello-imgui"
  ]
}

running:

vcpkg install

returns

Detecting compiler hash for triplet arm64-osx...
Compiler found: /Library/Developer/CommandLineTools/usr/bin/c++
All requested packages are currently installed.
Total install time: 250 ns
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(); }); }

None of the examples usages mention work, as im-gui cmake can't find include file.

I have CmakeLists.txt:

cmake_minimum_required(VERSION 3.24)

set(CMAKE_CXX_STANDARD 17)

project(HelloWorld)

find_package(hello-imgui CONFIG REQUIRED)

target_link_libraries(HelloWorld PRIVATE hello-imgui::hello_imgui)
[main] Building folder: /Users/me/helloworld/build 
[build] Starting build
[proc] Executing command: /opt/homebrew/bin/cmake --build /Users/me/helloworld/build --parallel 10 --
[build] CMake Error at CMakeLists.txt:7 (find_package):
[build]   Could not find a package configuration file provided by "hello-imgui" with
[build]   any of the following names:
[build] 
[build]     hello-imguiConfig.cmake
[build]     hello-imgui-config.cmake
[build] 
[build]   Add the installation prefix of "hello-imgui" to CMAKE_PREFIX_PATH or set
[build]   "hello-imgui_DIR" to a directory containing one of the above files.  If
[build]   "hello-imgui" provides a separate development package or SDK, be sure it

Upvotes: 2

Views: 95

Answers (0)

Related Questions