[CMake] INCLUDE_DIRECTORIES and $(VCInstallDir)

Stefan Buschmann s_buschmann at gmx.de
Thu Oct 18 16:52:54 EDT 2007


Hi all,

I'm trying to build a project that uses DirectX 9. To compile correctly, 
the include path order must be adjusted so that the Platform SDK is 
prefered over the DirectX include directories. This is done by setting 
the include directories to:
  $(VCInstallDir)PlatformSDK/include
  external/win32/dx_9/Include/

So I tried to do this in cmake:
  INCLUDE_DIRECTORIES(
    $(VCInstallDir)/PlatformSDK/include
    external/win32/dx_9/Include
  )

But as cmake thinks this is a relative path, this is extended to 
${CMAKE_CURRENT_SOURCE_DIR}\$(VCInstallDir) (e.g. 
"C:\Project\$(VCInstallDir)"). Is there a way to prevent the string from 
being extended, although it is not an absolute path?

Another solution would be to find the path to the VC installation 
directory at cmake-time and use that instead of "$(VCInstallDir)". But I 
could not find any cmake-variable that contains the path to the VC 
installation directory (CMakeCache.txt contains only "cl.exe", but 
without any path information).

Thanks,

Stefan



More information about the CMake mailing list