CMakeLists.txt 6.3 KB

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