conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
970 stars 1.78k forks source link

[question] Cannot use librealsense library #22590

Open nicgamster opened 9 months ago

nicgamster commented 9 months ago

What is your question?

So, i write conan file to use librealsense package `class CamApiRecipe(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", "CMakeToolchain"

def requirements(self):
    self.requires("librealsense/2.53.1")
    self.requires("stb/cci.20230920")`

It create a chain file and then i use cmake to make Debug build but it doesn't work cmake_minimum_required (VERSION 3.8) if (POLICY CMP0141) cmake_policy(SET CMP0091 NEW) set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$,$>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>") endif() project ("Cam")

find_package(realsense2 REQUIRED)

add_executable (${PROJECT_NAME} "src/main.cpp")

target_link_libraries(${PROJECT_NAME} librealsense::librealsense)

if (CMAKE_VERSION VERSION_GREATER 3.12) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20) endif()

it says librealsense2/rs.hpp: No such file or directory

SpaceIm commented 9 months ago

Files generated by CMakeDeps with a conan install and build_type=Release can't be consumed in Debug build. You have to be consistent. It's unrelated to conancenter, but conan client.

nicgamster commented 9 months ago

Files generated by CMakeDeps with a conan install and build_type=Release can't be consumed in Debug build. You have to be consistent. It's unrelated to conancenter, but conan client.

Cannot understand where did i make build_type= Release. It should be in conan or cmake file?

SpaceIm commented 9 months ago

I don't have a crystal ball. You know which commands you called. If you have not specified anything during conan install, it's whatever build_type in your conan profile.