[CMake] Custom platform with MSVC

Brad King brad.king at kitware.com
Wed Apr 11 13:12:45 EDT 2018


On 04/11/2018 09:24 AM, Ales Borovicka wrote:
> We have a custom platform that does require to set properties in vcxproj like:
> <PlatformSdkRoot>$(PLATFORM_SDK_ROOT)</ PlatformSdkRoot >
> 
> For regular projects we set this through user files, so it works for the
> generated projects. (it worked with cmake 3.7.0)

We don't currently support that officially.  CMake generates temporary
project files in several places, e.g. try_compile, that would not get
user-set properties from the project code.

In order to support a custom platform SDK CMake would need to be
taught a corresponding abstraction.  The VS generators already support
similar abstractions:

* CMAKE_GENERATOR_TOOLSET = v141 or some other toolset
* CMAKE_GENERATOR_PLATFORM = Win32, x64, etc.
* CMAKE_GENERATOR_INSTANCE = Which VS 2017 to use on local machine

All of these affect the way .vcxproj files are generated. If a
.vcxproj file needs an additional field for MSBuild to be able
to find the SDK then a similar abstraction will be needed.

I'd need to understand the use case better before recommending an
approach to such an abstraction.

-Brad


More information about the CMake mailing list