63 lines
2.1 KiB
CMake
63 lines
2.1 KiB
CMake
##
|
|
# @author Christian Burger <christian@krikkel.de>
|
|
|
|
cmake_minimum_required(VERSION 3.16.3)
|
|
|
|
include("cmake/version.cmake")
|
|
project(NCursesPtyWindow
|
|
HOMEPAGE_URL "https://gitea.xndr.de/christian/NCursesPtyWindow"
|
|
VERSION ${SEMANTIC_VERSION})
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
include(CTest)
|
|
enable_testing()
|
|
|
|
add_library(NCursesPtyWindow Window.cpp PtyWindow.cpp SingleUserInput.cpp Debug.cpp)
|
|
|
|
### path to own system includes
|
|
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/include")
|
|
|
|
### libraries
|
|
|
|
include("cmake/ncurses.cmake")
|
|
target_link_libraries(NCursesPtyWindow ${CURSES_LIBRARIES})
|
|
|
|
include("cmake/gsl.cmake")
|
|
|
|
include("cmake/libvterm.cmake")
|
|
if(EXISTS libvtermProject)
|
|
add_dependencies(NCursesPtyWindow libvtermProject)
|
|
endif()
|
|
target_link_libraries(NCursesPtyWindow ${LIBVTERM_LIBRARY})
|
|
|
|
find_library(UTIL_LIBRARY util)
|
|
target_link_libraries(NCursesPtyWindow ${UTIL_LIBRARY})
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG true)
|
|
find_package(Threads REQUIRED)
|
|
target_link_libraries(NCursesPtyWindow Threads::Threads)
|
|
|
|
### demo application
|
|
add_executable(NCursesPtyApp main.cpp App.cpp)
|
|
target_link_libraries(NCursesPtyApp NCursesPtyWindow)
|
|
|
|
### installation and packaging
|
|
set(NCURSES_PTY_WINDOW_SYSTEM_INCLUDE "include/NCursesPtyWindow")
|
|
set_target_properties(NCursesPtyWindow PROPERTIES PUBLIC_HEADER "${NCURSES_PTY_WINDOW_SYSTEM_INCLUDE}/Window.hpp;${NCURSES_PTY_WINDOW_SYSTEM_INCLUDE}/SingleUserInput.hpp"
|
|
VERSION "${CMAKE_PROJECT_VERSION}")
|
|
include(GNUInstallDirs)
|
|
install(TARGETS NCursesPtyWindow ARCHIVE
|
|
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/NCursesPtyWindow/")
|
|
|
|
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
|
|
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
|
|
set(CPACK_PACKAGE_CONTACT "Christian Burger <christian@krikkel.de>")
|
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Library for a pseudo terminal where the host end is a ncurses window")
|
|
# 3.16.3 does not pick up the project's homepage URL by itself
|
|
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${CMAKE_PROJECT_HOMEPAGE_URL})
|
|
|
|
set(CPACK_GENERATOR "DEB" "TGZ")
|
|
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libncursesw6 (>=6.2), libvterm0 (>= 0.1.2)")
|
|
include(CPack)
|