Friday, March 09, 2012

Blank Properties Page for C++ Files in VS2010

I’ve been using CMake 2.8.7 for the past few weeks to generate Visual Studio 2010 solution files for a C++ project of mine. Today I decided to add a precompiled header to one of my projects, unfortunately there is still no built-in support for precompiled headers in CMake , so I had to find some macros to do the job. After I got the macro in place I regenerated the solution file, and opened the file properties for the precompiled header I added in order to make sure CMake was setting up everything correctly…

VS2010 Blank Props Page



Unfortunately every property page in the C/C++ section was blank. At this point I erroneously assumed that the fault lay with CMake, specifically the setting of per-file COMPILE_FLAGS (since per-target COMPILE_FLAGS showed up on the project properties page as expected). After barking up the wrong tree for a while I stumbled on a message in the CMake list archives about property pages for source files disappearing as of CMake 2.8.5, turns out that my issue had nothing to do with precompiled headers after all, and was actually caused by a bug in VS2010. I’m happy to report the drive mapping workaround got my property pages back.