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-05 10:28:10 +02:00
|
|
|
project(NCursesPtyWindow VERSION 0.1.0)
|
2022-04-03 10:16:20 +02:00
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
|
|
|
include(CTest)
|
|
|
|
enable_testing()
|
|
|
|
|
2022-04-13 13:10:55 +02:00
|
|
|
include(ExternalProject)
|
2022-04-03 10:16:20 +02:00
|
|
|
include("cmake/ncurses.cmake")
|
|
|
|
include("cmake/gsl.cmake")
|
|
|
|
|
2022-04-13 19:41:41 +02:00
|
|
|
add_library(NCursesPtyWindow Window.cpp SingleUserInput.cpp Debug.cpp)
|
2022-04-03 10:16:20 +02:00
|
|
|
|
|
|
|
### libraries
|
2022-04-13 13:10:55 +02:00
|
|
|
|
|
|
|
include("cmake/libvterm.cmake")
|
2022-04-14 09:31:19 +02:00
|
|
|
if(EXISTS libvtermProject)
|
|
|
|
add_dependencies(NCursesPtyWindow libvtermProject)
|
|
|
|
endif()
|
|
|
|
|
2022-04-03 10:16:20 +02:00
|
|
|
find_library(UTIL_LIBRARY util)
|
|
|
|
|
2022-04-05 10:28:10 +02:00
|
|
|
target_link_libraries(NCursesPtyWindow ${CURSES_LIBRARIES} ${LIBVTERM_LIBRARY} ${UTIL_LIBRARY})
|
2022-04-03 10:16:20 +02:00
|
|
|
|
|
|
|
### threads
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG true)
|
|
|
|
find_package(Threads REQUIRED)
|
2022-04-05 10:28:10 +02:00
|
|
|
target_link_libraries(NCursesPtyWindow Threads::Threads)
|
2022-04-03 10:16:20 +02:00
|
|
|
|
|
|
|
### demo application
|
2022-04-13 19:41:41 +02:00
|
|
|
add_executable(NCursesPtyApp main.cpp App.cpp)
|
2022-04-05 10:28:10 +02:00
|
|
|
target_link_libraries(NCursesPtyApp ${CURSES_LIBRARIES} NCursesPtyWindow)
|
2022-04-03 10:16:20 +02:00
|
|
|
|
|
|
|
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
|
|
|
|
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
|
|
|
|
include(CPack)
|