Can't Build VisualStudio Project with CMAKE
Bug #1294703 reported by
Dan Rinkes
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libfreespace |
New
|
Undecided
|
Khalid Zubair |
Bug Description
When trying to build a Visual Studio project, CMAKE returns an error like this.
C:\dev\
-- WinDDK in
CMake Error at CMakeLists.txt:170 (message):
Could not locate hid.lib
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
WINDDK_INCLUDE_DIR (ADVANCED)
used as include directory in directory C:/dev/libfreespace
-- Configuring incomplete, errors occurred!
See also "C:/dev/
See also "C:/dev/
To post a comment you must log in.
Some notes taken while investigating. These refer to the file FindWinDDK.cmake.
The line below is part of the problem. On, Windows, the “IS_DIRECTORY” function fails if the directory is actually a symbolic link. So, if you have a symbolic link from C:\WinDDK, WINDDK_DIR is not going to get set here.
FILE(GLOB WINDDK_DIR "C:/WinDDK/7*")
IF(NOT DEFINED WINDDK_DIR AND EXISTS "C:/WinDDK" AND IS_DIRECTORY "C:/WinDDK")
ENDIF()
Also, even when the above does pass, I think it’s a problem. There are two directories that will match this, C:\WinDDK\ 7600.16385. 0 and C:\WinDDK\ 7600.16385. 1. WINDDK_DIR gets set to “C:/WinDDK/ 7600.16385. 0;C:/WinDDK/ 7600.16385. 1” Then, it uses this value to try to resolve WINDDK_ INCLUDE_ SEARCH_ DIRS and eventually WINDDK_INCLUDE_DIR.
# Search for header files
SET(WINDDK_ INCLUDE_ SEARCH_ DIRS ${WINDDK_DIR}/inc )
FIND_PATH( WINDDK_ INCLUDE_ DIR api/hidpi.h INCLUDE_ SEARCH_ DIRS} )
SET(WINDDK_ INCLUDE_ DIR ${WINDDK_ INCLUDE_ DIR}
PATHS ${WINDDK_
CACHE STRING "Directory containing Ms WinDDK header files")
At some point, after the list of DDK directories is created, it needs to somehow choose one revision to use.