Revision: 9838 https://osdn.net/projects/ttssh2/scm/svn/commits/9838 Author: zmatsuo Date: 2022-03-25 22:38:59 +0900 (Fri, 25 Mar 2022) Log Message: ----------- NMake Makefiles, VS2005, msys2 など考慮 - cmakeビルド時 - multi config ではない(Release,Debugなどがない)場合を考慮 Modified Paths: -------------- trunk/CMakeLists.txt trunk/cygwin/CMakeLists.txt trunk/cygwin/cygterm_build/CMakeLists.txt trunk/cygwin/cygtool_build/CMakeLists.txt trunk/teraterm/teraterm/CMakeLists.txt -------------- next part -------------- Modified: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt 2022-03-25 13:38:49 UTC (rev 9837) +++ trunk/CMakeLists.txt 2022-03-25 13:38:59 UTC (rev 9838) @@ -26,7 +26,14 @@ if(MSVC AND (MSVC_VERSION LESS_EQUAL 1500)) # Visual Studio 2005, 2008 (1500=VS2008) set(_WIN32_WINNT "0x0501") - set(TTXSSH OFF) + if(1) + set(TTXSSH OFF) + else() + # この組み合わせはlibputtyがビルドできないので今のところ実現しない + set(TTXSSH ON) + set(TTXSSH_LIBRESSL OFF) + set(TTXSSH_OPENSSL3 ON) + endif() endif() if(MSVC) Modified: trunk/cygwin/CMakeLists.txt =================================================================== --- trunk/cygwin/CMakeLists.txt 2022-03-25 13:38:49 UTC (rev 9837) +++ trunk/cygwin/CMakeLists.txt 2022-03-25 13:38:59 UTC (rev 9838) @@ -8,8 +8,8 @@ cyglib PROPERTIES FOLDER cygwin) -if(CMAKE_SIZEOF_VOID_P EQUAL 4) - # 32bit build +if(MSVC AND (CMAKE_SIZEOF_VOID_P EQUAL 4)) + # Visual Studio 32bit build add_subdirectory(cygtool) set_target_properties( @@ -23,12 +23,14 @@ FOLDER cygwin ) else() - # 64bit build + # other build system... if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0") add_subdirectory(cygtool_build) - set_target_properties( - cygtool_build - PROPERTIES FOLDER cygwin) + if(TARGET cygtool_build) + set_target_properties( + cygtool_build + PROPERTIES FOLDER cygwin) + endif() endif() endif() Modified: trunk/cygwin/cygterm_build/CMakeLists.txt =================================================================== --- trunk/cygwin/cygterm_build/CMakeLists.txt 2022-03-25 13:38:49 UTC (rev 9837) +++ trunk/cygwin/cygterm_build/CMakeLists.txt 2022-03-25 13:38:59 UTC (rev 9838) @@ -1,4 +1,7 @@ - +# cygwin,msys2を使って cygterm,msys2term をビルドする + +cmake_minimum_required(VERSION 3.13) # for Generator-Expression + add_custom_target( cygterm_build ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/build_mark.txt @@ -6,10 +9,16 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cygterm_build) +if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") + set(BINARY_DIR "${CMAKE_BINARY_DIR}/$<CONFIG>") +else() + set(BINARY_DIR "${CMAKE_BINARY_DIR}") +endif() + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/build_mark.txt - COMMAND ${CMAKE_COMMAND} -E echo ${CMAKE_BINARY_DIR}/$<CONFIG> - COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/$<CONFIG> -P ${CMAKE_CURRENT_LIST_DIR}/../cygterm/build_cygterm.cmake + COMMAND ${CMAKE_COMMAND} -E echo ${BINARY_DIR} + COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${BINARY_DIR} -P ${CMAKE_CURRENT_LIST_DIR}/../cygterm/build_cygterm.cmake COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/build_mark.txt WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cygterm_build ) @@ -16,29 +25,29 @@ install( FILES - ${CMAKE_BINARY_DIR}/$<CONFIG>/cygterm_x86_64/cygterm.exe - ${CMAKE_BINARY_DIR}/$<CONFIG>/cygterm_x86_64/cygterm.cfg + ${BINARY_DIR}/cygterm_x86_64/cygterm.exe + ${BINARY_DIR}/cygterm_x86_64/cygterm.cfg DESTINATION cygterm_x86_64 OPTIONAL ) install( FILES - ${CMAKE_BINARY_DIR}/$<CONFIG>/cygterm_x86_64/cygterm.exe - ${CMAKE_BINARY_DIR}/$<CONFIG>/cygterm_x86_64/cygterm.cfg + ${BINARY_DIR}/cygterm_x86_64/cygterm.exe + ${BINARY_DIR}/cygterm_x86_64/cygterm.cfg DESTINATION . OPTIONAL ) install( FILES - ${CMAKE_BINARY_DIR}/$<CONFIG>/cygterm_i686/cygterm.exe - ${CMAKE_BINARY_DIR}/$<CONFIG>/cygterm_i686/cygterm.cfg + ${BINARY_DIR}/cygterm_i686/cygterm.exe + ${BINARY_DIR}/cygterm_i686/cygterm.cfg DESTINATION cygterm_i686 OPTIONAL ) install( FILES - ${CMAKE_BINARY_DIR}/$<CONFIG>/msys2term.exe - ${CMAKE_BINARY_DIR}/$<CONFIG>/msys2term.cfg + ${BINARY_DIR}/msys2term.exe + ${BINARY_DIR}/msys2term.cfg DESTINATION . OPTIONAL ) Modified: trunk/cygwin/cygtool_build/CMakeLists.txt =================================================================== --- trunk/cygwin/cygtool_build/CMakeLists.txt 2022-03-25 13:38:49 UTC (rev 9837) +++ trunk/cygwin/cygtool_build/CMakeLists.txt 2022-03-25 13:38:59 UTC (rev 9838) @@ -1,20 +1,40 @@ - +# VS 32bit 以外のビルドシステムから cygtool をビルドする + +cmake_minimum_required(VERSION 3.13) # for Generator-Expression + +if(NOT ("${CMAKE_GENERATOR}" MATCHES "Visual Studio")) + # 現在VS以外はうまくっていない + return() +endif() + +if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") + set(BINARY_DIR "${CMAKE_BINARY_DIR}/$<CONFIG>") +else() + set(BINARY_DIR "${CMAKE_BINARY_DIR}") +endif() + +set(SRC + ${CMAKE_CURRENT_LIST_DIR}/../cygtool/cygtool.c + ${CMAKE_CURRENT_LIST_DIR}/../cygtool/cygtool.h + ${CMAKE_CURRENT_LIST_DIR}/../cygtool/cygtool.def + ) + add_custom_target( cygtool_build ALL - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/build_mark.txt + DEPENDS ${BINARY_DIR}/cygtool.dll + SOURCES ${SRC} ) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cygtool_build) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/build_mark.txt - COMMAND ${CMAKE_COMMAND} -DCMAKE_GENERATOR=${CMAKE_GENERATOR} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/$<CONFIG> -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -P ${CMAKE_CURRENT_LIST_DIR}/../cygtool/build_cygtool.cmake - COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/build_mark.txt + OUTPUT ${BINARY_DIR}/cygtool.dll + DEPENDS ${SRC} + COMMAND ${CMAKE_COMMAND} -DCMAKE_GENERATOR=${CMAKE_GENERATOR} -DCMAKE_INSTALL_PREFIX=${BINARY_DIR} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -P ${CMAKE_CURRENT_LIST_DIR}/../cygtool/build_cygtool.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cygtool_build - COMMENT Generate "${CMAKE_CURRENT_BINARY_DIR}/cygtool.dll" ) install( - FILES ${CMAKE_BINARY_DIR}/$<CONFIG>/cygtool.dll + FILES ${BINARY_DIR}/cygtool.dll DESTINATION . ) Modified: trunk/teraterm/teraterm/CMakeLists.txt =================================================================== --- trunk/teraterm/teraterm/CMakeLists.txt 2022-03-25 13:38:49 UTC (rev 9837) +++ trunk/teraterm/teraterm/CMakeLists.txt 2022-03-25 13:38:59 UTC (rev 9838) @@ -338,11 +338,20 @@ DESTINATION . ) if(MSVC AND ENABLE_DEBUG_INFO AND (${CMAKE_VERSION} VERSION_GREATER "3.13")) - install( - FILES - $<TARGET_PDB_FILE:teraterm> - $<$<CONFIG:Debug>:debug/ttermpro.map> - $<$<CONFIG:Release>:release/ttermpro.map> - DESTINATION . - ) + if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") + install( + FILES + $<TARGET_PDB_FILE:teraterm> + $<CONFIG>/ttermpro.map + DESTINATION . + ) + else() + # single configuration like "NMake Makefiles" + install( + FILES + $<TARGET_PDB_FILE:teraterm> + ${CMAKE_BINARY_DIR}/ttermpro.map + DESTINATION . + ) + endif() endif()