have_cnstream_target.cmake 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. macro(have_framework_target cnstream_root_path)
  2. if(TARGET cnstream_core)
  3. set(HAVE_FRAMEWORK_TARGET TRUE)
  4. else()
  5. if(NOT EXISTS ${cnstream_root_path}/lib/libcnstream_core.so)
  6. message(FATAL_ERROR "Build framework first")
  7. endif()
  8. link_directories(${cnstream_root_path}/lib)
  9. endif()
  10. include_directories(${cnstream_root_path}/framework/core/include)
  11. endmacro()
  12. macro(have_easydk_target cnstream_root_path)
  13. if(TARGET easydk)
  14. set(HAVE_EASYDK_TARGET TRUE)
  15. else()
  16. if(NOT EXISTS ${cnstream_root_path}/easydk/lib/libeasydk.so)
  17. message(FATAL_ERROR "Build easydk first")
  18. endif()
  19. link_directories(${cnstream_root_path}/easydk/lib)
  20. endif()
  21. include_directories(${cnstream_root_path}/easydk/include)
  22. include_directories(${cnstream_root_path}/easydk/infer_server/include)
  23. include_directories(${cnstream_root_path}/easydk/infer_server/contrib)
  24. endmacro()
  25. macro(have_modules_target cnstream_root_path)
  26. if(TARGET cnstream_va)
  27. set(HAVE_MODULES_TARGET TRUE)
  28. else()
  29. if(NOT EXISTS ${cnstream_root_path}/lib/libcnstream_va.so)
  30. message(FATAL_ERROR "Build modules first")
  31. endif()
  32. link_directories(${cnstream_root_path}/lib)
  33. endif()
  34. endmacro()
  35. macro(have_modules_contrib_target cnstream_root_path)
  36. if(TARGET cnstream_contrib)
  37. set(HAVE_MODULES_CONTRIB_TARGET TRUE)
  38. set(HAVE_MODULES_CONTRIB TRUE)
  39. else()
  40. if(EXISTS ${cnstream_root_path}/lib/libcnstream_contrib.so)
  41. set(HAVE_MODULES_CONTRIB TRUE)
  42. link_directories(${cnstream_root_path}/lib)
  43. endif()
  44. endif()
  45. endmacro()