add_definitions(-D_WINDOWS -DRELEASE=0.60-VGL)
include_directories(WINDOWS ${CMAKE_CURRENT_SOURCE_DIR}
	${CMAKE_CURRENT_BINARY_DIR}/WINDOWS)

set(COMMON_SOURCES
	BE_ALL_S.C
	CMDLINE.C
	CPROXY.C
	LDISC.C
	LOGGING.C
	MISC.C
	PINGER.C
	PORTFWD.C
	PROXY.C
	RAW.C
	RLOGIN.C
	SETTINGS.C
	SSH.C
	SSHAES.C
	SSHARCF.C
	SSHBLOWF.C
	SSHBN.C
	SSHCRC.C
	SSHCRCDA.C
	SSHDES.C
	SSHDH.C
	SSHDSS.C
	SSHMD5.C
	SSHPUBK.C
	SSHRAND.C
	SSHRSA.C
	SSHSH256.C
	SSHSH512.C
	SSHSHA.C
	SSHZLIB.C
	TELNET.C
	TIMING.C
	TREE234.C
	VERSION.C
	WILDCARD.C
	WINDOWS/WINDEFS.C
	WINDOWS/WINHANDL.C
	WINDOWS/WINMISC.C
	WINDOWS/WINNET.C
	WINDOWS/WINNOISE.C
	WINDOWS/WINPGNTC.C
	WINDOWS/WINPROXY.C
	WINDOWS/WINSER.C
	WINDOWS/WINSTORE.C
	WINDOWS/WINTIME.C
	X11FWD.C)

set(PUTTY_SOURCES
	CONFIG.C
	DIALOG.C
	LDISCUCS.C
	MINIBIDI.C
	SERCFG.C
	TERMINAL.C
	WCWIDTH.C
	WINDOWS/SIZETIP.C
	WINDOWS/WINCFG.C
	WINDOWS/WINCTRLS.C
	WINDOWS/WINDLG.C
	WINDOWS/WINDOW.C
	WINDOWS/WINHELP.C
	WINDOWS/WINPRINT.C
	WINDOWS/WINUCS.C
	WINDOWS/WINUTILS.C)

set_source_files_properties(${COMMON_SOURCES} ${PUTTY_SOURCES}
	PROPERTIES LANGUAGE C)

configure_file(WINDOWS/resdefs.h.in WINDOWS/resdefs.h)

add_executable(putty WIN32 ${PUTTY_SOURCES} ${COMMON_SOURCES}
	WINDOWS/PUTTY.rc)
target_link_libraries(putty comctl32 imm32 winmm)
install(TARGETS putty DESTINATION .)
