[question] Does Conan take any step regarding the 'compiler' setting with CMake helper
See original GitHub issueWe have a simple library, whose build is managed by CMake.
After adding a Conan test package, we are now observing surprising behaviours when calling conan create -s compiler=clang
with a compiler setting that is not the value in the default profile (gcc):
CMake Error at build/22a957f739c44641d9703aa35ab1d4431991e8cf/conanbuildinfo.cmake:585 (message):
Incorrect 'clang', is not the one detected by CMake: 'GNU'
Which raises the question: when providing a compiler
setting, does the CMake build helper take any measure to use said compiler? If not, what is the best practice for the recipe implementers to forward this setting to the CMake helper?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
conan Documentation
Conan is a decentralized package manager with a client-server architecture. This means that clients can fetch packages.
Read more >c++ - Github Actions using CMake, conan and Vulkan SDK fail ...
Why can't it find conanfile.py ? It is in the same directory? For now I just want gcc on Linux to work. Thank...
Read more >2017-August.txt - CMake
The problem is that this code: https://gitlab.kitware.com/cmake/cmake/blob/v3.9.0/Modules/Platform/Windows-GNU.cmake#L117-127 inserts use of the archiver ...
Read more >Trying Conan with Modern CMake: Packaging - John Freeman
Generally, all of the Conan packages being linked together in a single library or application should have the same settings, and settings are ......
Read more >Build systems - pybind11 documentation
An example of a setup.py using pybind11's helpers: ... In addition, it will take care of all the Python-specific compiler and linker flags...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, @Adnn. We are working on a POC to start using toolchains for CMake (follow the issue here: https://github.com/conan-io/conan/issues/5737) as it is the best way to avoid this kind of errors.
Right now, the best thing you can do is to use profiles and add the environment variables
CXX
andCC
to your profiles, and CMake will use them to populateCMAKE_CXX_COMPILER
andCMAKE_C_COMPILER
.For example, a profile for Clang:
Other option is to populate the
CMAKE_<LANG>_COMPILER
variables yourself inside the recipe, usingcmake.definitions
, but I wouldn’t recommend this way over the profiles one.Thanks a lot! 😊
With the effort in #5919 CMake integration in Conan should be easier to handle:
find_package
orfind_package_multi
,… or evencmake_paths
if you just want the paths.Decoupling the settings from the dependencies will make it more clear.