mirror of
https://github.com/linuxdeepin/gio-qt.git
synced 2024-12-26 15:06:08 +01:00
feat: pkg-config support
This commit is contained in:
parent
93e9f529af
commit
69e8cc951c
3 changed files with 33 additions and 2 deletions
|
@ -16,11 +16,13 @@ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
|||
set(CMAKE_INSTALL_PREFIX /usr)
|
||||
endif ()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# Find the QtWidgets library
|
||||
find_package(Qt5 ${QT_MINIMUM_VERSION} CONFIG REQUIRED Core)
|
||||
find_package(PkgConfig)
|
||||
|
||||
pkg_check_modules(GIOMM giomm-2.4) # look into FindPkgConfig.cmake,
|
||||
pkg_check_modules(GIOMM giomm-2.4) # look into FindPkgConfig.cmake
|
||||
|
||||
add_subdirectory (gio-qt)
|
||||
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
# Populate a CMake variable with the sources
|
||||
# TODO: portable headers?
|
||||
|
||||
# Some custom variables
|
||||
set(DEST_DIR "${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
CONFIGURE_FILE("gio-qt.pc.in" "gio-qt.pc" @ONLY)
|
||||
|
||||
set (QGIO_PUBLIC_HEADER_FILES
|
||||
dgiovolumemanager.h
|
||||
dgiomountoperation.h
|
||||
|
@ -31,8 +37,19 @@ PUBLIC
|
|||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
||||
|
||||
target_link_libraries (gio-qt Qt5::Core ${GTKMM_LIBRARIES})
|
||||
target_link_libraries (gio-qt Qt5::Core ${GIOMM_LIBRARIES})
|
||||
|
||||
target_compile_definitions(gio-qt PRIVATE
|
||||
QT_NO_KEYWORDS
|
||||
)
|
||||
|
||||
## dev files
|
||||
install (FILES ${QGIO_PUBLIC_HEADER_FILES}
|
||||
DESTINATION include/gio-qt
|
||||
)
|
||||
|
||||
install (TARGETS gio-qt DESTINATION lib)
|
||||
|
||||
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/gio-qt.pc"
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
||||
)
|
||||
|
|
12
gio-qt/gio-qt.pc.in
Normal file
12
gio-qt/gio-qt.pc.in
Normal file
|
@ -0,0 +1,12 @@
|
|||
prefix=@DEST_DIR@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: gio-qt
|
||||
Description: Qt wrapper library for GIO.
|
||||
Version: 1.0
|
||||
Requires: glibmm-2.4
|
||||
|
||||
Libs: -L${libdir} -lgio-qt
|
||||
Cflags: -I${includedir} -I{includedir}/gio-qt
|
Loading…
Reference in a new issue