Added cmake rules for pkgconfig files
authorMarek Vavruša <marek@vavrusa.com>
Tue, 16 Dec 2008 13:57:44 +0000 (14:57 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 16 Dec 2008 13:57:44 +0000 (14:57 +0100)
CMakeLists.txt

index ba9d51f..92d9b87 100644 (file)
@@ -33,7 +33,7 @@ set(CPACK_COMPONENT_HEADERS_DESCRIPTION
 
 set(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development")
 set(CPACK_COMPONENT_STATICLIBS_GROUP "Development")
-set(CPACK_COMPONENT_HEADERS_GROUP "Development")
+set(CPACK_COMPONENT_HEADERS_GROUP    "Development")
 
 # Documentation
 find_package(Doxygen)
@@ -93,4 +93,19 @@ add_subdirectory(ftdipp)
 add_subdirectory(examples)
 add_subdirectory(packages)
 
+# PkgConfig
+set(prefix      ${CMAKE_INSTALL_PREFIX})
+set(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
+set(includedir  ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})
+
+if(${UNIX})
+   set(libdir      ${CMAKE_INSTALL_PREFIX}/lib)
+endif(${UNIX})
+if(${WIN32})
+   set(libdir      ${CMAKE_INSTALL_PREFIX}/bin)
+endif(${WIN32})
+
+configure_file(${CMAKE_SOURCE_DIR}/libftdi.pc.in ${CMAKE_BINARY_DIR}/libftdi.pc @ONLY)
+configure_file(${CMAKE_SOURCE_DIR}/libftdipp.pc.in ${CMAKE_BINARY_DIR}/libftdipp.pc @ONLY)
+
 include(CPack)