Re: [RFH] CMake: detect if being run via Visual Studio, independent of build generator?
- From
Matt Rogers <mattr94@gmail.com>
- Date
- May 30, 2021, 00:14 UTC
- Message-ID
- <CAOjrSZtRH-sqh8RJm3W00dUWTbT-xcpzDWCQFt=3CNaVnOyVWQ@mail.gmail.com>
- In-Reply-To
- <CAKiG+9UeT70S3_jNXUbx2KCM6UDUxPKMizFX_fUiioDo-zmp+Q@mail.gmail.com>
(resending because client reconfigured to not use plaintext)
Reading through the documentation, Visual Studio seems to support CmakePresets.json [1] for handling configuration of cmake options. It might be worth it to keep the defaults as is. But provide a variable for forcing vcpkg and a CMakePresets.json for Visual Studio (and other such tools) to use.
This is nice since Visual Studio users wouldn't need to rely on the slower Visual Studio * generators to run their builds, while leaving non Visual Studio users still able to easily run builds. So maybe there's a way for everyone to be happy?
1: https://devblogs.microsoft.com/cppblog/cmake-presets-integration-in-visual-studio-and-visual-studio-code/
-- Matthew Rogers