Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

CMakeLists.txt 5.3KB

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