CMakeLists.txt 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. add_library(uicommon
  2. AutoUpdate.cpp
  3. AutoUpdate.h
  4. CommandLineParse.cpp
  5. CommandLineParse.h
  6. DiscordPresence.cpp
  7. DiscordPresence.h
  8. GameFile.cpp
  9. GameFile.h
  10. GameFileCache.cpp
  11. GameFileCache.h
  12. NetPlayIndex.cpp
  13. NetPlayIndex.h
  14. ResourcePack/Manager.cpp
  15. ResourcePack/Manager.h
  16. ResourcePack/Manifest.cpp
  17. ResourcePack/Manifest.h
  18. ResourcePack/ResourcePack.cpp
  19. ResourcePack/ResourcePack.h
  20. UICommon.cpp
  21. UICommon.h
  22. USBUtils.cpp
  23. USBUtils.h
  24. )
  25. target_link_libraries(uicommon
  26. PUBLIC
  27. common
  28. core
  29. cpp-optparse
  30. minizip::minizip
  31. pugixml
  32. PRIVATE
  33. fmt::fmt
  34. $<$<BOOL:APPLE>:${IOK_LIBRARY}>
  35. )
  36. if ((DEFINED CMAKE_ANDROID_ARCH_ABI AND CMAKE_ANDROID_ARCH_ABI MATCHES "x86|x86_64") OR
  37. (NOT DEFINED CMAKE_ANDROID_ARCH_ABI AND _M_X86_64))
  38. target_link_libraries(uicommon PRIVATE bdisasm)
  39. endif()
  40. if(UNIX AND NOT APPLE AND NOT ANDROID AND ENABLE_QT)
  41. find_package(Qt6 REQUIRED COMPONENTS DBus)
  42. target_sources(uicommon PRIVATE DBusUtils.cpp)
  43. target_compile_definitions(uicommon PRIVATE -DHAVE_QTDBUS=1)
  44. target_link_libraries(uicommon PUBLIC Qt6::DBus)
  45. endif()
  46. if(X11_FOUND)
  47. target_sources(uicommon PRIVATE X11Utils.cpp)
  48. target_link_libraries(uicommon PUBLIC PkgConfig::XRANDR PkgConfig::X11)
  49. endif()
  50. if(TARGET LibUSB::LibUSB)
  51. target_link_libraries(uicommon PRIVATE LibUSB::LibUSB)
  52. endif()
  53. if(USE_DISCORD_PRESENCE)
  54. target_compile_definitions(uicommon PRIVATE -DUSE_DISCORD_PRESENCE)
  55. target_link_libraries(uicommon PRIVATE discord-rpc)
  56. endif()
  57. if(MSVC)
  58. # Add precompiled header
  59. target_link_libraries(uicommon PRIVATE use_pch)
  60. endif()