cmake_minimum_required(VERSION 2.8)
-project(ttyd C)
-set(PROJECT_VERSION "1.7.0")
+if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
+ project(ttyd C)
+ set(PROJECT_VERSION_MAJOR "1")
+ set(PROJECT_VERSION_MINOR "7")
+ set(PROJECT_VERSION_PATCH "0")
+ set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
+else()
+ cmake_policy(SET CMP0048 NEW)
+ project(ttyd VERSION 1.7.0 LANGUAGES C)
+endif()
find_package(Git)
if(GIT_FOUND)
if(WIN32)
list(APPEND LINK_LIBS shell32 ws2_32)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/app.rc.in ${CMAKE_CURRENT_BINARY_DIR}/app.rc @ONLY)
+ list(APPEND SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/app.rc)
elseif(NOT APPLE)
list(APPEND LINK_LIBS util)
endif()
--- /dev/null
+#include <winver.h>
+
+#define VERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0
+#define VERSION_STR "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.0\0"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION VERSION
+ PRODUCTVERSION VERSION
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS 0
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "FileDescription", "Share your terminal over the web\0"
+ VALUE "ProductName", "ttyd\0"
+ VALUE "ProductVersion", VERSION_STR
+ VALUE "FileVersion", VERSION_STR
+ VALUE "InternalName", "ttyd\0"
+ VALUE "OriginalFilename", "ttyd.exe\0"
+ VALUE "LegalCopyright", "Copyright (C) 2016-2022 Shuanglei Tao\0"
+ VALUE "Comment", "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END