kNCurses/CMakeLists.txt

72 lines
2.5 KiB
CMake
Raw Normal View History

##
# @author Christian Burger <christian@krikkel.de>
cmake_minimum_required(VERSION 3.16.3)
include("cmake/version.cmake")
2022-05-06 22:42:09 +02:00
project(kNCurses
2022-05-18 23:30:04 +02:00
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")
2022-05-06 22:42:09 +02:00
target_link_libraries(kNCurses ${CURSES_LIBRARIES})
include("cmake/gsl.cmake")
include("cmake/libvterm.cmake")
if(EXISTS libvtermProject)
2022-05-06 22:42:09 +02:00
add_dependencies(kNCurses libvtermProject)
endif()
2022-05-06 22:42:09 +02:00
target_link_libraries(kNCurses ${LIBVTERM_LIBRARY})
find_library(UTIL_LIBRARY util)
2022-05-06 22:42:09 +02:00
target_link_libraries(kNCurses ${UTIL_LIBRARY})
set(THREADS_PREFER_PTHREAD_FLAG true)
find_package(Threads REQUIRED)
2022-05-06 22:42:09 +02:00
target_link_libraries(kNCurses Threads::Threads)
### demo application
2022-05-08 21:26:12 +02:00
add_executable(kNCursesDemoApp main.cpp DemoApp.cpp)
2022-05-06 22:42:09 +02:00
target_link_libraries(kNCursesDemoApp kNCurses)
2022-04-18 22:59:36 +02:00
### installation and packaging
2022-05-06 22:42:09 +02:00
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)
2022-05-06 22:42:09 +02:00
install(TARGETS kNCurses ARCHIVE
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/kNCurses/")
2022-04-18 22:59:36 +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>")
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
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")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libncursesw6 (>=6.2), libvterm0 (>= 0.1.2)")
include(CPack)