summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt9
-rw-r--r--libusbmuxd.pc.in12
2 files changed, 21 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b995967..5128bf7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,10 @@ SET ( LIBUSBMUXD_VERSION "${LIBUSBMUXD_SOVERSION}.${USBMUXD_VERSION}" )
cmake_minimum_required(VERSION 2.6)
+IF(NOT DEFINED CMAKE_INSTALL_LIBDIR)
+ SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
+ENDIF(NOT DEFINED CMAKE_INSTALL_LIBDIR)
+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/Modules/")
add_subdirectory (libusbmuxd)
@@ -15,6 +19,11 @@ add_subdirectory (daemon)
add_subdirectory (tools)
add_subdirectory (udev)
+# pkg-config
+CONFIGURE_FILE ("${CMAKE_SOURCE_DIR}/libusbmuxd.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd.pc")
+# install pkg-config file
+INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/)
+
# add uninstall target
CONFIGURE_FILE( "${CMAKE_SOURCE_DIR}/Modules/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
diff --git a/libusbmuxd.pc.in b/libusbmuxd.pc.in
new file mode 100644
index 0000000..9fcadcb
--- /dev/null
+++ b/libusbmuxd.pc.in
@@ -0,0 +1,12 @@
+prefix=${CMAKE_INSTALL_PREFIX}
+exec_prefix=${CMAKE_INSTALL_PREFIX}
+libdir=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
+includedir=${CMAKE_INSTALL_PREFIX}/include
+
+Name: libusbmuxd
+Description: A library to communicate with the usbmux daemon
+Version: ${USBMUXD_VERSION}
+Requires: libusb-1.0 >= 1.0.2
+Libs: -L${libdir} -lusbmuxd
+Cflags: -I${includedir}
+