Can't Build VisualStudio Project with CMAKE

Bug #1294703 reported by Dan Rinkes
6
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\libfreespace-build>cmake -G "Visual Studio 10" ..\libfreespace
-- 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/libfreespace/CMakeFiles/CMakeOutput.log".
See also "C:/dev/libfreespace/CMakeFiles/CMakeError.log".

Revision history for this message
Dan Rinkes (dan-rinkes) wrote :

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.
       IF(NOT DEFINED WINDDK_DIR AND EXISTS "C:/WinDDK" AND IS_DIRECTORY "C:/WinDDK")
              FILE(GLOB WINDDK_DIR "C:/WinDDK/7*")
       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
              PATHS ${WINDDK_INCLUDE_SEARCH_DIRS} )
       SET(WINDDK_INCLUDE_DIR ${WINDDK_INCLUDE_DIR}
              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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.