View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012876CMakeCMakepublic2012-01-16 03:262012-07-09 06:52
Reporterthesaint 
Assigned ToBrad King 
PriorityurgentSeveritytweakReproducibilityalways
StatusclosedResolutionduplicate 
PlatformOSMicrosoft WindowsOS Version
Product VersionCMake 2.8.7 
Target VersionFixed in Version 
Summary0012876: Recognizing a PLATFORM_TOOLSET property for Visual Studio builds!
DescriptionIssue "http://public.kitware.com/Bug/view.php?id=6929" [^] asks for Intel Compiler support with Visual Studio. Instead of generating project files (which I found rather complicated), it is often sufficient just to set the platform toolset properly. This is already done by CMake for Visual Studio Express and now I just want a way to set this property through CMakeLists.txt! I also added the required, trivial code change below...

Resulting in the following usage:

set_target_properties(${YOUR TARGET} PROPERTIES PLATFORM_TOOLSET "Intel C++ Compiler XE 12.1")

This also supports the windows driver SDK in theory and whatever one can think of. The bug potential is probably zero, so please include this in the main branch, since I can not expect every one on Windows to configure and build a custom CMake edition just to make my OpenSource project buildable on that platform... (I need the Intel Compiler, because Microsoft's support for C++11 even in the next iteration VS2011, is god damn inferior to everything there is)

Thanks a bunch!
Christoph Husse
Additional InformationThe thing you have to do is goto to the file "cmVisualStudio10TargetGenerator.cxx" and method "void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()".

Now just patch the following code at the end of the method:

"
   if(const char* toolset = gg->GetPlatformToolset())
      {
      std::string pts = "<PlatformToolset>";
"

with this snippet:

"
   if(this->Target->GetProperty("PLATFORM_TOOLSET"))
      {
      this->WriteString(((std::string)"<PlatformToolset>" + this->Target->GetProperty("PLATFORM_TOOLSET") + "</PlatformToolset>").c_str(), 2);
      }
   else if(const char* toolset = gg->GetPlatformToolset())
      {
          std::string pts = "<PlatformToolset>";
"

Now you can simply set the platform toolset from within a CMakeLists.txt file by using:

"
set_target_properties(${YOUR TARGET} PROPERTIES PLATFORM_TOOLSET "Intel C++ Compiler XE 12.1")
"

I found this to be pretty slick, since now also the CMake macro can be used and you don't have to edit anything manually... Additionally, you can set custom toolsets for every single project.

This solves the Intel Compiler issue for me and additionally one can specify any toolset this way, like windows driver SDK and stuff like that!
TagsNo tags attached.
Attached Files

 Relationships
duplicate of 0010722closedBrad King Add PlatformToolset support to Visual Studio 2010 generator 

  Notes
(0028313)
Brad King (manager)
2012-01-16 08:38

Please see issue 0010722 where this was already requested.

In particular see comments 0010722:0020845, 0010722:0020917, and 0010722:0023645.
(0029956)
David Cole (manager)
2012-07-09 06:52

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-01-16 03:26 thesaint New Issue
2012-01-16 08:38 Brad King Note Added: 0028313
2012-01-16 08:38 Brad King Relationship added duplicate of 0010722
2012-01-16 08:38 Brad King Status new => resolved
2012-01-16 08:38 Brad King Resolution open => duplicate
2012-01-16 08:38 Brad King Assigned To => Brad King
2012-07-09 06:52 David Cole Note Added: 0029956
2012-07-09 06:52 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team