From 744732fb4ff701ca6da9fcde60a7da6d9e0dbb11 Mon Sep 17 00:00:00 2001 From: Patrick Roth Date: Tue, 22 Oct 2019 12:56:59 +0200 Subject: Library version defined in CMakeLists.txt Current library version can be requested with function color_pipe_get_version(). --- CMakeLists.txt | 42 ++++++++++++++++++++++++++++++++++-------- ChangeLog | 17 ++++++++++++----- color_pipe.c | 18 ++++++++++++++++++ color_pipe.h | 9 +-------- 4 files changed, 65 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0590745..6c8716d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,11 +3,26 @@ # project(O-3000-Color-Pipe) -cmake_minimum_required(VERSION 2.4) + +cmake_minimum_required(VERSION 3.0) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) set(CMAKE_INCLUDE_CURRENT_DIR ON) +# library version definition +set(VERSION_MAJOR 1) +set(VERSION_MINOR 0) +set(VERSION_RELEASE 2) +set(VERSION_STR "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}") + +# pass macros to preprocessor +add_definitions(-DPIPE_VERSION_MAJOR=${VERSION_MAJOR}) +add_definitions(-DPIPE_VERSION_MINOR=${VERSION_MINOR}) +add_definitions(-DPIPE_VERSION_RELEASE=${VERSION_RELEASE}) + +# library name +set(LIB_NAME o3000_imgpipe) + # find libo3000 library find_package(LibO3000 REQUIRED) @@ -15,16 +30,27 @@ include_directories(.) file(GLOB colorpipesources *.c *.h) -add_library(o3000_imgpipe SHARED ${colorpipesources}) +add_library(${LIB_NAME} SHARED ${colorpipesources}) -set_target_properties (o3000_imgpipe PROPERTIES - OUTPUT_NAME "o3000_imgpipe" - VERSION 1.0.0 - SOVERSION 1 +set_target_properties ( ${LIB_NAME} PROPERTIES + OUTPUT_NAME "${LIB_NAME}" + VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}" + SOVERSION ${VERSION_MAJOR} LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) -target_compile_options(o3000_imgpipe PRIVATE -Wall -g -O3 -std=c11 -ggdb -D_XOPEN_SOURCE=500 -fPIC) +target_compile_options(${LIB_NAME} PRIVATE -Wall -g -O3 -std=c11 -ggdb -D_XOPEN_SOURCE=500 -fPIC) -install(TARGETS o3000_imgpipe DESTINATION lib) +install(TARGETS ${LIB_NAME} DESTINATION lib) install(FILES "color_pipe.h" DESTINATION "include/o3000") + +add_custom_target(release_mingw64 DEPENDS ${LIB_NAME}) +add_custom_command( + TARGET release_mingw64 + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/libo3000_imgpipe-${VERSION_STR}/include/o3000 + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/libo3000_imgpipe-${VERSION_STR}/MinGW64 + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/color_pipe.h ${CMAKE_CURRENT_BINARY_DIR}/libo3000_imgpipe-${VERSION_STR}/include/o3000 + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/$* ${CMAKE_CURRENT_BINARY_DIR}/libo3000_imgpipe-${VERSION_STR}/MinGW64 + COMMAND ${CMAKE_COMMAND} -E tar "cfv" "libo3000_imgpipe-${VERSION_STR}.zip" --format=zip libo3000_imgpipe-${VERSION_STR} + COMMAND ${CMAKE_COMMAND} -E remove_directory libo3000_imgpipe-${VERSION_STR} +) diff --git a/ChangeLog b/ChangeLog index 3b07238..155b92a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,10 +2,17 @@ - ChangeLog Color Image Processing Pipeline ------------------------------------------------------------------------------- -Version 1.0.1 - 2019-10-16 (SP) - - Modified implementation of sharpening to eliminate black line appearing at image bottom - - Correction for gamma correction computation - - Modified camera calibration: now taking into account image resolution +Version 1.0.2 + 2019-10-16 PR + - Library version defined in CMakeLists.txt and passed to preprocessor. + - New function added color_pipe_get_version(). -Version 1.0.0 - 2015-10-16 (PR) +Version 1.0.1 + 2019-10-16 SP + - Modified implementation of sharpening to eliminate black line appearing at image bottom + - Correction for gamma correction computation + - Modified camera calibration: now taking into account image resolution + +Version 1.0.0 + 2015-10-16 PR Inititial version diff --git a/color_pipe.c b/color_pipe.c index 986989f..0f7ae32 100644 --- a/color_pipe.c +++ b/color_pipe.c @@ -967,3 +967,21 @@ int __stdcall color_pipe_close(struct color_pipe_t *data) { free(data); return 0; } + + +/** + * Return library version. + * + * @param major On return: major number + * @param minor On return: minor number + * @param release On return: release number + */ +void __stdcall color_pipe_get_version(int *major, int *minor, int *release) { + if(major == NULL || minor == NULL || release == NULL) { + printf("%s: at least one version variable is NULL!\n", __func__); + return; + } + *major = PIPE_VERSION_MAJOR; + *minor = PIPE_VERSION_MINOR; + *release = PIPE_VERSION_RELEASE; +} diff --git a/color_pipe.h b/color_pipe.h index 42af584..2833d0f 100644 --- a/color_pipe.h +++ b/color_pipe.h @@ -35,14 +35,6 @@ #include -/** - * library version - */ -#define COLOR_PIPE_VERSION "1.0.1" - - - - /** * demosaicing algorithm definition */ @@ -312,6 +304,7 @@ extern "C" { void __stdcall color_pipe_process(struct color_pipe_t *color_pipe, void *img_buf, struct img_header_t *img_header); int __stdcall color_pipe_open(struct color_pipe_t **color_pipe, const int max_img_height, const int max_img_width, const int bits_per_channel); int __stdcall color_pipe_close(struct color_pipe_t *data); +void __stdcall color_pipe_get_version(int *major, int *minor, int *release); void __stdcall color_pipe_stageconf_debayer(struct color_pipe_t *color_pipe, enum bayer_alg_t alg); void __stdcall color_pipe_stageconf_awb(struct color_pipe_t *color_pipe, int enable, float gray_threshold, float ctrl_gain); -- cgit v1.2.1