diff options
author | Josh Blum <josh@joshknows.com> | 2011-04-14 09:34:37 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-04-14 09:34:37 -0700 |
commit | 291a46b86e8e639b711a609134ace667235eeb91 (patch) | |
tree | 51097428875ca347177b96177f963d6600993356 /host/lib | |
parent | 5e8b0752a41f836f82c64a2c4e25a3786259b60e (diff) | |
download | uhd-291a46b86e8e639b711a609134ace667235eeb91.tar.gz uhd-291a46b86e8e639b711a609134ace667235eeb91.tar.bz2 uhd-291a46b86e8e639b711a609134ace667235eeb91.zip |
uhd: specify the UHD_PKG_DATA_PATH once (since images shipped w/ drivers)
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/CMakeLists.txt | 16 | ||||
-rw-r--r-- | host/lib/constants.hpp.in | 3 | ||||
-rw-r--r-- | host/lib/utils/paths.cpp | 8 |
3 files changed, 6 insertions, 21 deletions
diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt index 8ca7c7dca..618e33608 100644 --- a/host/lib/CMakeLists.txt +++ b/host/lib/CMakeLists.txt @@ -81,19 +81,9 @@ INCLUDE_SUBDIRECTORY(utils) ######################################################################## # Setup compiled-in constants for data directories ######################################################################## -FILE(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/${PKG_DATA_DIR} LOCAL_PKG_DATA_DIR) -STRING(REPLACE "\\" "\\\\" LOCAL_PKG_DATA_DIR ${LOCAL_PKG_DATA_DIR}) -MESSAGE(STATUS "Local package data directory: ${LOCAL_PKG_DATA_DIR}") - -IF(UNIX) - #on unix systems, installers will use this directory for the package data - FILE(TO_NATIVE_PATH /usr/${PKG_DATA_DIR} INSTALLER_PKG_DATA_DIR) -ELSE() - #for the NSIS installer, this will be the default path for package data - FILE(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}/${PKG_DATA_DIR}" INSTALLER_PKG_DATA_DIR) -ENDIF() -STRING(REPLACE "\\" "\\\\" INSTALLER_PKG_DATA_DIR ${INSTALLER_PKG_DATA_DIR}) -MESSAGE(STATUS "Installer package data directory: ${INSTALLER_PKG_DATA_DIR}") +FILE(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/${PKG_DATA_DIR} UHD_PKG_DATA_PATH) +STRING(REPLACE "\\" "\\\\" UHD_PKG_DATA_PATH ${UHD_PKG_DATA_PATH}) +MESSAGE(STATUS "Full package data directory: ${UHD_PKG_DATA_PATH}") CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/constants.hpp.in diff --git a/host/lib/constants.hpp.in b/host/lib/constants.hpp.in index d62dda1cb..2e0495b12 100644 --- a/host/lib/constants.hpp.in +++ b/host/lib/constants.hpp.in @@ -20,7 +20,6 @@ //these should be pre-processor macros to avoid static initialization issues #define UHD_VERSION_STRING "@UHD_VERSION@-@UHD_BUILD_INFO@" -#define LOCAL_PKG_DATA_DIR "@LOCAL_PKG_DATA_DIR@" -#define INSTALLER_PKG_DATA_DIR "@INSTALLER_PKG_DATA_DIR@" +#define UHD_PKG_DATA_PATH "@UHD_PKG_DATA_PATH@" #endif /* INCLUDED_LIBUHD_CONSTANTS_HPP */ diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp index 329695873..0ddc80d6e 100644 --- a/host/lib/utils/paths.cpp +++ b/host/lib/utils/paths.cpp @@ -76,16 +76,12 @@ static std::vector<fs::path> get_env_paths(const std::string &var_name){ **********************************************************************/ std::vector<fs::path> get_image_paths(void){ std::vector<fs::path> paths = get_env_paths("UHD_IMAGE_PATH"); - paths.push_back(fs::path(LOCAL_PKG_DATA_DIR) / "images"); - if (not std::string(INSTALLER_PKG_DATA_DIR).empty()) - paths.push_back(fs::path(INSTALLER_PKG_DATA_DIR) / "images"); + paths.push_back(fs::path(UHD_PKG_DATA_PATH) / "images"); return paths; } std::vector<fs::path> get_module_paths(void){ std::vector<fs::path> paths = get_env_paths("UHD_MODULE_PATH"); - paths.push_back(fs::path(LOCAL_PKG_DATA_DIR) / "modules"); - if (not std::string(INSTALLER_PKG_DATA_DIR).empty()) - paths.push_back(fs::path(INSTALLER_PKG_DATA_DIR) / "modules"); + paths.push_back(fs::path(UHD_PKG_DATA_PATH) / "modules"); return paths; } |