From 90d4ba94e42d8a472ab0a325a384db2b9dabc5eb Mon Sep 17 00:00:00 2001
From: Stephen Hurd <deuce@synchro.net>
Date: Wed, 9 Feb 2022 18:10:22 -0500
Subject: [PATCH] Fix up install target.

---
 CMakeLists.txt  | 5 ++++-
 syncterm.man.in | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0b914a3..b6f8cd8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,6 +62,8 @@ set(SOURCE
 	ripper.c
 )
 
+configure_file(syncterm.man.in syncterm.man)
+file(ARCHIVE_CREATE OUTPUT syncterm.1.gz FORMAT raw COMPRESSION GZip PATHS syncterm.man)
 add_executable(syncterm ${SOURCE})
 target_link_libraries(syncterm cryptlib xpdevplus)
 target_include_directories(syncterm PRIVATE ${CMAKE_BINARY_DIR})
@@ -79,8 +81,9 @@ if(NOT HAS_FORKPTY)
 	target_compile_definitions(syncterm PRIVATE NEEDS_DAEMON)
 endif()
 
-install(TARGETS syncterm DESTINATION bin)
+install(TARGETS syncterm RUNTIME)
 if(UNIX)
 	install(FILES syncterm.desktop DESTINATION share/applications)
 	install(FILES syncterm.png DESTINATION share/icons/hicolor/64x64/apps)
+	install(FILES ${CMAKE_CURRENT_BINARY_DIR}/syncterm.1.gz DESTINATION man/man1)
 endif()
diff --git a/syncterm.man.in b/syncterm.man.in
index 0bfcc6b..4e03286 100644
--- a/syncterm.man.in
+++ b/syncterm.man.in
@@ -130,7 +130,7 @@ The curses and ANSI modes are not necessarily the correct number of lines for
 a traditional screen mode. As such, filler will be added around the terminal
 screen. For some display sizes, unpredictable results may occur.
 .SH FILES
-.IP \fC%%DESTDIR%%%%PREFIX%%/etc/syncterm.lst\fR
+.IP \fC@DESTDIR@@CMAKE_INSTALL_PREFIX@/etc/syncterm.lst\fR
 The system wide dialing directory.
 .IP \fC~/.syncterm/syncterm.lst\fR
 The users dialing directory
-- 
GitLab