mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 09:27:59 +00:00
31f496b59c
The standalone separate doc/Makefile is gone, replaced by a CMakeLists.txt that makes 'doc' function as a subdirectory of the main CMake build system. This auto-detects Halibut, and if it's present, uses it to build the man pages and the various forms of the main manual, including the Windows CHM help file in particular. One awkward thing I had to do was to move just one config directive in blurb.but into its own file: the one that cites a relative path to the stylesheet file to put into the CHM. CMake builds often like to be out-of-tree, so there's no longer a fixed relative path between the build directory and chm.css. And Halibut has no concept of an include path to search for files cited by other files, so I can't fix that with an -I option on the Halibut command line. So I moved that single config directive into its own file, and had CMake write out a custom version of that file in the build directory citing the right path. (Perhaps in the longer term I should fix that omission in Halibut; out-of-tree friendliness seems like a useful feature. But even if I do, I still need this build to work now.)
120 lines
2.7 KiB
CMake
120 lines
2.7 KiB
CMake
cmake_minimum_required(VERSION 3.12)
|
|
project(putty LANGUAGES C)
|
|
|
|
include(cmake/setup.cmake)
|
|
|
|
add_subdirectory(doc)
|
|
|
|
add_compile_definitions(HAVE_CMAKE_H)
|
|
|
|
add_library(utils STATIC
|
|
${GENERATED_COMMIT_C})
|
|
add_dependencies(utils cmake_commit_c)
|
|
add_subdirectory(utils)
|
|
|
|
add_library(logging OBJECT
|
|
logging.c)
|
|
|
|
add_library(eventloop STATIC
|
|
callback.c timing.c)
|
|
|
|
add_library(console STATIC
|
|
clicons.c console.c)
|
|
|
|
add_library(settings STATIC
|
|
cmdline.c settings.c)
|
|
|
|
add_library(crypto STATIC
|
|
cproxy.c)
|
|
add_subdirectory(crypto)
|
|
|
|
add_library(network STATIC
|
|
be_misc.c nullplug.c errsock.c proxy.c logging.c x11disp.c)
|
|
|
|
add_library(keygen STATIC
|
|
import.c)
|
|
add_subdirectory(keygen)
|
|
|
|
add_library(agent STATIC
|
|
sshpubk.c pageant.c aqsync.c)
|
|
|
|
add_library(guiterminal STATIC
|
|
terminal.c ldisc.c minibidi.c config.c dialog.c
|
|
$<TARGET_OBJECTS:logging>)
|
|
|
|
add_library(noterminal STATIC
|
|
noterm.c ldisc.c)
|
|
|
|
add_library(all-backends OBJECT
|
|
pinger.c)
|
|
|
|
add_library(sftpclient STATIC
|
|
psftpcommon.c)
|
|
add_subdirectory(ssh)
|
|
|
|
add_library(otherbackends STATIC
|
|
$<TARGET_OBJECTS:all-backends>
|
|
$<TARGET_OBJECTS:logging>)
|
|
add_subdirectory(otherbackends)
|
|
|
|
add_executable(testcrypt
|
|
testcrypt.c sshpubk.c ssh/crc-attack-detector.c)
|
|
target_link_libraries(testcrypt
|
|
keygen crypto utils ${platform_libraries})
|
|
|
|
add_executable(test_host_strfoo
|
|
utils/host_strchr_internal.c)
|
|
target_compile_definitions(test_host_strfoo PRIVATE TEST)
|
|
target_link_libraries(test_host_strfoo utils ${platform_libraries})
|
|
|
|
add_executable(test_tree234
|
|
utils/tree234.c)
|
|
target_compile_definitions(test_tree234 PRIVATE TEST)
|
|
target_link_libraries(test_tree234 utils ${platform_libraries})
|
|
|
|
add_executable(test_wildcard
|
|
utils/wildcard.c)
|
|
target_compile_definitions(test_wildcard PRIVATE TEST)
|
|
target_link_libraries(test_wildcard utils ${platform_libraries})
|
|
|
|
add_executable(plink
|
|
${platform}/plink.c
|
|
be_all_s.c)
|
|
target_link_libraries(plink
|
|
eventloop noterminal console sshclient otherbackends settings network crypto
|
|
utils
|
|
${platform_libraries})
|
|
installed_program(plink)
|
|
|
|
add_executable(pscp
|
|
pscp.c
|
|
be_ssh.c)
|
|
target_link_libraries(pscp
|
|
sftpclient eventloop console sshclient settings network crypto utils
|
|
${platform_libraries})
|
|
installed_program(pscp)
|
|
|
|
add_executable(psftp
|
|
psftp.c
|
|
be_ssh.c)
|
|
target_link_libraries(psftp
|
|
sftpclient eventloop console sshclient settings network crypto utils
|
|
${platform_libraries})
|
|
installed_program(psftp)
|
|
|
|
add_executable(psocks
|
|
${platform}/psocks.c
|
|
psocks.c
|
|
norand.c
|
|
nocproxy.c
|
|
ssh/portfwd.c)
|
|
target_link_libraries(psocks
|
|
eventloop console network utils
|
|
${platform_libraries})
|
|
|
|
foreach(subdir ${platform} ${extra_dirs})
|
|
add_subdirectory(${subdir})
|
|
endforeach()
|
|
|
|
configure_file(cmake/cmake.h.in ${GENERATED_SOURCES_DIR}/cmake.h)
|