-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion of cmake-conan evolving towards Dependency Provider. #475
Comments
It is not a decision yet, but we are experimenting with the different possibilities, trying to achieve the best possible integration. |
@memsharded - Have you considered the CAE problem of CMakeToolchain generator in this scheme? |
Yes, hopefully it will not be a problem |
Based on what CMake Docs said about Dependency Provider:
If I haven't misunderstood the mechanism, it seems that the cmake_minimum_required(VERSION 3.24)
project(cmake-conan-test LANGUAGES CXX)
#
# Call the xxx_provide_dependency() when the find_package(fmt) is invoked.
#
find_package(fmt) That means the Lines 127 to 151 in 1f33316
However, the key of solving the CAE problem is that we have to generate the Right? |
I conduct a simple experiment of Dependency Provider. The followings are the demo files:
The following is the log of running Click to expand detailsD:\Test\cmake-conan-provider>cmake --preset win32
Preset CMake variables:
CMAKE_PROJECT_TOP_LEVEL_INCLUDES="D:/Test/cmake-conan-provider/conan_provider.cmake"
[DEBUG] Before calling "project()" command...
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
[DEBUG] Start to include "conan_provider.cmake" file...
-- The CXX compiler identification is MSVC 19.29.30147.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
[DEBUG] After calling "project()" command...
[DEBUG] Before calling "find_package(fmt)" command...
[DEBUG] Start to call "conan_provide_dependency()" function...
CMake Warning at CMakeLists.txt:8 (find_package):
By not providing "Findfmt.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "fmt", but
CMake did not find one.
Could not find a package configuration file provided by "fmt" with any of
the following names:
fmtConfig.cmake
fmt-config.cmake
Add the installation prefix of "fmt" to CMAKE_PREFIX_PATH or set "fmt_DIR"
to a directory containing one of the above files. If "fmt" provides a
separate development package or SDK, be sure it has been installed.
[DEBUG] After calling "find_package(fmt)" command...
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Test/cmake-conan-provider/build/win32 After extracting the [DEBUG] Before calling "project()" command...
[DEBUG] Start to include "conan_provider.cmake" file...
[DEBUG] After calling "project()" command...
[DEBUG] Before calling "find_package(fmt)" command...
[DEBUG] Start to call "conan_provide_dependency()" function...
[DEBUG] After calling "find_package(fmt)" command... If that is the case, I'm afraid that this scheme might not be able to solve the CAE problem... |
we are not currently considering having Conan generate In the current experiment we simply ensure that I have tested my current version of Note that all of this is subject to change, we are simply experimenting with Conan 2.0 and CMake's new dependency provided feature.
|
Since Conan Team insisted that we should include the I wondered what will happen if we don't include the |
It will depend on some specific use cases and workflows - the |
A proposal for 2.0 based on dependency providers and providing transparent (no need to modify CMakeLists.txt) is in https://github.com/conan-io/cmake-conan/tree/develop2, testing and feedback welcome. |
Excuse me, Conan Team. I'm glad to see that the plan of cmake-conan evolving towards Dependecny Provider succeeds. However, as @jcar87 mentioned in his comment #475 (comment), there exist some limitations in the Dependency Provider. I'm not sure whether these limitations can be mitigated in the future. Therefore, I want to see cmake-conan-setup as a fallback plan. Besides, although the Conan 2.0 is already released, I still use Conan 1.59.0 currently. It's because I already applied the cmake-conan-setup in some of my personal projects, but the currently latest Therefore, I hope that the First of all, could you review/merge this PR (#454) that I submitted before into |
Recently, I found that a new experimental branch (experiment/cmake_project_include) was created, and the Conan team has submitted a few PRs related to it:
Does cmake-conan decide to evolve towards Dependency Providers?
If that is the case, then I would be very happy to see it evolves in this direction. I think this solution may be better than the cmake-conan-setup (#449) that I previously proposed.
The text was updated successfully, but these errors were encountered: