]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
dynamic config include
authorBastian Dehn <hhaalo@arcor.de>
Thu, 7 Mar 2024 19:12:54 +0000 (20:12 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Thu, 7 Mar 2024 19:12:54 +0000 (20:12 +0100)
src/CMakeLists.txt
src/kds_s2000w_net.c

index 5e33a69e515b45a5b842690de3332fd23d8f6eeb..1de7846c64952aa211ca0608b89e9de23b73004a 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 3.25.1)
 
-project("kds_s2000w_net" VERSION "0.0.1")
+project("kds_s2000w_net" VERSION "1.0.0")
 
 find_library(SANE NAMES sane REQUIRED ONLY_CMAKE_FIND_ROOT_PATH)
 message(STATUS "find sane: " ${SANE})
@@ -26,6 +26,7 @@ configure_file(config.h.in config.h)
 
 add_library("sane-kds_s2000w_net"
        SHARED
+       "config.h"
        "kds_s2000w_net.c"
        "kds_s2000w_option_descriptors.c"
        "kds_s2000w_handler.c"
@@ -35,6 +36,7 @@ add_library("sane-kds_s2000w_net"
        "kds_s2000w_debug.c"
        "kds_s2000w_config.c")
 set_target_properties("sane-kds_s2000w_net" PROPERTIES VERSION 1)
+target_include_directories("sane-kds_s2000w_net" PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
 target_link_libraries("sane-kds_s2000w_net"
        ${MATH}
        ${CONFUSE}
index 930d96ed4ba1b96c46fd82e39adfa41d69707c87..e47fc6b0b4f45b5211f829e1c1be0faf95d3e552 100644 (file)
@@ -4,6 +4,7 @@
 #include <unistd.h>
 #include <math.h>
 #include <sane/sane.h>
+#include <config.h>
 #include "kds_s2000w_option_descriptors.h"
 #include "kds_s2000w_handler.h"
 #include "kds_s2000w_debug.h"
@@ -33,7 +34,7 @@ int _sane_kds_s2000w_net_find_first_data_byte(const char* data)
 SANE_Status _sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback authorize)
 {
        debug_printf(ALL, "sane_kds_s2000w_net_init");
-       *version_code = SANE_VERSION_CODE(1, 0, 0);
+       *version_code = SANE_VERSION_CODE(MAJOR, MINOR, PATCH);
        kds_s2000w_option_descriptor_init_option_descriptors();
        return SANE_STATUS_GOOD;
 }