I’m not fluent in C++/cmake and I’m trying to figure out how to use conan package management in Jetbrains CLion. I was able to get a json library working but while I can manage to install cxxopts, the IDE can’t seem to find it and doesn’t include the conan directory install of cxxopts in the ‘External libraries’
I though the thing that would do it is adding the cxxopts_INCLUDE_DIRS to include_directories in CMakeLists.txt like I did with the nlohman_json_INCLUDE_DIRS. But while the program compiles, jetbrains is still marking problems and saying it can’t find cxxopts.hpp
cmake_minimum_required(VERSION 3.28)
project(lurning)
set(CMAKE_CXX_STANDARD 23)
find_package(nlohmann_json REQUIRED)
find_package(cxxopts REQUIRED)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${nlohmann_json_INCLUDE_DIRS}
${cxxopts_INCLUDE_DIRS}
)
add_executable(
lurning
main.cpp
Lurning.h
)
target_link_libraries(
lurning
PRIVATE
${cxxopts_LIBRARIES}
)
Can anyone help me figure out what is missing so I can make sure CLion finds the file?