Can't use cmake generator "NMake Makefiles" with conan
See original GitHub issueIf I set environment variable CONAN_CMAKE_GENERATOR to"NMake Makefiles", conan correctly passes -G "NMake Makefiles"
to cmake during configure but build fails with
NMAKE : fatal error U1065: invalid option 'j'
Stop.
ERROR: PROJECT: Error in build() method, line 30
cmake.build()
ConanException: Error 2 while executing cmake --build C:\Work\conan-test\build -- -j4
the problem is here: https://github.com/conan-io/conan/blob/develop/conans/client/build/cmake.py
if "Makefiles" in self.generator:
if "--" not in args:
args.append("--")
args.append("-j%i" % cpu_count())
You always add -j flag for Makefiles generators but NMake does not understand that.
Issue Analytics
- State:
- Created 6 years ago
- Comments:25 (20 by maintainers)
Top Results From Across the Web
Can't use cmake generator "NMake Makefiles" with conan -
If I set environment variable CONAN_CMAKE_GENERATOR to"NMake Makefiles", conan correctly passes -G "NMake Makefiles" to cmake during configure but build ...
Read more >Cygwin+conan+cmake: how to force use of Ninja?
I have the reason for avoiding MinGW, so the question is: how to force conan+cmake to use ninja instead of "MinGW Makefiles"?? Tried...
Read more >cmake_paths generator — conan 1.43.4 documentation
This generator is especially useful if you are using CMake based only on the find_package feature to locate the dependencies. The cmake_paths generator...
Read more >vscode-cmake-tools/support - Gitter
But CMake Tools doesn't seem to like "NMake Makefiles". "Unable to determine what CMake generator to use. Please install or configure a preferred...
Read more >How to write a proper configurePreset using MinGW compilers ...
... configurePreset using MinGW compilers with "MinGW Makefiles" generator? ... And I tried the following example of CMakePresets.json :.
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
Yes, it works for me. Thanks a lot!
@memsharded,
That’s quite obvious. For
Visual Studio
generator cmake knows the target toolchain and architecture from its name (likeVisual Studio 15 2017 Win64
). That’s not the case forNMake Makefiles
. So cmake should rely oncl
that it finds in the path. I believe it also applies to Ninja.