您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

CMakeLists.txt 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. add_executable(vncviewer
  2. fltk/Fl_Monitor_Arrangement.cxx
  3. fltk/Fl_Navigation.cxx
  4. fltk/theme.cxx
  5. menukey.cxx
  6. BaseTouchHandler.cxx
  7. CConn.cxx
  8. DesktopWindow.cxx
  9. EmulateMB.cxx
  10. UserDialog.cxx
  11. ServerDialog.cxx
  12. Surface.cxx
  13. OptionsDialog.cxx
  14. PlatformPixelBuffer.cxx
  15. Viewport.cxx
  16. parameters.cxx
  17. keysym2ucs.c
  18. touch.cxx
  19. MonitorIndicesParameter.cxx
  20. vncviewer.cxx)
  21. if(WIN32 AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
  22. set_target_properties(vncviewer PROPERTIES WIN32_EXECUTABLE TRUE)
  23. endif()
  24. if(WIN32)
  25. # Since vncviewer.rc is generated, local includes will be looking
  26. # in the wrong directory. We need to help it out.
  27. target_include_directories(vncviewer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
  28. configure_file(vncviewer.rc.in vncviewer.rc)
  29. target_sources(vncviewer PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/vncviewer.rc)
  30. endif()
  31. if(WIN32)
  32. target_sources(vncviewer PRIVATE Win32TouchHandler.cxx win32.c)
  33. elseif(APPLE)
  34. target_sources(vncviewer PRIVATE cocoa.mm osx_to_qnum.c)
  35. else()
  36. target_sources(vncviewer PRIVATE GestureHandler.cxx XInputTouchHandler.cxx xkb_to_qnum.c)
  37. endif()
  38. if(WIN32)
  39. target_sources(vncviewer PRIVATE Surface_Win32.cxx)
  40. elseif(APPLE)
  41. target_sources(vncviewer PRIVATE Surface_OSX.cxx)
  42. else()
  43. target_sources(vncviewer PRIVATE Surface_X11.cxx)
  44. endif()
  45. target_include_directories(vncviewer SYSTEM PUBLIC ${FLTK_INCLUDE_DIR})
  46. target_include_directories(vncviewer SYSTEM PUBLIC ${GETTEXT_INCLUDE_DIR})
  47. target_include_directories(vncviewer PUBLIC ${CMAKE_SOURCE_DIR}/common)
  48. target_link_libraries(vncviewer rfb network rdr os ${FLTK_LIBRARIES} ${GETTEXT_LIBRARIES})
  49. if(WIN32)
  50. target_link_libraries(vncviewer msimg32)
  51. elseif(APPLE)
  52. target_link_libraries(vncviewer "-framework Cocoa")
  53. target_link_libraries(vncviewer "-framework Carbon")
  54. target_link_libraries(vncviewer "-framework IOKit")
  55. else()
  56. target_link_libraries(vncviewer ${X11_Xi_LIB})
  57. if(X11_Xrandr_LIB)
  58. add_definitions(-DHAVE_XRANDR)
  59. target_link_libraries(vncviewer ${X11_Xrandr_LIB})
  60. endif()
  61. endif()
  62. install(TARGETS vncviewer DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
  63. if(UNIX)
  64. install(FILES vncviewer.man DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1 RENAME vncviewer.1)
  65. file(STRINGS ${CMAKE_SOURCE_DIR}/po/LINGUAS LINGUAS)
  66. set(po_FILES "")
  67. foreach(lang ${LINGUAS})
  68. list(APPEND po_FILES "${CMAKE_SOURCE_DIR}/po/${lang}.po")
  69. endforeach()
  70. configure_file(vncviewer.desktop.in.in vncviewer.desktop.in)
  71. find_program(INTLTOOL_MERGE_EXECUTABLE intltool-merge)
  72. if("${GETTEXT_VERSION_STRING}" VERSION_GREATER 0.18.99)
  73. add_custom_command(OUTPUT vncviewer.desktop
  74. COMMAND ${GETTEXT_MSGFMT_EXECUTABLE}
  75. --desktop --template vncviewer.desktop.in
  76. -d ${CMAKE_SOURCE_DIR}/po -o vncviewer.desktop
  77. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vncviewer.desktop.in
  78. ${po_FILES}
  79. )
  80. elseif(INTLTOOL_MERGE_EXECUTABLE)
  81. add_custom_command(OUTPUT vncviewer.desktop
  82. COMMAND sed -e 's/^Name/_Name/'
  83. -e 's/^GenericName/_GenericName/'
  84. -e 's/^Comment/_Comment/'
  85. vncviewer.desktop.in > vncviewer.desktop.intl
  86. COMMAND ${INTLTOOL_MERGE_EXECUTABLE}
  87. -d ${CMAKE_SOURCE_DIR}/po
  88. vncviewer.desktop.intl vncviewer.desktop
  89. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vncviewer.desktop.in
  90. ${po_FILES}
  91. )
  92. else()
  93. add_custom_command(OUTPUT vncviewer.desktop
  94. COMMAND cp vncviewer.desktop.in vncviewer.desktop
  95. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vncviewer.desktop.in
  96. )
  97. endif()
  98. add_custom_target(desktop ALL DEPENDS vncviewer.desktop)
  99. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/vncviewer.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/applications)
  100. if("${GETTEXT_VERSION_STRING}" VERSION_GREATER 0.19.6)
  101. add_custom_command(OUTPUT org.tigervnc.vncviewer.metainfo.xml
  102. COMMAND ${GETTEXT_MSGFMT_EXECUTABLE}
  103. --xml --template ${CMAKE_CURRENT_SOURCE_DIR}/org.tigervnc.vncviewer.metainfo.xml.in
  104. -d ${CMAKE_SOURCE_DIR}/po -o org.tigervnc.vncviewer.metainfo.xml
  105. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/org.tigervnc.vncviewer.metainfo.xml.in
  106. ${po_FILES}
  107. )
  108. elseif(INTLTOOL_MERGE_EXECUTABLE)
  109. add_custom_command(OUTPUT org.tigervnc.vncviewer.metainfo.xml
  110. COMMAND sed -e 's@<name>@<_name>@\;s@</name>@</_name>@'
  111. -e 's@<summary>@<_summary>@\;s@</summary>@</_summary>@'
  112. -e 's@<caption>@<_caption>@\;s@</caption>@</_caption>@'
  113. -e 's@<p>@<_p>@g\;s@</p>@</_p>@g'
  114. ${CMAKE_CURRENT_SOURCE_DIR}/org.tigervnc.vncviewer.metainfo.xml.in > org.tigervnc.vncviewer.metainfo.xml.intl
  115. COMMAND ${INTLTOOL_MERGE_EXECUTABLE}
  116. -x ${CMAKE_SOURCE_DIR}/po
  117. org.tigervnc.vncviewer.metainfo.xml.intl org.tigervnc.vncviewer.metainfo.xml
  118. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/org.tigervnc.vncviewer.metainfo.xml.in
  119. ${po_FILES}
  120. )
  121. else()
  122. add_custom_command(OUTPUT org.tigervnc.vncviewer.metainfo.xml
  123. COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/org.tigervnc.vncviewer.metainfo.xml.in org.tigervnc.vncviewer.metainfo.xml
  124. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/org.tigervnc.vncviewer.metainfo.xml.in
  125. )
  126. endif()
  127. add_custom_target(appstream ALL DEPENDS org.tigervnc.vncviewer.metainfo.xml)
  128. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.tigervnc.vncviewer.metainfo.xml DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/metainfo)
  129. foreach(res 16 22 24 32 48 64 128)
  130. install(FILES ../media/icons/tigervnc_${res}.png DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/${res}x${res}/apps RENAME tigervnc.png)
  131. endforeach()
  132. install(FILES ../media/icons/tigervnc.svg DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/scalable/apps)
  133. endif()