Giter Site home page Giter Site logo

STB not found about raytracinginvulkan HOT 4 OPEN

gpsnoopy avatar gpsnoopy commented on June 15, 2024
STB not found

from raytracinginvulkan.

Comments (4)

GPSnoopy avatar GPSnoopy commented on June 15, 2024

The CMake files assume you've called one of the vcpkg_* script before. It's designed to use its own dependencies rather than any system-wide package/files.

from raytracinginvulkan.

meerfrau avatar meerfrau commented on June 15, 2024

And what if I would like to package it for my distribution (and thus use the system libs)?

from raytracinginvulkan.

GPSnoopy avatar GPSnoopy commented on June 15, 2024

Then it gets a bit iffy. Exact CMake code will be dependent on the versions of CMake and the libraries you have; also not all libraries might be supported/have an existing find_package script.

The relevant code is here:

find_package(Boost REQUIRED COMPONENTS exception program_options)
find_package(freetype CONFIG REQUIRED)
find_package(glfw3 REQUIRED)
find_package(glm CONFIG REQUIRED)
find_package(imgui CONFIG REQUIRED)
find_package(Stb REQUIRED)
find_package(tinyobjloader CONFIG REQUIRED)
find_package(Vulkan REQUIRED)

and here:

target_include_directories(${exe_name} PRIVATE . ${Boost_INCLUDE_DIRS} ${glfw3_INCLUDE_DIRS} ${glm_INCLUDE_DIRS} ${STB_INCLUDE_DIRS} ${Vulkan_INCLUDE_DIRS})
target_link_directories(${exe_name} PRIVATE ${Vulkan_LIBRARY})
target_link_libraries(${exe_name} PRIVATE ${Boost_LIBRARIES} freetype glfw glm::glm imgui::imgui tinyobjloader::tinyobjloader ${Vulkan_LIBRARIES} ${extra_libs})

from raytracinginvulkan.

disini avatar disini commented on June 15, 2024

Here is a same issue on version 2023.12.26 when I compile the code in CLion IDE, ubuntu 22.04, and the error log is:

CMake Error at CMakeLists.txt:62 (find_package):
  By not providing "FindStb.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Stb", but
  CMake did not find one.

  Could not find a package configuration file provided by "Stb" with any of
  the following names:

    StbConfig.cmake
    stb-config.cmake

  Add the installation prefix of "Stb" to CMAKE_PREFIX_PATH or set "Stb_DIR"
  to a directory containing one of the above files.  If "Stb" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!

[Failed to reload]

and I added the following line in CMakeLists.txt ,

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/vcpkg.linux/packages/stb_x64-linux/share/stb")

then it worked!

All things go perfectly!

from raytracinginvulkan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.