How do I make CMake prefer one include directory over another?
A follow up from...
- How do I make VS2010 prefer one include directory over another?
... how do I make CMake generate a VS2010 project which prefers one include directory over another? In my case, I need it to prefer the DirectX input dir ove开发者_Python百科r the Windows SDK dir.
OK, looks like this is the way to do it, though not ideal:
First, create a DXSDK_DIR environment variable with the DX SDK path, e.g.: C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)
Then, add the following lines to your CMakeLists.txt file:
include_directories($ENV{DXSDK_DIR}/Include)
link_directories("$ENV{DXSDK_DIR}/Lib/x86")
Like I said, not ideal as it doesn't use the VS macro, but I guess that's CMake for you. I welcome anyone to suggest a better way.
精彩评论