Add ability to customize the CMake generator
See original GitHub issueWhen using the CMake class with MinGW it automatically use the “MinGW Makefiles” generator. However, when using MSys and “MinGW Makefiles”, CMake complains when it finds sh.exe
in the PATH
. A solution is to remove sh.exe
but for some of my builds I need to have sh.exe
so, in the test_package, I’m forced to override the default behavior of the CMake class as following:
if os_info.is_windows and self.settings.compiler == "gcc":
self.run('cmake "%s" %s -G "Unix Makefiles"' % (self.conanfile_directory, cmake.command_line))
else:
self.run('cmake "%s" %s' % (self.conanfile_directory, cmake.command_line))
It ends as the following call:
cmake "path/to/source" -G "MinGW Makefiles" ... -G "Unix Makefiles"
It’s not really clean and I think it would be better if there was an option in the CMake class to choose the CMake generator.
What do you think?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Step 4: Adding Generator Expressions - CMake
Generator expressions are evaluated during build system generation to produce information specific to each build configuration. Generator expressions are ...
Read more >CMake customization points, how to configure your project?
We will see how to use variables, build configurations and then generator expressions so that you can provide flexible options to your users....
Read more >Changing current cmake generator - Stack Overflow
A scenario where changing the generator is needed is that you are keeping the CMake GUI open and reusing the same directory (source...
Read more >Customize CMake build settings in Visual Studio
The editor lets you add CMake configurations and customize their settings easily. It's intended to be a simpler alternative to manually ...
Read more >CMake-Episode 003 : CMake Generators | CMake Starts Here
CMake Generators explained in plain English. We use several generators to build a C++ project both on Windows and LinuxPlaylist: ...
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
Ok, I see the point. What would be the suggested interface?
It’s ok for me. just remember to update the docs to see how to do it.