search in env var CUDA_NPP_ROOT
authorAnatoly Baksheev <no@email>
Fri, 24 Sep 2010 12:01:26 +0000 (12:01 +0000)
committerAnatoly Baksheev <no@email>
Fri, 24 Sep 2010 12:01:26 +0000 (12:01 +0000)
modules/gpu/FindNPP.cmake

index 9cdf31f..7378589 100644 (file)
@@ -55,12 +55,13 @@ else(${CMAKE_SIZEOF_VOID_P} EQUAL 4)
        endif()\r
 endif(${CMAKE_SIZEOF_VOID_P} EQUAL 4)\r
 \r
-if(NOT CUDA_NPP_LIBRARY_ROOT_DIR)\r
-       find_path(CUDA_NPP_LIBRARY_ROOT_DIR common/npp/include/npp.h DOC "NPP root directory." NO_DEFAULT_PATH)           \r
+if(NOT CUDA_NPP_LIBRARY_ROOT_DIR)      \r
+       set(CUDA_NPP_LIBRARY_ROOT_DIR $ENV{CUDA_NPP_ROOT} CACHE PATH "NPP root directory." FORCE)       \r
+       find_path(CUDA_NPP_LIBRARY_ROOT_DIR "common/npp/include/npp.h" PATHS ENV CUDA_NPP_ROOT DOC "NPP root directory.")       \r
 endif (NOT CUDA_NPP_LIBRARY_ROOT_DIR)\r
 \r
 # Search includes in our own paths.\r
-find_path(CUDA_NPP_INCLUDES npp.h PATHS "${CUDA_NPP_LIBRARY_ROOT_DIR}/common/npp/include" NO_DEFAULT_PATH)\r
+find_path(CUDA_NPP_INCLUDES npp.h PATHS "${CUDA_NPP_LIBRARY_ROOT_DIR}/common/npp/include")\r
 # Search default search paths, after we search our own set of paths.\r
 find_path(CUDA_NPP_INCLUDES device_functions.h)\r
 mark_as_advanced(CUDA_NPP_INCLUDES)
@@ -69,8 +70,7 @@ mark_as_advanced(CUDA_NPP_INCLUDES)
 find_library(CUDA_NPP_LIBRARIES\r
        NAMES npp${NPP_SUFFIX} libnpp${NPP_SUFFIX}\r
        PATHS "${CUDA_NPP_LIBRARY_ROOT_DIR}/common/lib"    \r
-       DOC "NPP library"\r
-       NO_DEFAULT_PATH\r
+       DOC "NPP library"       \r
        )
 \r
 # Search default search paths, after we search our own set of paths.\r