From 7b084e3af206afa20ff5a026ebf5d7e49a755def Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 15 Aug 2010 12:18:35 -0700 Subject: uhd: use cmake to convert the pkg data dir to native system format --- host/lib/CMakeLists.txt | 3 +++ host/lib/constants.hpp.in | 3 +-- host/lib/utils/paths.cpp | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'host') diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt index 48cfe742e..b117b99ce 100644 --- a/host/lib/CMakeLists.txt +++ b/host/lib/CMakeLists.txt @@ -53,6 +53,9 @@ INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/utils/CMakeLists.txt) ######################################################################## # Append to the list of sources for lib uhd ######################################################################## +FILE(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/${PKG_DATA_DIR} FULL_PKG_DATA_DIR) +MESSAGE(STATUS "Full package data directory: ${FULL_PKG_DATA_DIR}") + CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/constants.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/constants.hpp diff --git a/host/lib/constants.hpp.in b/host/lib/constants.hpp.in index aa51e558c..2ed4e302f 100644 --- a/host/lib/constants.hpp.in +++ b/host/lib/constants.hpp.in @@ -23,7 +23,6 @@ //these should be pre-processor macros to avoid static initialization issues #define UHD_VERSION_STRING "@CPACK_PACKAGE_VERSION@" -#define UHD_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" -#define UHD_PKG_DATA_DIR "@PKG_DATA_DIR@" +#define FULL_PKG_DATA_DIR "@FULL_PKG_DATA_DIR@" #endif /* INCLUDED_LIBUHD_CONSTANTS_HPP */ diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp index 9ac20d855..3f29945dd 100644 --- a/host/lib/utils/paths.cpp +++ b/host/lib/utils/paths.cpp @@ -72,13 +72,13 @@ static std::vector get_env_paths(const std::string &var_name){ **********************************************************************/ std::vector get_image_paths(void){ std::vector paths = get_env_paths("UHD_IMAGE_PATH"); - paths.push_back(fs::path(UHD_INSTALL_PREFIX) / UHD_PKG_DATA_DIR / "images"); + paths.push_back(fs::path(FULL_PKG_DATA_DIR) / "images"); return paths; } std::vector get_module_paths(void){ std::vector paths = get_env_paths("UHD_MODULE_PATH"); - paths.push_back(fs::path(UHD_INSTALL_PREFIX) / UHD_PKG_DATA_DIR / "modules"); + paths.push_back(fs::path(FULL_PKG_DATA_DIR) / "modules"); return paths; } -- cgit v1.2.3