Merge pull request #1 from erijo/confuse-paths
Make settings paths set in cmake be used by telldusd
This commit is contained in:
commit
748d19c58c
3 changed files with 20 additions and 7 deletions
|
@ -240,8 +240,17 @@ ENDIF (UNIX)
|
|||
IF (UNIX AND NOT APPLE)
|
||||
INSTALL(TARGETS ${telldus-service_TARGET} RUNTIME DESTINATION sbin)
|
||||
SET(SYSCONF_INSTALL_DIR "/etc" CACHE PATH "The sysconfig install dir (default prefix/etc)" )
|
||||
SET(STATE_INSTALL_DIR "/var/state" CACHE PATH "The directory to store state information of the devices" )
|
||||
|
||||
IF (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
SET(STATE_INSTALL_DIR "/var/spool" CACHE PATH "The directory to store state information of the devices")
|
||||
ELSE (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
SET(STATE_INSTALL_DIR "/var/state" CACHE PATH "The directory to store state information of the devices")
|
||||
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/SettingsConfusePaths.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/SettingsConfusePaths.h)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
INSTALL(FILES tellstick.conf
|
||||
DESTINATION ${SYSCONF_INSTALL_DIR}
|
||||
)
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
//
|
||||
//
|
||||
#include "Settings.h"
|
||||
#include "SettingsConfusePaths.h"
|
||||
#include "../client/telldus-core.h"
|
||||
#include "Strings.h"
|
||||
#include <confuse.h>
|
||||
|
@ -28,12 +29,8 @@ public:
|
|||
bool readConfig(cfg_t **cfg);
|
||||
bool readVarConfig(cfg_t **cfg);
|
||||
|
||||
const char* CONFIG_FILE = "/etc/tellstick.conf";
|
||||
#ifdef __FreeBSD__
|
||||
const char* VAR_CONFIG_FILE = "/var/spool/telldus-core.conf";
|
||||
#else
|
||||
const char* VAR_CONFIG_FILE = "/var/state/telldus-core.conf";
|
||||
#endif
|
||||
const char* CONFIG_FILE = CONFIG_PATH "/tellstick.conf";
|
||||
const char* VAR_CONFIG_FILE = VAR_CONFIG_PATH "/telldus-core.conf";
|
||||
|
||||
/*
|
||||
* Constructor
|
||||
|
|
7
telldus-core/service/SettingsConfusePaths.h.in
Normal file
7
telldus-core/service/SettingsConfusePaths.h.in
Normal file
|
@ -0,0 +1,7 @@
|
|||
#ifndef SETTINGSCONFUSEPATHS_H
|
||||
#define SETTINGSCONFUSEPATHS_H
|
||||
|
||||
#define CONFIG_PATH "@SYSCONF_INSTALL_DIR@"
|
||||
#define VAR_CONFIG_PATH "@STATE_INSTALL_DIR@"
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue