aboutsummaryrefslogtreecommitdiffstats
path: root/host/CMakeLists.txt
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-09-01 08:51:59 -0700
committerJosh Blum <josh@joshknows.com>2011-09-01 11:59:06 -0700
commit31cdaa9feb4009885d8b4e90d5fddff3565a9257 (patch)
tree2b9453b241bb0afb3a6fd716b83610deb9683727 /host/CMakeLists.txt
parent564453747b91c7d479ba8210c4107539b37f5d15 (diff)
downloaduhd-31cdaa9feb4009885d8b4e90d5fddff3565a9257.tar.gz
uhd-31cdaa9feb4009885d8b4e90d5fddff3565a9257.tar.bz2
uhd-31cdaa9feb4009885d8b4e90d5fddff3565a9257.zip
uhd: fill in other fields of pkg-config file
Diffstat (limited to 'host/CMakeLists.txt')
-rw-r--r--host/CMakeLists.txt60
1 files changed, 46 insertions, 14 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}")