Skip to content
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

CMAKE_MAKE_PROGRAM for mingw #10770

Merged
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion conan/tools/cmake/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ def configure(self, variables=None, build_script_folder=None):
pkg_folder = self._conanfile.package_folder.replace("\\", "/")
arg_list.append('-DCMAKE_INSTALL_PREFIX="{}"'.format(pkg_folder))
if platform.system() == "Windows" and self._generator == "MinGW Makefiles":
# It seems this doesn't work in the toolchain file, it needs to be here in command line
# It seems these don't work in the toolchain file, they need to be here in command line
lasote marked this conversation as resolved.
Show resolved Hide resolved
arg_list.append('-DCMAKE_SH="CMAKE_SH-NOTFOUND"')
cmake_make_program = self._conanfile.conf.get("tools.gnu:make_program", default=None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have had a second look, just in case, and it really seems difficult.
So I am approving and merging this. However, I think it would be better if we started storing this arguments in CMakeToolchain in the conanbuild.conf file, or even better, if we start considering moving to a CMakePresets.json compatible format.

if cmake_make_program:
cmake_make_program = cmake_make_program.replace("\\", "/")
arg_list.append('-DCMAKE_MAKE_PROGRAM="{}"'.format(cmake_make_program))

if variables:
arg_list.extend(["-D{}={}".format(k, v) for k, v in variables.items()])
arg_list.append('"{}"'.format(cmakelist_folder))
Expand Down