Looking for a command line packaging tutorial for Windows 10

All,

Just looking for someone to point me to a step-by-step tutorial for a command line CMake build not using mingw, WSL, or any other non-native Windows emulators, to build and package a C/C++ library under Windows 10.

One run-time having just dll files

Another full development including headers and .cmake files.

A non-zip file that can be taken to any other Windows 10 system and installed.

Not that the project should matter, but I’m working on BasisDoctrina. Haven’t done Windows development since Windows was fraudulently marketed as an operating system when it was just GUI-DOS. (Pre-Windows NT for those not old enough to remember.) Been doing Linux packaging and development for a long time. This library will need to also run on Windows, so before there is really anything to it, I want to get the build plumbing in place.

Thanks,

This isn’t exactly a tutorial, but I have full MSI and ZIP packaging for my github project Iterated Dynamics. As far as the command-line goes, it’s simply:

cmake --workflow --preset release

or you could run cpack only

cpack --preset release

I did a presentation using CPack 5 years ago: Installation and Packaging with CPack

I can try and answer whatever questions you might have. The only difficult part is setting all the appropriate CPack variables/properties for the different generators (e.g. WiX, ZIP).

Thank you.

I will take a gander over the next few days once I get done digging out from under snow, etc.

This is what I suspected. There is a whole lot of “assume you have things set up” in everything I find for CMake on Windows.

I do have the Community 2026 Visual Studio installed (would prefer 17 since that would support XP if needed but choose the hills one dies on)

I do have the vcpkg installed.

There is a non-Mingw non-WSL hunk missing. That’s what I haven’t found and need to document so a noob can start helping with BasisDoctrina.

Hope this is something obvious that can be answered off the top of your head.

I’m a huge believer in creating step-by-step documentation both for my projects and my book series.

Having come up through computer operations on real computers during the 1980s, I’m a big believer in batch files that accept a parameter list or ask a couple of questions then “just do it.”

Thanks in advance.

I guess you didn’t look at the ReadMe, which explains you need to initialize/update submodules before you can issue that command.

No, I didn’t. I took your message verbatim. I still firmly believe there is something fundamental missing from the CMake chain though. Belief does not a fact make though.

Script seems to be viciously sensitive to Internet connections. Claims it is building now.

Thanks for the help.

I have a question only because I saw supposed to support Unix. Spun up one of my Ubuntu 20.04 LTS VMs. Please forgive the initial paste oopsie in the following.

Was this just a case of the world’s poorest timing and the repo was being changed?

Did I ASS-U-ME Unix meant Linux when you really meant an actual Unix?

Did I once again skip a necessary step?

I don’t want to get too far down adding Windows support via your example only to find I totally busted Linux support.

Thanks!

CMake Presets did not exist in April 2020. Use classic command line arguments to call cmake, or update to a recent Linux.

Thanks!

I was actually told by the maintainer that they never finished a Unix/Linux build and are in the middle of a re-write.

This problem has nothing to do with Linux. If you use a CMake < 3.19 on Windows, you will have the same error message.

Later versions would have understand your command line arguments, but may fail on the minimum version.

The toplevel CMakeLists.txt has a minimum version of 3.23 defined. If you’re using an older version, it will not work.

If you want to use Ubuntu LTS, you should use at least 24.04 which provides CMake 3.28.