Enhancement (Windows): WIX and NuGet packaging support


I spent yesterday working with CMake, CPack, WIX, and NuGet to extend packaging capabilities. I’m not sure what the discussion, review, and acceptance process is, so here are my changes to cmake/package_info.cmake

This changes the build process to detect if WIX and NuGet are installed (Windows only) and adds installer generators for them if they exist. Running cpack -C Release should generate .zip, .exe, .msi, and .nupkg files, provided NSIS, WIX, and nuget.exe are available. I had to make a minor tweak to the package build ID to deal with a limitation in WIX but otherwise everything should behave about the same as before.

NuGet support is still experimental; it’s throwing a lot of warnings about libraries not being located where it expects but it still creates a NuGet package. If I can get an OSX dev environment set up, I’ll move on to DragNDrop (DMG) packaging (my ulterior motive is to learn CPack well enough to create Windows, Linux, and OSX installers all from the same codebase…)

Anyway, I’d appreciate any review comments and advice before I create a merge request – thanks!

1 Like

There’s nothing wrong with creating a merge request for review. You can always put WIP: in the title which prohibits it from being merged until it’s removed.

As a general comment; I like to have separate commits for unrelated changes. In this commit you have a change of SET to set and a guard (if(WIN32)) for NSIS. Separating such changes to separate commits makes it easier to understand the actual functional change in the remaining commit. I realize that this is just my opinion and there’s nothing wrong with it as it is of course.

Wow, great progress!

I assume you’ve already seen these, but if not there are some existing CMake issues in Gitlab:

These might give you a partial map of what you’re likely to encounter as you explore the CMake build.


@magjac Thanks - I’ll try for better topical separation and less churn going forward.

@smattr I have to admit I haven’t looked at the open CMake issues yet; my main focus was on Windows build and packaging. Now that I have a better idea how CMake is being used, I’ll see what I can resolve.

1 Like