2022-04-22 14:39:00 +02:00
|
|
|
##
|
2022-04-13 13:10:55 +02:00
|
|
|
# @author Christian Burger <christian@krikkel.de>
|
|
|
|
|
2022-04-03 10:16:20 +02:00
|
|
|
cmake_minimum_required(VERSION 3.16.3)
|
2022-04-22 14:39:00 +02:00
|
|
|
|
|
|
|
include("cmake/version.cmake")
|
2022-04-29 20:25:47 +02:00
|
|
|
project(NCurses
|
2022-04-22 14:39:00 +02:00
|
|
|
HOMEPAGE_URL "https://gitea.xndr.de/christian/NCursesPtyWindow"
|
|
|
|
VERSION ${SEMANTIC_VERSION})
|
2022-04-03 10:16:20 +02:00
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
|
|
|
include(CTest)
|
|
|
|
enable_testing()
|
|
|
|
|
2022-05-03 11:23:32 +02:00
|
|
|
add_library(NCurses Window.cpp PtyWindow.cpp SingleUserInput.cpp Debug.cpp VerticalTilingWindowManager.cpp)
|
2022-04-03 10:16:20 +02:00
|
|
|
|
2022-04-23 20:27:55 +02:00
|
|
|
### path to own system includes
|
|
|
|
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/include")
|
|
|
|
|
2022-04-03 10:16:20 +02:00
|
|
|
### libraries
|
2022-04-13 13:10:55 +02:00
|
|
|
|
2022-04-22 14:39:00 +02:00
|
|
|
include("cmake/ncurses.cmake")
|
2022-04-29 20:25:47 +02:00
|
|
|
target_link_libraries(NCurses ${CURSES_LIBRARIES})
|
2022-04-22 14:39:00 +02:00
|
|
|
|
|
|
|
include("cmake/gsl.cmake")
|
|
|
|
|
2022-04-13 13:10:55 +02:00
|
|
|
include("cmake/libvterm.cmake")
|
2022-04-14 09:31:19 +02:00
|
|
|
if(EXISTS libvtermProject)
|
2022-04-29 20:25:47 +02:00
|
|
|
add_dependencies(NCurses libvtermProject)
|
2022-04-14 09:31:19 +02:00
|
|
|
endif()
|
2022-04-29 20:25:47 +02:00
|
|
|
target_link_libraries(NCurses ${LIBVTERM_LIBRARY})
|
2022-04-14 09:31:19 +02:00
|
|
|
|
2022-04-03 10:16:20 +02:00
|
|
|
find_library(UTIL_LIBRARY util)
|
2022-04-29 20:25:47 +02:00
|
|
|
target_link_libraries(NCurses ${UTIL_LIBRARY})
|
2022-04-03 10:16:20 +02:00
|
|
|
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG true)
|
|
|
|
find_package(Threads REQUIRED)
|
2022-04-29 20:25:47 +02:00
|
|
|
target_link_libraries(NCurses Threads::Threads)
|
2022-04-03 10:16:20 +02:00
|
|
|
|
|
|
|
### demo application
|
2022-04-29 20:25:47 +02:00
|
|
|
add_executable(NCursesDemoApp main.cpp App.cpp)
|
|
|
|
target_link_libraries(NCursesDemoApp NCurses)
|
2022-04-03 10:16:20 +02:00
|
|
|
|
2022-04-18 22:59:36 +02:00
|
|
|
### installation and packaging
|
2022-04-29 20:25:47 +02:00
|
|
|
set(NCURSES_SYSTEM_INCLUDE "include/NCurses")
|
2022-05-03 11:23:32 +02:00
|
|
|
set_target_properties(NCurses PROPERTIES PUBLIC_HEADER "${NCURSES_SYSTEM_INCLUDE}/Window.hpp;${NCURSES_SYSTEM_INCLUDE}/SingleUserInput.hpp;${NCURSES_SYSTEM_INCLUDE}/PtyWindow.hpp;${NCURSES_SYSTEM_INCLUDE}/VerticalTilingWindowManager.hpp;"
|
2022-04-22 14:39:00 +02:00
|
|
|
VERSION "${CMAKE_PROJECT_VERSION}")
|
2022-04-23 20:27:55 +02:00
|
|
|
include(GNUInstallDirs)
|
2022-04-29 20:25:47 +02:00
|
|
|
install(TARGETS NCurses ARCHIVE
|
|
|
|
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/NCurses/")
|
2022-04-18 22:59:36 +02:00
|
|
|
|
2022-04-03 10:16:20 +02:00
|
|
|
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
|
|
|
|
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
|
2022-04-18 22:59:36 +02:00
|
|
|
set(CPACK_PACKAGE_CONTACT "Christian Burger <christian@krikkel.de>")
|
2022-04-21 10:28:45 +02:00
|
|
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Library for a pseudo terminal where the host end is a ncurses window")
|
2022-04-22 14:39:00 +02:00
|
|
|
# 3.16.3 does not pick up the project's homepage URL by itself
|
2022-04-21 12:36:18 +02:00
|
|
|
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${CMAKE_PROJECT_HOMEPAGE_URL})
|
2022-04-18 22:59:36 +02:00
|
|
|
|
|
|
|
set(CPACK_GENERATOR "DEB" "TGZ")
|
2022-04-23 20:34:00 +02:00
|
|
|
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libncursesw6 (>=6.2), libvterm0 (>= 0.1.2)")
|
2022-04-03 10:16:20 +02:00
|
|
|
include(CPack)
|