fips on Visual Studio 2019

Getting fips working today in Visual Studio 2019 was quite unpleasant because of CMake.


Short Answer

  • be sure that you have Python on your PATH(I have 2.8.3)
  • ensure that you have git on your PATH too
  • remove old stuff
    • uninstall any/all CMake versions
    • remove all Visual Studio packages
  • install stuff
    • install Visual Studio 2019 with minimal individual components
    • add just C++ CMake tools for Windows
      • … okay, and Visual Studio Tools for Unity with C# and Visual Basic Roslyn compilers
    • download and unzip cmake-3.19.1-win64-x64.zip
    • add the bin/ folder onto your PATH

Longer Answer

fips is fast - this is atypical for the sort of thing that it does. fips is (sort of) a front-end to CMake that adds (git based) dependency management functionality for C/++ projects. I feel that the strength of fips’s approach is that it defies tradition and doesn’t rely on prebuilt binaries - this makes it practical for a language like C/++ which encodes all sorts of eccentricities based on the environment or phase of the moon.

Windows loves slipping lunar details into builds … and CMake seems to be continuing that proud tradition today. Following the quickstart steps for the/a fips’ poster child oryol I consistently encountered the/a CMake / Visual Stuiodo error;

    NMake Makefiles

  does not support platform specification, but platform

    x64

  was specified.

There were three steps to fixing this;

  • replace CMake with a version that can use Visual Studio 2019
  • ensure that the Visual Studio 2019 CMake package is/was installed
  • remove the stale CMake cache(s) and try again.

I had multiple copies of CMake scattered on my computer … not sure why. None of them worked with Visual Studio 2019 - so I removed them all and replace them with cmake-3.19.1-win64-x64 from the .zip. If you’re working with an existing project, you may need a more detailed approach.

The Visual Studio Installer tool has all the other “things” one needs under the C++ CMake tools for Windows package. You don’t need the other crap - don’t be a cultwit remove it! If you’re working with an existing project, you may need a more detailed approach.

CMake caches data when building stuff … because that is/was the sensible way to “do” what it does. Sadly, some of what it cached when failing carries the taint of failure with it. The simplest way to “clean” the setup is to delete “not your projects” and re-run fips build again. If you’re working with an existing project, you may need a more detailed approach.

With this out of the way, you can use fips open to edit these projects in Visual Studio. fips itself is appealing for code generation if you can handle Python. (Everyone can handle python) This was all done with the current version of Visual Studio Installer, VS’s CMake and the/a “current” version of fips. While I expect some instability from the first two - fips itself seems “stable” enough I’d be surprised if it was the “weak link” in the arrangement.

comments powered by Disqus
Peter LaValle avatar
Peter LaValle
Any links probably include affiliate ids for that sweet sweet kickback - and some programs require that I tell you. The contents of this blog are likely unrelated - as they include games, paints, and build tools.