aboutsummaryrefslogtreecommitdiffstats
path: root/host/CMakeLists.txt
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-11-10 23:32:16 -0800
committerMartin Braun <martin.braun@ettus.com>2018-02-20 16:23:46 -0800
commit9fb055a78a1452547abd490cccce8b804cc3b153 (patch)
treef9885333620cc504ee48a6c39bb22506b20e9898 /host/CMakeLists.txt
parenta99e89a689490aa03e2bbd8153b61e394cd55a6e (diff)
downloaduhd-9fb055a78a1452547abd490cccce8b804cc3b153.tar.gz
uhd-9fb055a78a1452547abd490cccce8b804cc3b153.tar.bz2
uhd-9fb055a78a1452547abd490cccce8b804cc3b153.zip
lib: Add 'prefs' API
This defines and reads configuration files that can be used to customize UHD's behaviour. On Unix systems, they default to: /etc/uhd/uhd.conf $APPDATA/.uhd/uhd.conf On Windows systems, it will look in: %ProgramData%/uhd/uhd.conf %AppData%/.uhd/uhd.conf
Diffstat (limited to 'host/CMakeLists.txt')
-rw-r--r--host/CMakeLists.txt25
1 files changed, 24 insertions, 1 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index 72fafacbb..55f78ac30 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -104,7 +104,6 @@ ENDIF()
SET(LIBUHD_PKG ${LIBUHD_PKG} CACHE BOOL "Build Debian libuhd003 package")
SET(LIBUHDDEV_PKG ${LIBUHDDEV_PKG} CACHE BOOL "Build Debian libuhd-dev package")
SET(UHDHOST_PKG ${UHDPOST_PKG} CACHE BOOL "Build Debian uhd-host package")
-
INCLUDE(UHDComponent) #enable components
INCLUDE(UHDPackage) #setup cpack
@@ -131,6 +130,30 @@ SET(PKG_DOC_DIR share/doc/uhd)
SET(PKG_MAN_DIR share/man/man1)
########################################################################
+# UHD config files
+########################################################################
+SET(UHD_USER_CONF_FILE
+ ".uhd/uhd.conf"
+ CACHE STRING
+ "Location of the user-specific UHD configuration file, relative to APPDATA (or HOME)"
+)
+IF(UNIX)
+ SET(UHD_SYS_CONF_FILE
+ "/etc/uhd/uhd.conf"
+ CACHE STRING
+ "Location of the system-wide UHD configuration file"
+ )
+ELSEIF(WIN32)
+ SET(UHD_SYS_CONF_FILE
+ "%programdata%/uhd/uhd.conf"
+ CACHE STRING
+ "Location of the system-wide UHD configuration file"
+ )
+ELSE()
+ MESSAGE(WARNING "Not setting UHD_SYS_CONF_FILE!")
+ENDIF()
+
+########################################################################
# UHD Image Directories
########################################################################
IF(NOT DEFINED UHD_IMAGES_DIR)