detect_ximea.cmake 960 B

123456789101112131415161718192021222324252627282930
  1. if(NOT HAVE_XIMEA)
  2. if(WIN32)
  3. get_filename_component(regpath "[HKEY_CURRENT_USER\\Software\\XIMEA\\CamSupport\\API;Path]" ABSOLUTE)
  4. if(NOT EXISTS ${regpath})
  5. get_filename_component(regpath "[HKEY_LOCAL_MACHINE\\SOFTWARE\\XIMEA\\API_SoftwarePackage;Path]" ABSOLUTE)
  6. endif()
  7. endif()
  8. if(X86_64)
  9. set(lib_dir "API/x64" "API/64bit")
  10. set(lib_suffix "64")
  11. else()
  12. set(lib_dir "API/x86" "API/32bit")
  13. set(lib_suffix "32")
  14. endif()
  15. find_path(XIMEA_INCLUDE "xiApi.h"
  16. PATHS "${XIMEA_ROOT}" ENV XIMEA_ROOT "/opt/XIMEA"
  17. HINTS "${regpath}"
  18. PATH_SUFFIXES "include" "API")
  19. find_library(XIMEA_LIBRARY m3api xiapi${lib_suffix}
  20. PATHS "${XIMEA_ROOT}" ENV XIMEA_ROOT "/opt/XIMEA"
  21. HINTS "${regpath}"
  22. PATH_SUFFIXES ${lib_dir})
  23. if(XIMEA_INCLUDE AND XIMEA_LIBRARY)
  24. set(HAVE_XIMEA TRUE)
  25. endif()
  26. endif()
  27. if(HAVE_XIMEA)
  28. ocv_add_external_target(ximea "${XIMEA_INCLUDE}" "${XIMEA_LIBRARY}" "HAVE_XIMEA")
  29. endif()