Closed uilianries closed 6 years ago
Yes, CMake helper is looking for the generator and first checks CONAN_CMAKE_GENERATOR
env var. So this is probably why you find the difference in CI.
We already reviewed this in issue #2758 but seems this could be a missing piece.
However, there is no default cmake generator in Windows so this should be the reason why you have to specify it even for a cmake install command.
Why does conan require that a generator be specified for a package that doesn't depend on a compiler? Why can't you let cmake figure out what to use since it doesn't matter to the package?
On Linux it defaults to "Unix Makefile" and on Windows it tries to detect installed Visual Studio version (Unless otherwise set ). I tested it on a virtual machine with VS2017 Community and it worked as expected. On both linux and windows the following was run:
cmake ..
cmake --build .
Yes, it seems that cmake works that way: https://stackoverflow.com/questions/6430251/what-is-the-default-generator-for-cmake-in-windows
looking into this to see if we can avoid the generator check.
BTW @uilianries, you know that you can still include settings
in a header only recipe as long as you use self.info.header_only()
por package ID, right? (I see you are already doing it, just a reminder)
@danimtb I just forgot about this! So yeah, I could use CMake Helper + settings to generate the same package id for a header-only project.
I'm just curious about the config.cmake file created by Cmake, if it will be the same for all packages. I'll check this later.
@uilianries We have disabled the generator check for the CMake build helper. It will be live in next release. Thanks!
Awesome! Thanks guys, you rock!
To help us debug your issue please explain:
Hi everyone!
I'm trying give some support to taocpp/PEGTL and I would like to use CMake helper to install the project. The project is header-only, thus it installs the license, headers and pegtl-config.cmake.
However, when the package method runs over Windows, I receive the follow message:
When I run the same recipe on Linux (Travis CI), I have no problems.
Appveyor error log: https://ci.appveyor.com/project/uilianries/pegtl/build/feature/conan-9/job/tnwvkd69gvkgsb6x#L250
The current PR uses just self.copy, but my intention is revert to follow state, using CMake:
https://github.com/uilianries/PEGTL/blob/dc4011991624faedf67fd390e8f53737f562a897/conanfile.py
Current PR for PEGTL: https://github.com/taocpp/PEGTL/pull/112
I'm curious if CONAN_CMAKE_GENERATOR is required by Conan or is just a CMake limitation.
Conan Version: 1.4.3