-1

I wanted to play around with my pico. I downloaded the examples from official github, installed an sdk and went along with the documentation. The problem I have is when I'm creating build files. While the cmake command is creating a lot of files, none of them are a Makefile, making the use of next command (nmake) impossible.

The strucutre I have after using cmake in build directory is as follows:

├── build
│   ├── blink
│   │   ├── CMakeFiles
│   │   |   ├── ELF2UF2Build.dir
│   │   |   |   ├── Labels.json
│   │   |   |   ├── Labels.txt
│   │   |   ├── generate.stamp
│   │   |   ├── generate.stamp.depend
│   |   ├── elf2uf2
│   │   |   ├── src
│   │   |   |   ├── Debug (empty directory)
│   │   |   |   ├── MinSizeRel (empty directory)
│   │   |   |   ├── Release (empty directory)
│   │   |   |   ├── RelWithDebInfo (empty directory)
│   │   |   |   ├── ELF2UF2Build-source_dirinfo.txt
│   │   |   ├── tmp
│   │   |   |   ├── ELF2UF2Build-cfgcmd.txt
│   │   |   |   ├── ELF2UF2Build-mkdirs.cmake
│   |   ├── blink.vcxproj
│   |   ├── blink.vcxproj.filters
│   |   ├── cmake_install.cmake
│   |   ├── ELF2UF2Build.vcxproj
│   |   ├── ELF2UF2Build.vcxproj.filters
│   ├── other_examples...
...

Any help would be greatly appreciated, I've been going around in circles for some time. Im working on Windows 10, cmake, make are installed with cholocatey.

LauraAlice
  • 33
  • 6
  • 1
    *"the cmake command is creating a lot of files"* - which command? – user7860670 Feb 06 '23 at 11:44
  • You're telling cmake to generate Visual Studio files ... – ChrisMM Feb 06 '23 at 11:49
  • I'm using command `cmake -S ../ -B . -G "Visual Studio 16 2019"` as the default generator was not working, and this was a solution I found as another stackoverflow answers – LauraAlice Feb 06 '23 at 11:50
  • 1
    Try calling cmake with `-G "NMake Makefiles"` – Friedrich Feb 06 '23 at 11:50
  • If you do not care about having Makefiles per se or a nice Visual Studio project, just pass `-G Ninja` when you generate the files and use `cmake --build build` to build. – Botje Feb 06 '23 at 11:53
  • 1
    `-G "NMake Makefiles"` command worked! No idea how `this time`, I swear I've used it around 10 times before with no luck, always returned an error. Glad it worked this time, thanks a lot – LauraAlice Feb 06 '23 at 11:54
  • You probably had a typo or used single quotes or missed another small detail like that. *Luck* has nothing to do with it. Take some time to read how CMake works and what it does. It will pay off in the long run. – Friedrich Feb 06 '23 at 11:59

1 Answers1

0

To create Makefiles for nmake call CMake like this

cmake -S .. -B . -G "NMake Makefiles"

For troubleshooting, you can look up all generators that are supported on your system with cmake --help in section "Generators".

Note that nmake does not support parallel builds, so larger projects will be slow.

Friedrich
  • 2,011
  • 2
  • 17
  • 19