9

I am using CMake 2.8.10.1 to generate project files for Visual Studio 2012 Ultimate (64-bit). The resulting solution contains a library, some tests, and some executables.

I would like to profile some of the applications. When I select "ANALYZE" -> "Start Performance Analysis," I encounter the error message "No launchable projects are available for profiling." How can I profile my solution generated by CMake?

Petter
  • 37,121
  • 7
  • 47
  • 62

2 Answers2

16

It seems I've found a way to fix it. You need to add win32 configuration under your project. Then profiler will see your project as launchable. For example, for the release configuration you should add the following

<ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
</ProjectConfiguration> 

under

<ItemGroup Label="ProjectConfigurations">

Using the menu:

  • Build -> Configuration Manager
  • Goto row of the project to profile
  • In the platform column note that it will only have a x64 entry
  • Use dropdown <New...> and select Win32 for New platform:
  • -
Christopher Oezbek
  • 23,994
  • 6
  • 61
  • 85
ixSci
  • 13,100
  • 5
  • 45
  • 79
  • 3
    This is not a bug in CMake. Visual Studio 2012 SHALL support x64 profiling, this is ridiculous. We are in 2013 and still have only partial 64-bit support... I ran inside the same issue without CMake. – thesaint Mar 25 '13 at 03:30
  • @thesaint, it supports 64-bit profiling it just don't see target if there is no win32 target. – ixSci Mar 25 '13 at 04:00
  • Well but it is still a bug in visual studio, not cmake ;) – thesaint Mar 25 '13 at 19:37
  • This thread is relevant (from the question author): http://social.msdn.microsoft.com/Forums/vstudio/en-US/56dcdb2a-5e30-4015-bc14-244f99f07b8b/profiler-wizard-no-launchable-projects That Microsoft person did not understand and thinks it's a CMake issue, which it clearly is not. I don't have an account there, maybe someone wishes to enlighten the Microsoft guys. – Ela782 Jul 01 '13 at 12:50
5

That's a ridiculous bug in Visual Studio. QMake also suffers from this.

https://connect.microsoft.com/VisualStudio/feedback/details/823467/performance-wizard-doesnt-show-any-projects-to-profile-if-there-is-no-win32-configuration

Trass3r
  • 5,858
  • 2
  • 30
  • 45
  • Did they fix this in VS2015? The marking as wontfix means systems with 2012 or 2013 are going to stay gimped :/ – andlabs Oct 23 '16 at 04:47