kNCurses/CMakeLists.txt

72 lines
2.5 KiB
CMake

##
# @author Christian Burger <christian@krikkel.de>
cmake_minimum_required(VERSION 3.16.3)
include("cmake/version.cmake")
project(kNCurses
HOMEPAGE_URL "https://gitea.xndr.de/christian/kNCurses"
VERSION ${SEMANTIC_VERSION})
set(CMAKE_CXX_STANDARD 17)
include(CTest)
enable_testing()
add_library(kNCurses Window.cpp PtyWindow.cpp SingleUserInput.cpp Debug.cpp
TilingWindowManager.cpp VerticalTilingWindowManager.cpp
HorizontalTilingWindowManager.cpp)
### path to own system includes
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/include")
### libraries
include("cmake/ncurses.cmake")
target_link_libraries(kNCurses ${CURSES_LIBRARIES})
include("cmake/gsl.cmake")
include("cmake/libvterm.cmake")
if(EXISTS libvtermProject)
add_dependencies(kNCurses libvtermProject)
endif()
target_link_libraries(kNCurses ${LIBVTERM_LIBRARY})
find_library(UTIL_LIBRARY util)
target_link_libraries(kNCurses ${UTIL_LIBRARY})
set(THREADS_PREFER_PTHREAD_FLAG true)
find_package(Threads REQUIRED)
target_link_libraries(kNCurses Threads::Threads)
### demo application
add_executable(kNCursesDemoApp main.cpp DemoApp.cpp)
target_link_libraries(kNCursesDemoApp kNCurses)
### installation and packaging
set(NCURSES_SYSTEM_INCLUDE "include/kNCurses")
set_target_properties(kNCurses PROPERTIES
PUBLIC_HEADER "${NCURSES_SYSTEM_INCLUDE}/Window.hpp;
${NCURSES_SYSTEM_INCLUDE}/SingleUserInput.hpp;
${NCURSES_SYSTEM_INCLUDE}/PtyWindow.hpp;
${NCURSES_SYSTEM_INCLUDE}/TilingWindowManager.hpp;
${NCURSES_SYSTEM_INCLUDE}/VerticalTilingWindowManager.hpp;
${NCURSES_SYSTEM_INCLUDE}/HorizontalTilingWindowManager.hpp;
"
VERSION "${CMAKE_PROJECT_VERSION}")
include(GNUInstallDirs)
install(TARGETS kNCurses ARCHIVE
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/kNCurses/")
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)