aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/CMakeLists.txt60
-rw-r--r--host/lib/convert/CMakeLists.txt16
-rw-r--r--host/uhd.pc.in8
3 files changed, 60 insertions, 24 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index 7064bfdda..e148ebdf0 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -177,20 +177,6 @@ ADD_CUSTOM_TARGET(uninstall
)
########################################################################
-# Create Pkg Config File
-########################################################################
-CONFIGURE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/uhd.pc.in
- ${CMAKE_CURRENT_BINARY_DIR}/uhd.pc
-@ONLY)
-
-INSTALL(
- FILES ${CMAKE_CURRENT_BINARY_DIR}/uhd.pc
- DESTINATION ${LIBRARY_DIR}/pkgconfig
- COMPONENT libraries
-)
-
-########################################################################
# Install Package Docs
########################################################################
INSTALL(FILES
@@ -235,6 +221,52 @@ ENDIF(ENABLE_UTILS)
ADD_SUBDIRECTORY(usrp_e_utils)
########################################################################
+# Create Pkg Config File
+########################################################################
+#set other pkg-config configuration variables
+IF(ENABLE_USB)
+ LIST(APPEND UHD_PC_REQUIRES "libusb-1.0")
+ENDIF()
+
+IF(ENABLE_ORC)
+ LIST(APPEND UHD_PC_REQUIRES "orc-0.4")
+ENDIF()
+
+FOREACH(inc ${Boost_INCLUDE_DIRS})
+ LIST(APPEND UHD_PC_CFLAGS "-I${inc}")
+ENDFOREACH(inc)
+
+FOREACH(lib ${Boost_LIBRARY_DIRS})
+ LIST(APPEND UHD_PC_LIBS "-L${lib}")
+ENDFOREACH(lib)
+
+FOREACH(lib ${Boost_LIBRARIES})
+ LIST(APPEND UHD_PC_LIBS "-l${lib}")
+ENDFOREACH(lib)
+
+#use space-separation format for the pc file
+STRING(REPLACE ";" " " UHD_PC_REQUIRES "${UHD_PC_REQUIRES}")
+STRING(REPLACE ";" " " UHD_PC_CFLAGS "${UHD_PC_CFLAGS}")
+STRING(REPLACE ";" " " UHD_PC_LIBS "${UHD_PC_LIBS}")
+
+#unset these vars to avoid hard-coded paths to cross environment
+IF(CMAKE_CROSSCOMPILING)
+ UNSET(UHD_PC_CFLAGS)
+ UNSET(UHD_PC_LIBS)
+ENDIF(CMAKE_CROSSCOMPILING)
+
+CONFIGURE_FILE(
+ ${CMAKE_CURRENT_SOURCE_DIR}/uhd.pc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/uhd.pc
+@ONLY)
+
+INSTALL(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/uhd.pc
+ DESTINATION ${LIBRARY_DIR}/pkgconfig
+ COMPONENT libraries
+)
+
+########################################################################
# Handle pre-built images
########################################################################
IF(DEFINED UHD_IMAGES_DIR AND EXISTS "${UHD_IMAGES_DIR}")
diff --git a/host/lib/convert/CMakeLists.txt b/host/lib/convert/CMakeLists.txt
index c6592a25f..b260cb247 100644
--- a/host/lib/convert/CMakeLists.txt
+++ b/host/lib/convert/CMakeLists.txt
@@ -31,8 +31,9 @@ ENDIF(PKG_CONFIG_FOUND)
FIND_PROGRAM(ORCC_EXECUTABLE orcc)
-IF(ORC_FOUND AND ORCC_EXECUTABLE)
- SET(ORC_SUPPORT_ENABLED TRUE)
+LIBUHD_REGISTER_COMPONENT("ORC" ENABLE_ORC ON "ENABLE_LIBUHD;ORC_FOUND;ORCC_EXECUTABLE" OFF)
+
+IF(ENABLE_ORC)
INCLUDE_DIRECTORIES(${ORC_INCLUDE_DIRS})
LINK_DIRECTORIES(${ORC_LIBRARY_DIRS})
ENABLE_LANGUAGE(C)
@@ -41,7 +42,7 @@ IF(ORC_FOUND AND ORCC_EXECUTABLE)
GET_FILENAME_COMPONENT(orc_file_name_we ${orcc_src} NAME_WE)
SET(orcc_gen ${CMAKE_CURRENT_BINARY_DIR}/${orc_file_name_we}.c)
- MESSAGE(STATUS "Orc found, enabling Orc support")
+ MESSAGE(STATUS "Orc found, enabling Orc support.")
ADD_CUSTOM_COMMAND(
COMMAND ${ORCC_EXECUTABLE} --implementation -o ${orcc_gen} ${orcc_src}
DEPENDS ${orcc_src} OUTPUT ${orcc_gen}
@@ -51,10 +52,9 @@ IF(ORC_FOUND AND ORCC_EXECUTABLE)
${CMAKE_CURRENT_SOURCE_DIR}/convert_with_orc.cpp
)
LIBUHD_APPEND_LIBS(${ORC_LIBRARIES})
-ELSE()
- SET(ORC_SUPPORT_ENABLED FALSE)
- MESSAGE(STATUS "Orc not found, disabling orc support...")
-ENDIF(ORC_FOUND AND ORCC_EXECUTABLE)
+ELSE(ENABLE_ORC)
+ MESSAGE(STATUS "Orc not found, disabling orc support.")
+ENDIF(ENABLE_ORC)
########################################################################
# Check for SSE2 SIMD headers
@@ -91,7 +91,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
UNSET(CMAKE_REQUIRED_FLAGS)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-IF(HAVE_ARM_NEON_H AND ORC_SUPPORT_ENABLED)
+IF(HAVE_ARM_NEON_H AND ENABLE_ORC)
#prefer orc support, its faster than the current intrinsic implementations
MESSAGE(STATUS "Enabled conversion support with ORC.")
ELSEIF(HAVE_ARM_NEON_H)
diff --git a/host/uhd.pc.in b/host/uhd.pc.in
index 536f254ed..b27edfd07 100644
--- a/host/uhd.pc.in
+++ b/host/uhd.pc.in
@@ -5,7 +5,11 @@ includedir=${prefix}/@INCLUDE_DIR@
Name: @CPACK_PACKAGE_NAME@
Description: @CPACK_PACKAGE_DESCRIPTION_SUMMARY@
-Requires:
+URL: http://code.ettus.com/redmine/ettus/projects/uhd/wiki
Version: @CPACK_PACKAGE_VERSION@
+Requires:
+Requires.private: @UHD_PC_REQUIRES@
+Conflicts:
+Cflags: -I${includedir} @UHD_PC_CFLAGS@
Libs: -L${libdir} -luhd
-Cflags: -I${includedir}
+Libs.private: @UHD_PC_LIBS@