Custom platform with MSVC

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Custom platform with MSVC

Ales Borovicka
Hi,
 I am having issues after upgrading cmake to 3.10.2.
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)

Now in the new cmake version when I generate a project with VS 14 generator selected it fails, because I have enabled the languages C/C++. 
The problem is, that cmake does try to build a project to determine the toolset (calling FindVCTargetsPath). This does generate a project VCTargetsPath.vcxproj which is not compile-able for the custom platform since the properties required for that platform are not defined and there is no way how to set them. 

Please what can I do here to disable the toolset check or get around it? 

Thanks a lot,
Ales



--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Custom platform with MSVC

Brad King
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
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake