CMakeLists.txt 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
  2. add_sources_from_current_dir(utils
  3. utils/agent_mutex_name.c
  4. utils/agent_named_pipe_name.c
  5. utils/arm_arch_queries.c
  6. utils/aux_match_opt.c
  7. utils/centre_window.c
  8. utils/cryptoapi.c
  9. utils/defaults.c
  10. utils/dll_hijacking_protection.c
  11. utils/dputs.c
  12. utils/escape_registry_key.c
  13. utils/filename.c
  14. utils/fontspec.c
  15. utils/getdlgitemtext_alloc.c
  16. utils/get_system_dir.c
  17. utils/get_username.c
  18. utils/gui-timing.c
  19. utils/interprocess_mutex.c
  20. utils/is_console_handle.c
  21. utils/load_system32_dll.c
  22. utils/ltime.c
  23. utils/makedlgitemborderless.c
  24. utils/make_spr_sw_abort_winerror.c
  25. utils/message_box.c
  26. utils/minefield.c
  27. utils/open_for_write_would_lose_data.c
  28. utils/pgp_fingerprints_msgbox.c
  29. utils/platform_get_x_display.c
  30. utils/registry.c
  31. utils/request_file.c
  32. utils/screenshot.c
  33. utils/security.c
  34. utils/shinydialogbox.c
  35. utils/split_into_argv.c
  36. utils/split_into_argv_w.c
  37. utils/version.c
  38. utils/win_strerror.c
  39. unicode.c)
  40. if(NOT HAVE_STRTOUMAX)
  41. add_sources_from_current_dir(utils utils/strtoumax.c)
  42. endif()
  43. add_sources_from_current_dir(eventloop
  44. cliloop.c handle-wait.c)
  45. add_sources_from_current_dir(console
  46. select-cli.c nohelp.c console.c)
  47. add_sources_from_current_dir(settings
  48. storage.c)
  49. add_sources_from_current_dir(network
  50. network.c handle-socket.c named-pipe-client.c named-pipe-server.c local-proxy.c x11.c)
  51. add_sources_from_current_dir(sshcommon
  52. noise.c)
  53. add_sources_from_current_dir(sshclient
  54. agent-client.c gss.c sharing.c)
  55. add_sources_from_current_dir(sftpclient
  56. sftp.c)
  57. add_sources_from_current_dir(otherbackends
  58. serial.c)
  59. add_sources_from_current_dir(agent
  60. agent-client.c)
  61. add_sources_from_current_dir(guiterminal
  62. dialog.c controls.c config.c printing.c jump-list.c sizetip.c)
  63. add_dependencies(guiterminal generated_licence_h) # dialog.c uses licence.h
  64. # This object awkwardly needs to live in the network library as well
  65. # as the eventloop library, in case it didn't get pulled in from the
  66. # latter before handle-socket.c needed it.
  67. add_library(handle-io OBJECT
  68. handle-io.c)
  69. target_sources(eventloop PRIVATE $<TARGET_OBJECTS:handle-io>)
  70. target_sources(network PRIVATE $<TARGET_OBJECTS:handle-io>)
  71. add_library(guimisc STATIC
  72. select-gui.c)
  73. add_executable(pageant
  74. pageant.c
  75. help.c
  76. pageant.rc)
  77. add_dependencies(pageant generated_licence_h)
  78. target_link_libraries(pageant
  79. guimisc eventloop agent network crypto utils
  80. ${platform_libraries})
  81. set_target_properties(pageant PROPERTIES
  82. WIN32_EXECUTABLE ON
  83. LINK_FLAGS "${LFLAG_MANIFEST_NO}")
  84. installed_program(pageant)
  85. add_sources_from_current_dir(plink no-jump-list.c nohelp.c plink.rc)
  86. add_dependencies(plink generated_licence_h)
  87. add_sources_from_current_dir(pscp no-jump-list.c nohelp.c pscp.rc)
  88. add_dependencies(pscp generated_licence_h)
  89. add_sources_from_current_dir(psftp no-jump-list.c nohelp.c psftp.rc)
  90. add_dependencies(psftp generated_licence_h)
  91. add_sources_from_current_dir(psocks nohelp.c)
  92. add_executable(putty
  93. window.c
  94. putty.c
  95. help.c
  96. ${CMAKE_SOURCE_DIR}/stubs/no-console.c
  97. putty.rc)
  98. be_list(putty PuTTY SSH SERIAL OTHERBACKENDS)
  99. add_dependencies(putty generated_licence_h)
  100. target_link_libraries(putty
  101. guiterminal guimisc eventloop sshclient otherbackends settings network crypto
  102. utils
  103. ${platform_libraries})
  104. set_target_properties(putty PROPERTIES
  105. WIN32_EXECUTABLE ON
  106. LINK_FLAGS "${LFLAG_MANIFEST_NO}")
  107. installed_program(putty)
  108. add_executable(puttytel
  109. window.c
  110. putty.c
  111. help.c
  112. ${CMAKE_SOURCE_DIR}/stubs/no-gss.c
  113. ${CMAKE_SOURCE_DIR}/stubs/no-ca-config.c
  114. ${CMAKE_SOURCE_DIR}/stubs/no-console.c
  115. ${CMAKE_SOURCE_DIR}/stubs/no-rand.c
  116. ${CMAKE_SOURCE_DIR}/proxy/nocproxy.c
  117. ${CMAKE_SOURCE_DIR}/proxy/nosshproxy.c
  118. puttytel.rc)
  119. be_list(puttytel PuTTYtel SERIAL OTHERBACKENDS)
  120. add_dependencies(puttytel generated_licence_h)
  121. target_link_libraries(puttytel
  122. guiterminal guimisc eventloop otherbackends settings network utils
  123. ${platform_libraries})
  124. set_target_properties(puttytel PROPERTIES
  125. WIN32_EXECUTABLE ON
  126. LINK_FLAGS "${LFLAG_MANIFEST_NO}")
  127. installed_program(puttytel)
  128. add_executable(puttygen
  129. puttygen.c
  130. ${CMAKE_SOURCE_DIR}/stubs/no-timing.c
  131. noise.c
  132. no-jump-list.c
  133. storage.c
  134. help.c
  135. ${CMAKE_SOURCE_DIR}/sshpubk.c
  136. ${CMAKE_SOURCE_DIR}/sshrand.c
  137. controls.c
  138. puttygen.rc)
  139. add_dependencies(puttygen generated_licence_h)
  140. target_link_libraries(puttygen
  141. keygen guimisc crypto utils
  142. ${platform_libraries})
  143. set_target_properties(puttygen PROPERTIES
  144. WIN32_EXECUTABLE ON
  145. LINK_FLAGS "${LFLAG_MANIFEST_NO}")
  146. installed_program(puttygen)
  147. if(HAVE_CONPTY)
  148. add_executable(pterm
  149. window.c
  150. pterm.c
  151. help.c
  152. conpty.c
  153. ${CMAKE_SOURCE_DIR}/stubs/no-gss.c
  154. ${CMAKE_SOURCE_DIR}/stubs/no-ca-config.c
  155. ${CMAKE_SOURCE_DIR}/stubs/no-console.c
  156. ${CMAKE_SOURCE_DIR}/stubs/no-rand.c
  157. ${CMAKE_SOURCE_DIR}/proxy/nosshproxy.c
  158. pterm.rc)
  159. be_list(pterm pterm)
  160. add_dependencies(pterm generated_licence_h)
  161. target_link_libraries(pterm
  162. guiterminal guimisc eventloop settings network utils
  163. ${platform_libraries})
  164. set_target_properties(pterm PROPERTIES
  165. WIN32_EXECUTABLE ON
  166. LINK_FLAGS "${LFLAG_MANIFEST_NO}")
  167. installed_program(pterm)
  168. else()
  169. message("ConPTY not available; cannot build Windows pterm")
  170. endif()
  171. add_executable(test_split_into_argv
  172. test/test_split_into_argv.c)
  173. target_compile_definitions(test_split_into_argv PRIVATE TEST)
  174. target_link_libraries(test_split_into_argv utils ${platform_libraries})
  175. add_executable(test_screenshot
  176. test/test_screenshot.c)
  177. target_link_libraries(test_screenshot utils ${platform_libraries})
  178. add_executable(test_lineedit
  179. ${CMAKE_SOURCE_DIR}/test/test_lineedit.c
  180. ${CMAKE_SOURCE_DIR}/stubs/no-gss.c
  181. ${CMAKE_SOURCE_DIR}/stubs/no-logging.c
  182. ${CMAKE_SOURCE_DIR}/stubs/no-printing.c
  183. ${CMAKE_SOURCE_DIR}/stubs/no-storage.c
  184. ${CMAKE_SOURCE_DIR}/stubs/no-timing.c
  185. no-jump-list.c)
  186. target_link_libraries(test_lineedit
  187. guiterminal settings eventloop utils ${platform_libraries})
  188. add_executable(test_terminal
  189. ${CMAKE_SOURCE_DIR}/test/test_terminal.c
  190. ${CMAKE_SOURCE_DIR}/stubs/no-gss.c
  191. ${CMAKE_SOURCE_DIR}/stubs/no-storage.c
  192. ${CMAKE_SOURCE_DIR}/stubs/no-timing.c
  193. no-jump-list.c)
  194. target_link_libraries(test_terminal
  195. guiterminal settings eventloop utils ${platform_libraries})
  196. add_sources_from_current_dir(test_conf no-jump-list.c handle-wait.c)