I have a cmake build in which I\'m searching for a bunch of dependencies, i.e. I have many instances of:
FIND_PACKAGE(SomePackage)
if(SOMEPACKAGE_FOUND)
in
Our solution to write include directories added by conan to a file
function(output_conan_include_dirs)
set(include_dir_str "")
foreach(DIR ${CONAN_INCLUDE_DIRS})
set(include_dir_str "${include_dir_str}${DIR}\n")
endforeach()
set(pth "${CMAKE_BINARY_DIR}/conan-includes.txt")
file(WRITE "${pth}" "${include_dir_str}")
message(STATUS "Conan include directories written to: ${pth}")
endfunction()
output_conan_include_dirs()