I'm looking at migrating to conan 2.0 and using the newer generator CMakeToolChain
without CMakeDeps
so the CMake config files I've already created are used. Seems like it should be doable even though I know (for at least conan.io), it's actively discouraged:
Unfortunately that documentation doesn't mention the corresponding changes needed in CMakeToolchain generator so that cmake would know where to look in the conan cache for the config files of the installed package. The default toolchain file in hello
(I'm using modified versions of say
and hello
from the conan tutorials here adds these paths):
list(PREPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR} )
list(PREPEND CMAKE_LIBRARY_PATH "/home/raptor/.conan2/p/say8a68f1d877fb8/p/lib")
where CMAKE_CURRENT_LIST_DIR
is build/Release/generators
where the toolchain file is located. With only those paths, cmake can't locate the config file (i.e. /home/raptor/.conan2/p/say8a68f1d877fb8/p/lib/cmake/say/say-config.cmake
, package name is say
) of the package in the conan cache.
How would I configure the Toolchain generator to look in the conan cache? Maybe a separate, but closely related question is how would this would if the package was in editable mode?