message(STATUS "SANE_LIBRARY_PATH: " ${SANE_LIBRARY_PATH})
set(SANE_LIBRARY_BACKEND_PATH ${SANE_LIBRARY_PATH}/sane CACHE STRING "sane library backend path")
message(STATUS "SANE_LIBRARY_BACKEND_PATH: " ${SANE_LIBRARY_BACKEND_PATH})
-set(SANE_CONFIG_PATH "/etc/sane.d/" CACHE STRING "config path")
+set(SANE_CONFIG_PATH "/etc/sane.d" CACHE STRING "config path")
message(STATUS "SANE_CONFIG_PATH: " ${SANE_CONFIG_PATH})
+set(CONFIG_FILE ${SANE_CONFIG_PATH}/kds_s2000w_net.conf CACHE STRING "sane kds-s2000w-net config path")
+message(STATUS "CONFIG_FILE: " ${CONFIG_FILE})
configure_file(config.h.in config.h)
install(TARGETS "sane-kds_s2000w_net"
DESTINATION ${SANE_LIBRARY_BACKEND_PATH})
-if (NOT EXISTS "${SANE_CONFIG_PATH}/kds_s2000w_net.conf")
+if (NOT EXISTS ${SANE_CONFIG_PATH})
install(FILES "kds_s2000w_net.conf"
DESTINATION ${SANE_CONFIG_PATH})
endif()
\ No newline at end of file
#define MAJOR @PROJECT_VERSION_MAJOR@
#define MINOR @PROJECT_VERSION_MINOR@
-#define PATCH @PROJECT_VERSION_PATCH@
\ No newline at end of file
+#define PATCH @PROJECT_VERSION_PATCH@
+#define CONFIG_FILE "@CONFIG_FILE@"
\ No newline at end of file
#include <string.h>
#include <stdlib.h>
#include <curl/curl.h>
+#include "config.h"
#include "kds_s2000w_client.h"
#include "kds_s2000w_debug.h"
#include "kds_s2000w_config.h"
void _kds_s2000w_client_load_config()
{
- const char* config_file = "/etc/sane.d/kds_s2000w_net.conf";
+ const char* config_file = CONFIG_FILE;
char* config_stream = read_config_file(config_file);
load_config(&p_config, config_stream);
}