diff --git a/CMakeLists.txt b/CMakeLists.txt index 0399858..8804a4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,9 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.17) project(rang) +set(CURSES_NEED_NCURSES TRUE) +find_package(Curses REQUIRED) + add_subdirectory(src) -target_include_directories(rang PRIVATE include) + +target_include_directories(rang PUBLIC include) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 57a8226..12bd8e1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1 +1,4 @@ add_executable (rang rang.cpp) + +target_include_directories(rang PUBLIC ${CURSES_INCLUDE_DIRS}) +target_link_libraries(rang PUBLIC ${CURSES_LIBRARIES}) diff --git a/src/rang.cpp b/src/rang.cpp index 93aae3a..07f8bb5 100644 --- a/src/rang.cpp +++ b/src/rang.cpp @@ -1,8 +1,12 @@ #include "rang.h" -#include +#include int main(int argc, char *argv[]) { - std::cout << rang::MESSAGE; + initscr(); /* Start curses mode */ + printw(rang::MESSAGE.c_str()); /* Print Hello World */ + refresh(); /* Print it on to the real screen */ + getch(); /* Wait for user input */ + endwin(); /* End curses mode */ return 0; }