start sixelanalyzer binary #1724

This commit is contained in:
nick black 2021-12-20 19:42:58 -05:00 committed by nick black
parent 746d7af429
commit 61000ce2a4
3 changed files with 55 additions and 0 deletions

View File

@ -459,6 +459,29 @@ target_link_libraries(ncsixel-static
PUBLIC PUBLIC
notcurses-static notcurses-static
) )
file(GLOB SIXELANALYZERSRC CONFIGURE DEPENDS src/sixelanalyzer/*.c)
add_executable(sixelanalyzer ${SIXELANALYZERSRC})
target_compile_definitions(sixelanalyzer
PRIVATE
_GNU_SOURCE
)
target_include_directories(sixelanalyzer
BEFORE
PRIVATE
include
src
"${TERMINFO_INCLUDE_DIRS}"
"${CMAKE_REQUIRED_INCLUDES}"
"${PROJECT_BINARY_DIR}/include"
)
target_link_libraries(sixelanalyzer
PRIVATE
ncsixel
${LIBM}
${LIBRT}
Threads::Threads
)
############################################################################ ############################################################################
if(${USE_CXX}) if(${USE_CXX})
# libnotcurses++ (C++ wrappers) # libnotcurses++ (C++ wrappers)
@ -1059,6 +1082,7 @@ if(BUILD_EXECUTABLES)
install(TARGETS notcurses-demo DESTINATION bin) install(TARGETS notcurses-demo DESTINATION bin)
install(TARGETS notcurses-info DESTINATION bin) install(TARGETS notcurses-info DESTINATION bin)
install(TARGETS ncneofetch DESTINATION bin) install(TARGETS ncneofetch DESTINATION bin)
install(TARGETS sixelanalyzer DESTINATION bin)
if(NOT WIN32) if(NOT WIN32)
install(TARGETS tfman DESTINATION bin) install(TARGETS tfman DESTINATION bin)
endif() endif()

View File

@ -0,0 +1,25 @@
#ifndef NOTCURSES_LIBSIXEL
#define NOTCURSES_LIBSIXEL
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
struct sixel;
struct sixelctx;
struct sixelctx* libncsixel_init(void);
struct sixel* libncsixel_encode(struct sixelctx* sctx, const char* file, unsigned colorregs);
uint32_t* libncsixel_explode(const struct sixel* s);
void libncsixel_stop(struct sixelctx* sctx);
#ifdef __cplusplus
}
#endif
#endif

6
src/sixelanalyzer/main.c Normal file
View File

@ -0,0 +1,6 @@
#include <stdlib.h>
#include <notcurses/libsixel.h>
int main(void){
return EXIT_SUCCESS;
}