Skip to content

Commit

Permalink
feat: organized header files
Browse files Browse the repository at this point in the history
Signed-off-by: k4yt3x <[email protected]>
  • Loading branch information
k4yt3x committed Oct 13, 2024
1 parent 7822e61 commit cec6a73
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ option(BUILD_VIDEO2X_CLI "Build the video2x executable" ON)
option(USE_SYSTEM_SPDLOG "Use system spdlog library" ON)
option(USE_SYSTEM_NCNN "Use system ncnn library" ON)

# Generate the version header file
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/include/libvideo2x/version.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/libvideo2x/version.h"
@ONLY
)

# Find the required packages
set(ALL_INCLUDE_DIRS)
set(ALL_LIBRARIES)
Expand Down Expand Up @@ -234,7 +241,9 @@ add_dependencies(libvideo2x realesrgan)
# Include directories for the shared library
target_include_directories(libvideo2x PRIVATE
${ALL_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/include/libvideo2x
${PROJECT_SOURCE_DIR}/third_party/libreal_esrgan_ncnn_vulkan/src
)

Expand Down Expand Up @@ -272,6 +281,7 @@ if (BUILD_VIDEO2X_CLI)
# Include directories for the executable
target_include_directories(video2x PRIVATE
${ALL_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/include
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions include/libvideo2x/version.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef VERSION_H
#define VERSION_H

#define LIBVIDEO2X_VERSION_STRING "@PROJECT_VERSION@"

#endif // VERSION_H
7 changes: 3 additions & 4 deletions src/video2x.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
#include <libavutil/pixdesc.h>
#include <libavutil/pixfmt.h>

#include <libvideo2x.h>
#include <libvideo2x/libvideo2x.h>
#include <libvideo2x/version.h>

#include "getopt.h"

const char *VIDEO2X_VERSION = "6.0.0";

// Set UNIX terminal input to non-blocking mode
#ifndef _WIN32
void set_nonblocking_input(bool enable) {
Expand Down Expand Up @@ -279,7 +278,7 @@ void parse_arguments(int argc, char **argv, struct arguments *arguments) {
}
break;
case 'v':
printf("Video2X v%s\n", VIDEO2X_VERSION);
printf("Video2X version %s\n", LIBVIDEO2X_VERSION_STRING);
exit(0);
case 0: // Long-only options without short equivalents
if (strcmp(long_options[option_index].name, "loglevel") == 0) {
Expand Down

0 comments on commit cec6a73

Please sign in to comment.