FindNVTT.cmake 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Find nvtt dependency
  2. #
  3. # This module defines
  4. # nvtt_INCLUDE_DIRS
  5. # nvtt_LIBRARIES
  6. # nvtt_FOUND
  7. set(nvtt_INSTALL_DIR ${PROJECT_SOURCE_DIR}/../Dependencies/nvtt CACHE PATH "")
  8. set(nvtt_INCLUDE_SEARCH_DIRS "${nvtt_INSTALL_DIR}/include")
  9. if(BS_64BIT)
  10. list(APPEND nvtt_LIBRARY_RELEASE_SEARCH_DIRS "${nvtt_INSTALL_DIR}/lib/x64/Release")
  11. list(APPEND nvtt_LIBRARY_DEBUG_SEARCH_DIRS "${nvtt_INSTALL_DIR}/lib/x64/Debug")
  12. else()
  13. list(APPEND nvtt_LIBRARY_RELEASE_SEARCH_DIRS "${nvtt_INSTALL_DIR}/lib/x86/Release")
  14. list(APPEND nvtt_LIBRARY_DEBUG_SEARCH_DIRS "${nvtt_INSTALL_DIR}/lib/x86/Debug")
  15. endif()
  16. message(STATUS "Looking for NVTT installation...")
  17. find_path(nvtt_INCLUDE_DIR nvtt.h PATHS ${nvtt_INCLUDE_SEARCH_DIRS})
  18. if(nvtt_INCLUDE_DIR)
  19. set(nvtt_FOUND TRUE)
  20. else()
  21. set(nvtt_FOUND FALSE)
  22. endif()
  23. find_imported_library(nvtt nvtt)
  24. find_imported_library(nvtt bc6h)
  25. find_imported_library(nvtt bc7)
  26. find_imported_library(nvtt nvcore)
  27. find_imported_library(nvtt nvimage)
  28. find_imported_library(nvtt nvmath)
  29. find_imported_library(nvtt nvthread)
  30. find_imported_library(nvtt squish)
  31. if(NOT nvtt_FOUND)
  32. if(nvtt_FIND_REQUIRED)
  33. message(FATAL_ERROR "Cannot find nvtt installation. Try modifying the nvtt_INSTALL_DIR path.")
  34. elseif(NOT nvtt_FIND_QUIETLY)
  35. message(WARNING "Cannot find nvtt installation. Try modifying the nvtt_INSTALL_DIR path.")
  36. endif()
  37. else()
  38. set_target_properties(nvtt::nvtt PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${nvtt_INCLUDE_DIR}")
  39. message(STATUS "...nvtt OK.")
  40. endif()
  41. mark_as_advanced(nvtt_INSTALL_DIR nvtt_INCLUDE_DIR)
  42. set(nvtt_INCLUDE_DIRS ${nvtt_INCLUDE_DIR})