[CMake] Problems with 2.8.0 and VS 10 generator: CMAKE_CFG_INTDIR, UNC paths, and QT_LIBRARIES

Ben Medina ben.medina at gmail.com
Tue Nov 17 19:27:19 EST 2009


Hello,

I'm doing some testing of VS 2010 B2 with CMake 2.8.0, and I've run
into several problems:

1. CMAKE_CFG_INTDIR is set to $(ConfigurationName), a macro which no
longer exists in VS 2010. According to the CMake docs
(http://www.cmake.org/cmake/help/cmake-2-8-docs.html#variable:CMAKE_CFG_INTDIR),
it is supposed to be $(Configuration), but that's not what I'm seeing.

2. The VS10 generator seems to no longer replace forward slashes with
back slashes in file paths, which breaks UNC paths in the project
files. For example, if I specify a link against
"//server/share/somelibrary.lib" in CMake, it should be translated to
"\\server\share\somelibrary.lib" in the vcproj file. This works for
the VS9 generator, but not the VS10 generator, leading to a linker
error.

3. find_package (Qt4 REQUIRED) sets QT_LIBRARIES to a list that
contains a space-separated entry. For example:

optimized;C:/Qt/4.5.2/lib/QtOpenGL4.lib;debug;C:/Qt/4.5.2/lib/QtOpenGLd4.lib;opengl32.lib
glu32.lib gdi32.lib
user32.lib;optimized;C:/Qt/4.5.2/lib/QtGui4.lib;debug;C:/Qt/4.5.2/lib/QtGuid4.lib;imm32;winmm;optimized;C:/Qt/4.5.2/lib/QtCore4.lib;debug;C:/Qt/4.5.2/lib/QtCored4.lib;ws2_32

Note in the middle of that is "opengl32.lib glu32.lib gdi32.lib
user32.lib", with no semicolon separators.

This causes no problems for the VS9 generator, as the vcproj file's
<AdditionalDependencies> list is space-separated, anyway. However, the
VS10 generator produces a semicolon-separated list for the
<AdditionalDependencies> tag. This leads the linker to think it should
link against a file called "opengl32.lib glu32.lib gdi32.lib
user32.lib", which fails, of course.

Do these sounds like legitimate bugs, or my own problems? I didn't
find anything resembling these in Mantis.


More information about the CMake mailing list