mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-26 01:32:25 +00:00
Move some add_executable() calls to top-level CMakeLists.
Now that the main source file of Plink in each platform directory has the same name, we can put centralise the main definition of the program in the main CMakeLists.txt, and in the platform directory, just add the few extra modules needed to clear up platform-specific details. The same goes for psocks. And PSCP and PSFTP could have been moved to the top level already - I just hadn't done it in the initial setup.
This commit is contained in:
parent
f39c51f9a7
commit
77940f8fa3
@ -75,7 +75,42 @@ add_executable(test_wildcard
|
|||||||
target_compile_definitions(test_wildcard PRIVATE TEST)
|
target_compile_definitions(test_wildcard PRIVATE TEST)
|
||||||
target_link_libraries(test_wildcard utils ${platform_libraries})
|
target_link_libraries(test_wildcard utils ${platform_libraries})
|
||||||
|
|
||||||
foreach(subdir ${PLATFORM_SUBDIRS})
|
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})
|
add_subdirectory(${subdir})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
set(PLATFORM_SUBDIRS charset unix)
|
|
||||||
|
|
||||||
set(PUTTY_GSSAPI DYNAMIC
|
set(PUTTY_GSSAPI DYNAMIC
|
||||||
CACHE STRING "Build PuTTY with dynamically or statically linked \
|
CACHE STRING "Build PuTTY with dynamically or statically linked \
|
||||||
Kerberos / GSSAPI support, if possible")
|
Kerberos / GSSAPI support, if possible")
|
||||||
@ -80,6 +78,8 @@ add_optional_system_lib(m pow)
|
|||||||
add_optional_system_lib(rt clock_gettime)
|
add_optional_system_lib(rt clock_gettime)
|
||||||
add_optional_system_lib(xnet socket)
|
add_optional_system_lib(xnet socket)
|
||||||
|
|
||||||
|
set(extra_dirs charset)
|
||||||
|
|
||||||
if(PUTTY_GSSAPI STREQUAL DYNAMIC)
|
if(PUTTY_GSSAPI STREQUAL DYNAMIC)
|
||||||
add_optional_system_lib(dl dlopen)
|
add_optional_system_lib(dl dlopen)
|
||||||
if(HAVE_NO_LIBdl)
|
if(HAVE_NO_LIBdl)
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
set(PLATFORM_SUBDIRS windows)
|
|
||||||
|
|
||||||
set(PUTTY_MINEFIELD OFF
|
set(PUTTY_MINEFIELD OFF
|
||||||
CACHE BOOL "Build PuTTY with its built-in memory debugger 'Minefield'")
|
CACHE BOOL "Build PuTTY with its built-in memory debugger 'Minefield'")
|
||||||
set(PUTTY_GSSAPI ON
|
set(PUTTY_GSSAPI ON
|
||||||
|
@ -61,16 +61,20 @@ function(add_sources_from_current_dir target)
|
|||||||
target_sources(${target} PRIVATE ${sources})
|
target_sources(${target} PRIVATE ${sources})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
set(extra_dirs)
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "Windows" OR WINELIB)
|
if(CMAKE_SYSTEM_NAME MATCHES "Windows" OR WINELIB)
|
||||||
include(cmake/platforms/windows.cmake)
|
set(platform windows)
|
||||||
else()
|
else()
|
||||||
include(cmake/platforms/unix.cmake)
|
set(platform unix)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
include(cmake/platforms/${platform}.cmake)
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
${GENERATED_SOURCES_DIR}
|
${GENERATED_SOURCES_DIR}
|
||||||
${PLATFORM_SUBDIRS})
|
${platform}
|
||||||
|
${extra_dirs})
|
||||||
|
|
||||||
if(PUTTY_DEBUG)
|
if(PUTTY_DEBUG)
|
||||||
add_compile_definitions(DEBUG)
|
add_compile_definitions(DEBUG)
|
||||||
|
@ -61,40 +61,10 @@ target_link_libraries(fuzzterm
|
|||||||
add_executable(osxlaunch
|
add_executable(osxlaunch
|
||||||
osxlaunch.c)
|
osxlaunch.c)
|
||||||
|
|
||||||
add_executable(plink
|
add_sources_from_current_dir(plink no-gtk.c)
|
||||||
plink.c
|
add_sources_from_current_dir(pscp no-gtk.c)
|
||||||
${CMAKE_SOURCE_DIR}/be_all_s.c
|
add_sources_from_current_dir(psftp no-gtk.c)
|
||||||
no-gtk.c)
|
add_sources_from_current_dir(psocks no-gtk.c)
|
||||||
target_link_libraries(plink
|
|
||||||
eventloop noterminal console sshclient otherbackends settings network crypto
|
|
||||||
utils)
|
|
||||||
installed_program(plink)
|
|
||||||
|
|
||||||
add_executable(pscp
|
|
||||||
${CMAKE_SOURCE_DIR}/pscp.c
|
|
||||||
${CMAKE_SOURCE_DIR}/be_ssh.c
|
|
||||||
no-gtk.c)
|
|
||||||
target_link_libraries(pscp
|
|
||||||
sftpclient eventloop console sshclient settings network crypto utils)
|
|
||||||
installed_program(pscp)
|
|
||||||
|
|
||||||
add_executable(psftp
|
|
||||||
${CMAKE_SOURCE_DIR}/psftp.c
|
|
||||||
${CMAKE_SOURCE_DIR}/be_ssh.c
|
|
||||||
no-gtk.c)
|
|
||||||
target_link_libraries(psftp
|
|
||||||
sftpclient eventloop console sshclient settings network crypto utils)
|
|
||||||
installed_program(psftp)
|
|
||||||
|
|
||||||
add_executable(psocks
|
|
||||||
psocks.c
|
|
||||||
${CMAKE_SOURCE_DIR}/psocks.c
|
|
||||||
${CMAKE_SOURCE_DIR}/norand.c
|
|
||||||
${CMAKE_SOURCE_DIR}/nocproxy.c
|
|
||||||
${CMAKE_SOURCE_DIR}/ssh/portfwd.c
|
|
||||||
no-gtk.c)
|
|
||||||
target_link_libraries(psocks
|
|
||||||
eventloop console network utils)
|
|
||||||
|
|
||||||
add_executable(psusan
|
add_executable(psusan
|
||||||
psusan.c
|
psusan.c
|
||||||
|
@ -68,53 +68,16 @@ set_target_properties(pageant PROPERTIES
|
|||||||
LINK_FLAGS "${LFLAG_MANIFEST_NO}")
|
LINK_FLAGS "${LFLAG_MANIFEST_NO}")
|
||||||
installed_program(pageant)
|
installed_program(pageant)
|
||||||
|
|
||||||
add_executable(plink
|
add_sources_from_current_dir(plink no-jump-list.c nohelp.c plink.rc)
|
||||||
plink.c
|
|
||||||
${CMAKE_SOURCE_DIR}/be_all_s.c
|
|
||||||
no-jump-list.c
|
|
||||||
nohelp.c
|
|
||||||
plink.rc)
|
|
||||||
add_dependencies(plink generated_licence_h)
|
add_dependencies(plink generated_licence_h)
|
||||||
target_link_libraries(plink
|
|
||||||
eventloop console noterminal sshclient otherbackends settings network crypto
|
|
||||||
utils
|
|
||||||
${platform_libraries})
|
|
||||||
installed_program(plink)
|
|
||||||
|
|
||||||
add_executable(pscp
|
add_sources_from_current_dir(pscp no-jump-list.c nohelp.c pscp.rc)
|
||||||
${CMAKE_SOURCE_DIR}/pscp.c
|
|
||||||
${CMAKE_SOURCE_DIR}/be_ssh.c
|
|
||||||
no-jump-list.c
|
|
||||||
nohelp.c
|
|
||||||
pscp.rc)
|
|
||||||
add_dependencies(pscp generated_licence_h)
|
add_dependencies(pscp generated_licence_h)
|
||||||
target_link_libraries(pscp
|
|
||||||
sftpclient eventloop console sshclient settings network crypto utils
|
|
||||||
${platform_libraries})
|
|
||||||
installed_program(pscp)
|
|
||||||
|
|
||||||
add_executable(psftp
|
add_sources_from_current_dir(psftp no-jump-list.c nohelp.c psftp.rc)
|
||||||
${CMAKE_SOURCE_DIR}/psftp.c
|
|
||||||
${CMAKE_SOURCE_DIR}/be_ssh.c
|
|
||||||
no-jump-list.c
|
|
||||||
nohelp.c
|
|
||||||
psftp.rc)
|
|
||||||
add_dependencies(psftp generated_licence_h)
|
add_dependencies(psftp generated_licence_h)
|
||||||
target_link_libraries(psftp
|
|
||||||
sftpclient eventloop console sshclient settings network crypto utils
|
|
||||||
${platform_libraries})
|
|
||||||
installed_program(psftp)
|
|
||||||
|
|
||||||
add_executable(psocks
|
add_sources_from_current_dir(psocks nohelp.c)
|
||||||
psocks.c
|
|
||||||
nohelp.c
|
|
||||||
${CMAKE_SOURCE_DIR}/psocks.c
|
|
||||||
${CMAKE_SOURCE_DIR}/norand.c
|
|
||||||
${CMAKE_SOURCE_DIR}/nocproxy.c
|
|
||||||
${CMAKE_SOURCE_DIR}/ssh/portfwd.c)
|
|
||||||
target_link_libraries(psocks
|
|
||||||
eventloop console network utils
|
|
||||||
${platform_libraries})
|
|
||||||
|
|
||||||
add_executable(putty
|
add_executable(putty
|
||||||
window.c
|
window.c
|
||||||
|
Loading…
Reference in New Issue
Block a user