0

My system package manager dnf (Im using fedora Linux) doesn't have an imgui package or an assimp package so I decided to use vcpkg for installing imgui and assimp.

The problem I think is that find_package doesn't work for packages installed with vcpkg because the vcpkg directory is in my home directory and I guess cmake has no way of knowing that imgui was installed in my home directory.

This is the error I get when trying to build with cmake:

$ cmake -DCMAKE_BUILD_TYPE=Debug -S .. -B . -- Submodule update CMake Error at CMakeLists.txt:40 (find_package): Could not find a package configuration file provided by "imgui" with any of the following names: imguiConfig.cmake imgui-config.cmake Add the installation prefix of "imgui" to CMAKE_PREFIX_PATH or set "imgui_DIR" to a directory containing one of the above files. If "imgui" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! 

So how do I make vcpkg install imgui or any package in a system wide place like dnf does where cmake can find it?

1
  • Wouldn’t it be simpler to set imgui_DIR? Commented Jan 10, 2024 at 13:55

1 Answer 1

0

I've decided to move the vcpkg directory into my project folder and to set CMAKE_PREFIX_PATH to the vcpkg directory. This way my project is self contained and I don't need to hard code the path to vcpkg to some location in my home directory.

I added this to my cmake:

set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/installed/x64-linux") 

But I think the vcpkg imgui package is bugged because there are no imgui_impl_* files in the imgui installation of vcpkg so I've added imgui as a submodule instead.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.