feat: set tool path
Scenario: I want to install build requirements with conan. In order to use them in my CMake files after the first find_package, I have to get the conan install path into CMake context.
Hi @tim-goto, thank you for your contribution.
@memsharded - the proposed logic more or less matches what the CMakeToolchain does by setting CMAKE_PROGRAM_PATH. This overcomes one of the limitations mentioned in https://github.com/conan-io/cmake-conan/tree/develop2#known-limitations-with-conan-20, where find_program() doesn't work. It may not be 1:1 equivalent to what CMakeToolchain does, but it is a good approximation.
This is more or less in line with what I had in mind. @tim-goto, my suggestion (and also to echo @memsharded's concerns) is that we should be appending to CMAKE_PROGRAM_PATH, rather than create a custom CONAN_TOOL_PATH. This would enable running find_program() without any additional changes.
Although one must note that this will not work for any tool that needs to be located "during" a project() call (like a compiler, linker, build tool, etc) - but should work for anything that happens after the first find_package() call.