-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Bump CMake version to 3.17 - Require ncurses - Include ncurses libraries Signed-off-by: Pavel Kalugin <paul.kalug@gmail.com>
- Loading branch information
Showing
3 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
add_executable (rang rang.cpp) | ||
|
||
target_include_directories(rang PUBLIC ${CURSES_INCLUDE_DIRS}) | ||
target_link_libraries(rang PUBLIC ${CURSES_LIBRARIES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
#include "rang.h" | ||
#include <iostream> | ||
#include <ncurses.h> | ||
|
||
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; | ||
} |