You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. include_directories(${FLTK_INCLUDE_DIR})
  2. include_directories(${GETTEXT_INCLUDE_DIR})
  3. include_directories(${CMAKE_SOURCE_DIR}/common)
  4. set(VNCVIEWER_SOURCES
  5. menukey.cxx
  6. CConn.cxx
  7. DesktopWindow.cxx
  8. UserDialog.cxx
  9. ServerDialog.cxx
  10. Surface.cxx
  11. OptionsDialog.cxx
  12. PlatformPixelBuffer.cxx
  13. Viewport.cxx
  14. parameters.cxx
  15. keysym2ucs.c
  16. vncviewer.cxx)
  17. if(WIN32)
  18. # Since vncviewer.rc is generated, local includes will be looking
  19. # in the wrong directory. We need to help it out.
  20. include_directories(${CMAKE_CURRENT_SOURCE_DIR})
  21. configure_file(vncviewer.rc.in vncviewer.rc)
  22. set(VNCVIEWER_SOURCES
  23. ${VNCVIEWER_SOURCES}
  24. ${CMAKE_CURRENT_BINARY_DIR}/vncviewer.rc)
  25. endif()
  26. if(WIN32)
  27. set(VNCVIEWER_SOURCES ${VNCVIEWER_SOURCES} win32.c)
  28. elseif(APPLE)
  29. set(VNCVIEWER_SOURCES ${VNCVIEWER_SOURCES} cocoa.mm osx_to_qnum.c)
  30. else()
  31. set(VNCVIEWER_SOURCES ${VNCVIEWER_SOURCES} xkb_to_qnum.c)
  32. endif()
  33. if(WIN32)
  34. set(VNCVIEWER_SOURCES ${VNCVIEWER_SOURCES} Surface_Win32.cxx)
  35. elseif(APPLE)
  36. set(VNCVIEWER_SOURCES ${VNCVIEWER_SOURCES} Surface_OSX.cxx)
  37. else()
  38. set(VNCVIEWER_SOURCES ${VNCVIEWER_SOURCES} Surface_X11.cxx)
  39. endif()
  40. if(WIN32 AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
  41. add_executable(vncviewer WIN32 ${VNCVIEWER_SOURCES})
  42. else()
  43. add_executable(vncviewer ${VNCVIEWER_SOURCES})
  44. endif()
  45. target_link_libraries(vncviewer rfb network rdr os ${FLTK_LIBRARIES} ${GETTEXT_LIBRARIES})
  46. if(WIN32)
  47. target_link_libraries(vncviewer msimg32)
  48. endif()
  49. if(APPLE)
  50. target_link_libraries(vncviewer "-framework Cocoa")
  51. target_link_libraries(vncviewer "-framework Carbon")
  52. target_link_libraries(vncviewer "-framework IOKit")
  53. endif()
  54. install(TARGETS vncviewer DESTINATION ${BIN_DIR})
  55. if(UNIX)
  56. install(FILES vncviewer.man DESTINATION ${MAN_DIR}/man1 RENAME vncviewer.1)
  57. configure_file(vncviewer.desktop.in.in vncviewer.desktop.in)
  58. find_program(INTLTOOL_MERGE_EXECUTABLE intltool-merge)
  59. if("${GETTEXT_VERSION_STRING}" VERSION_GREATER 0.18.99)
  60. add_custom_command(OUTPUT vncviewer.desktop
  61. COMMAND ${GETTEXT_MSGFMT_EXECUTABLE}
  62. --desktop --template vncviewer.desktop.in
  63. -d ${CMAKE_SOURCE_DIR}/po -o vncviewer.desktop
  64. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vncviewer.desktop.in
  65. )
  66. elseif(INTLTOOL_MERGE_EXECUTABLE)
  67. add_custom_command(OUTPUT vncviewer.desktop
  68. COMMAND sed -e 's/^Name/_Name/'
  69. -e 's/^GenericName/_GenericName/'
  70. -e 's/^Comment/_Comment/'
  71. vncviewer.desktop.in > vncviewer.desktop.intl
  72. COMMAND ${INTLTOOL_MERGE_EXECUTABLE}
  73. -d ${CMAKE_SOURCE_DIR}/po
  74. vncviewer.desktop.intl vncviewer.desktop
  75. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vncviewer.desktop.in
  76. )
  77. else()
  78. add_custom_command(OUTPUT vncviewer.desktop
  79. COMMAND cp vncviewer.desktop.in vncviewer.desktop
  80. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vncviewer.desktop.in
  81. )
  82. endif()
  83. add_custom_target(desktop ALL DEPENDS vncviewer.desktop)
  84. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/vncviewer.desktop DESTINATION ${DATA_DIR}/applications)
  85. foreach(res 16 22 24 32 48)
  86. install(FILES ../media/icons/tigervnc_${res}.png DESTINATION ${DATA_DIR}/icons/hicolor/${res}x${res}/apps RENAME tigervnc.png)
  87. endforeach()
  88. install(FILES ../media/icons/tigervnc.svg DESTINATION ${DATA_DIR}/icons/hicolor/scalable/apps)
  89. endif()