Skip to content
Browse files

cmake: Configure and install a pkg-config file on Linux

Signed-off-by: Mark Renouf <mark.renouf@gmail.com>
  • Loading branch information...
1 parent 57e7edf commit 9aba304481603fed01227b5ff388371977eb82db @mrenouf mrenouf committed with qdot Nov 23, 2010
Showing with 18 additions and 0 deletions.
  1. +7 −0 src/CMakeLists.txt
  2. +11 −0 src/libfreenect.pc.in
View
7 src/CMakeLists.txt
@@ -29,3 +29,10 @@ target_link_libraries (freenectstatic ${LIBUSB_1_LIBRARIES})
# Install the header file
install (FILES "../include/libfreenect.h" "../include/libfreenect.hpp"
DESTINATION ${PROJECT_INCLUDE_INSTALL_DIR})
+
+IF(UNIX AND NOT APPLE)
+ # Produce a pkg-config file for linking against the shared lib
+ configure_file ("libfreenect.pc.in" "libfreenect.pc" @ONLY)
+ install (FILES "${CMAKE_CURRENT_BINARY_DIR}/libfreenect.pc"
+ DESTINATION "${PROJECT_LIBRARY_INSTALL_DIR}/pkgconfig")
+ENDIF()
View
11 src/libfreenect.pc.in
@@ -0,0 +1,11 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: @CMAKE_PROJECT_NAME@
+Description: Interface to the Microsoft Kinect sensor device.
+Requires: libusb-1.0
+Version: @PROJECT_APIVER@
+Libs: -L${libdir} -lfreenect
+Cflags: -I${includedir}/libfreenect

0 comments on commit 9aba304

Please sign in to comment.
Something went wrong with that request. Please try again.