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.4KB

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