CMakeLists.txt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # This file is part of Desktop App Toolkit,
  2. # a set of libraries for developing nice desktop applications.
  3. #
  4. # For license and copyright information please follow this link:
  5. # https://github.com/desktop-app/legal/blob/master/LEGAL
  6. if (DESKTOP_APP_USE_PACKAGED)
  7. add_library(external_vpx INTERFACE IMPORTED GLOBAL)
  8. add_library(desktop-app::external_vpx ALIAS external_vpx)
  9. find_package(PkgConfig REQUIRED)
  10. pkg_check_modules(LIBVPX IMPORTED_TARGET vpx>=1.10.0)
  11. target_link_libraries(external_vpx INTERFACE PkgConfig::LIBVPX)
  12. return()
  13. endif()
  14. add_library(external_vpx STATIC IMPORTED GLOBAL)
  15. add_library(desktop-app::external_vpx ALIAS external_vpx)
  16. if (WIN32)
  17. target_include_directories(external_vpx SYSTEM
  18. INTERFACE
  19. ${libs_loc}/local/include
  20. )
  21. if (build_winarm)
  22. set(libvpx_release_folder ARM64)
  23. elseif (build_win64)
  24. set(libvpx_release_folder x64)
  25. else()
  26. set(libvpx_release_folder Win32)
  27. endif()
  28. set(vpx_lib_loc ${libs_loc}/local/lib/${libvpx_release_folder})
  29. set_target_properties(external_vpx PROPERTIES
  30. IMPORTED_LOCATION "${vpx_lib_loc}/vpxmt.lib"
  31. IMPORTED_LOCATION_DEBUG "${vpx_lib_loc}/vpxmt.lib"
  32. )
  33. elseif (APPLE)
  34. target_include_directories(external_vpx SYSTEM
  35. INTERFACE
  36. ${libs_loc}/local/include
  37. )
  38. set_target_properties(external_vpx PROPERTIES
  39. IMPORTED_LOCATION ${libs_loc}/local/lib/libvpx.a
  40. )
  41. else()
  42. find_library(DESKTOP_APP_VPX_LIBRARIES libvpx.a REQUIRED)
  43. set_target_properties(external_vpx PROPERTIES
  44. IMPORTED_LOCATION "${DESKTOP_APP_VPX_LIBRARIES}"
  45. )
  46. endif()