mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
ncurses-view #61
This commit is contained in:
parent
4b2bf26ee2
commit
cf557ff500
@ -47,8 +47,8 @@ target_compile_definitions(notcurses
|
||||
_DEFAULT_SOURCE _XOPEN_SOURCE=700
|
||||
)
|
||||
|
||||
file(GLOB BINSRCS CONFIGURE_DEPENDS src/bin/*.c)
|
||||
add_executable(notcurses-demo ${BINSRCS})
|
||||
file(GLOB DEMOSRCS CONFIGURE_DEPENDS src/demo/*.c)
|
||||
add_executable(notcurses-demo ${DEMOSRCS})
|
||||
target_include_directories(notcurses-demo PRIVATE include)
|
||||
target_link_libraries(notcurses-demo
|
||||
PRIVATE
|
||||
@ -59,6 +59,18 @@ target_compile_options(notcurses-demo
|
||||
-Wall -Wextra -W -Wshadow
|
||||
)
|
||||
|
||||
file(GLOB VIEWSRCS CONFIGURE_DEPENDS src/view/*.cpp)
|
||||
add_executable(notcurses-view ${VIEWSRCS})
|
||||
target_include_directories(notcurses-view PRIVATE include)
|
||||
target_link_libraries(notcurses-view
|
||||
PRIVATE
|
||||
notcurses
|
||||
)
|
||||
target_compile_options(notcurses-view
|
||||
PRIVATE
|
||||
-Wall -Wextra -W -Wshadow
|
||||
)
|
||||
|
||||
file(GLOB TESTSRCS CONFIGURE_DEPENDS tests/*.cpp)
|
||||
add_executable(notcurses-tester ${TESTSRCS})
|
||||
find_package(GTest 1.9 REQUIRED)
|
||||
@ -107,6 +119,7 @@ install(FILES
|
||||
)
|
||||
|
||||
install(TARGETS notcurses-demo DESTINATION bin)
|
||||
install(TARGETS notcurses-view DESTINATION bin)
|
||||
install(TARGETS notcurses
|
||||
LIBRARY
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
|
18
src/view/main.cpp
Normal file
18
src/view/main.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include <cstdlib>
|
||||
#include <libgen.h>
|
||||
#include <iostream>
|
||||
|
||||
void usage(std::ostream& o, char* argv0, int exitcode){
|
||||
o << "usage: " << basename(argv0) << " files" << '\n';
|
||||
exit(exitcode);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv){
|
||||
if(argc == 1){
|
||||
usage(std::cerr, argv[0], EXIT_FAILURE);
|
||||
}
|
||||
for(int i = 1 ; i < argc ; ++i){
|
||||
std::cout << "file: " << argv[i] << std::endl;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
@ -11,11 +11,13 @@ class LibavTest : public :: testing::Test {
|
||||
};
|
||||
|
||||
TEST_F(LibavTest, LoadImage) {
|
||||
int ret = notcurses_visual_open(nullptr, "../tools/dsscaw-purp.png");
|
||||
ASSERT_EQ(0, ret);
|
||||
auto ncv = notcurses_visual_open(nullptr, "../tools/dsscaw-purp.png");
|
||||
ASSERT_NE(nullptr, ncv);
|
||||
ncvisual_destroy(ncv);
|
||||
}
|
||||
|
||||
TEST_F(LibavTest, LoadVideo) {
|
||||
int ret = notcurses_visual_open(nullptr, "../tools/atliens.mkv");
|
||||
ASSERT_EQ(0, ret);
|
||||
auto ncv = notcurses_visual_open(nullptr, "../tools/atliens.mkv");
|
||||
ASSERT_NE(nullptr, ncv);
|
||||
ncvisual_destroy(ncv);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user