I have Windows 7 64bit, CMake 3.8.1, NVidia Cuda 8.0, NVidia Video Codec SDK 7.1.9.
I have this file: C:\Windows\SysWOW64\nvEncodeAPI.dll
I have this CMake module: D:\projects\git\myProject\CMakeModules\FindNVenc.cmake
as follows...
Outline (of relevant part):
- Printing variables (sometimes environment variables after an
ENV
word) - Printing
find_library
command - Executing
find_library
command - Printing
NVenc_LIBRARY
variable
Contents as-is (of relevant part):
message(STATUS "NVenc_ROOT: ${NVenc_ROOT} ENV $ENV{NVenc_ROOT}")
message(STATUS "NVenc_INCLUDE_DIR: ${NVenc_INCLUDE_DIR} ENV $ENV{NVenc_INCLUDE_DIR}")
message(STATUS "NVenc_LIBRARY_DIR: ${NVenc_LIBRARY_DIR} ENV $ENV{NVenc_LIBRARY_DIR}")
message(STATUS "NVenc_LIBRARY_NAME: ${NVenc_LIBRARY_NAME}")
message(STATUS "find_library(NVenc_LIBRARY NAMES ${NVenc_LIBRARY_NAME} PATHS ${NVenc_LIBRARY_DIR} $ENV{NVenc_LIBRARY_DIR} ${NVenc_ROOT} $ENV{NVenc_ROOT} PATH_SUFFIXES lib NO_DEFAULT_PATH)")
find_library(NVenc_LIBRARY NAMES ${NVenc_LIBRARY_NAME}
PATHS ${NVenc_LIBRARY_DIR} $ENV{NVenc_LIBRARY_DIR} ${NVenc_ROOT} $ENV{NVenc_ROOT}
PATH_SUFFIXES lib
NO_DEFAULT_PATH)
message(STATUS "NVenc_LIBRARY: ${NVenc_LIBRARY}")
The output is
-- NVenc_ROOT: ENV D:\projects\git\libs
-- NVenc_INCLUDE_DIR: D:/projects/git/libs ENV
-- NVenc_LIBRARY_DIR: ENV C:\Windows\SysWOW64
-- NVenc_LIBRARY_NAME: nvEncodeAPI
-- find_library(NVenc_LIBRARY nvEncodeAPI PATHS C:\Windows\SysWOW64 D:\projects\git\libs PATH_SUFFIXES lib NO_DEFAULT_PATH)
-- NVenc_LIBRARY: NVenc_LIBRARY-NOTFOUND
Which means that the find_library
command did not find the file I have. This CMake module is working perfectly on Linux. (Worked until I started to alter it on Windows. Now I really don't know, but I think it still should work. Will fix If I broke it.)
Do I have a typo somewhere? Is there something that I don't get about find_library
?