Skip to content
Browse files

implemented #70: pkg-config for libs

  • Loading branch information...
1 parent 85260c6 commit e425f196a3c93ead16cf7e024103eb9352736ec5 @pvanek pvanek committed Dec 23, 2011
View
2 CMakeLists.txt
@@ -27,7 +27,7 @@ message(STATUS "Razor-qt version: ${RAZOR_VERSION}")
message(STATUS "")
# additional cmake files
-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
include(RazorConfigRegister)
View
25 cmake/create_pkgconfig_file.cmake
@@ -0,0 +1,25 @@
+#
+# Write a pkg-config pc file for given "name" with "decription"
+# Arguments:
+# name: a library name (withoud "lib" prefix and "so" suffixes
+# desc: a desription string
+#
+macro (create_pkgconfig_file name desc)
+ set(_pkgfname "${CMAKE_CURRENT_BINARY_DIR}/${name}.pc")
+ message(STATUS "${name}: writing pkgconfig file ${_pkgfname}")
+
+ file(WRITE "${_pkgfname}" "# file generated by razor-qt cmake build
+prefix=${CMAKE_INSTALL_PREFIX}
+libdir=\${prefix}/lib${LIB_SUFFIX}
+includedir=\${prefix}/include
+
+Name: ${name}
+Description: ${desc}
+Version: ${RAZOR_VERSION}
+Libs: -L\${libdir} -l${name}
+Cflags: -I\${includedir}
+
+")
+
+ install(FILES ${_pkgfname} DESTINATION lib${LIB_SUFFIX}/pkgconfig)
+endmacro()
View
5 libraries/qtxdg/CMakeLists.txt
@@ -1,7 +1,7 @@
project(libqtxdg)
# additional cmake files
-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set (MAJOR_VERSION 0)
set (MINOR_VERSION 1)
@@ -98,4 +98,5 @@ install(TARGETS qtxdg DESTINATION lib${LIB_SUFFIX})
install(FILES ${QTXDG_PUBLIC_HDRS} DESTINATION include/qtxdg)
install(FILES ${QTXDG_QM_FILES} DESTINATION ${APP_SHARE_DIR})
-
+include(create_pkgconfig_file)
+create_pkgconfig_file(qtxdg "QtXdg, a Qt implementation of XDG standards")
View
3 libraries/razormount/CMakeLists.txt
@@ -50,5 +50,8 @@ set_target_properties(razormount PROPERTIES
install(TARGETS razormount DESTINATION lib${LIB_SUFFIX})
install(FILES ${razormount_HDRS} DESTINATION include/razormount)
+include(create_pkgconfig_file)
+create_pkgconfig_file(razormount "Razor-qt library for removable media/devices")
+
endif (NOT UDEV_STABLE)
View
2 libraries/razorqt/CMakeLists.txt
@@ -100,3 +100,5 @@ install(TARGETS razorqt DESTINATION lib${LIB_SUFFIX})
install(FILES ${razorqt_HDRS} DESTINATION include/razorqt)
install(FILES ${RAZORQT_QM_FILES} DESTINATION ${APP_SHARE_DIR})
+include(create_pkgconfig_file)
+create_pkgconfig_file(razorqt "Shared library for Razor-qt applications")
View
3 libraries/razorqxt/CMakeLists.txt
@@ -28,3 +28,6 @@ set_target_properties(razorqxt PROPERTIES
install(TARGETS razorqxt DESTINATION lib${LIB_SUFFIX})
install(FILES ${razorqxt_HDRS} DESTINATION include/razorqxt)
+
+include(create_pkgconfig_file)
+create_pkgconfig_file(razorqxt "Customized Qxt library for Razor-qt project")

0 comments on commit e425f19

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