From: 石博文 Date: Fri, 29 Dec 2017 09:26:13 +0000 (+0800) Subject: add cmake package search configure X-Git-Tag: archive/raspbian/5.7.12-2+rpi1^2~142^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5e95c7ced9445646a575962f414dca914f2bb1f5;p=dtkcore.git add cmake package search configure Change-Id: Ib661aa6fe7ac2ab4beeccdd21095166312aa9341 --- diff --git a/cmake/Dtk/DtkConfig.cmake b/cmake/Dtk/DtkConfig.cmake new file mode 100644 index 0000000..1f4022c --- /dev/null +++ b/cmake/Dtk/DtkConfig.cmake @@ -0,0 +1,3 @@ +foreach(module ${Dtk_FIND_COMPONENTS}) + find_package(Dtk${module}) +endforeach() diff --git a/cmake/DtkCore/DtkCoreConfig.cmake b/cmake/DtkCore/DtkCoreConfig.cmake new file mode 100644 index 0000000..5ddb42c --- /dev/null +++ b/cmake/DtkCore/DtkCoreConfig.cmake @@ -0,0 +1,4 @@ + +set(INCLUDE_INSTALLED_DIR "/usr/include/libdtk-2.0/DCore") +set(DtkCore_LIBRARIES dtkcore) +include_directories("${INCLUDE_INSTALLED_DIR}") diff --git a/debian/libdtkcore-dev.install b/debian/libdtkcore-dev.install index 0f7e742..ce9428e 100644 --- a/debian/libdtkcore-dev.install +++ b/debian/libdtkcore-dev.install @@ -2,3 +2,4 @@ usr/lib/*/lib*.so usr/include usr/lib/*/pkgconfig/*.pc usr/lib/dtk2/* +usr/lib/*/cmake/*/*.cmake diff --git a/src/src.pro b/src/src.pro index 199932d..6659405 100644 --- a/src/src.pro +++ b/src/src.pro @@ -25,7 +25,15 @@ include($$PWD/settings/settings.pri) includes.files += $$PWD/*.h includes.path = $${DTK_INCLUDEPATH}/DCore -INSTALLS += includes target +# CMake configure +INC_DIR = $$replace(includes.path, "/", "\/") +CMD = sed -i -E \'s/INCLUDE_INSTALLED_DIR \".*\"\\)$/INCLUDE_INSTALLED_DIR \"$${INC_DIR}\"\\)/\' ../cmake/DtkCore/DtkCoreConfig.cmake +system($$CMD) + +cmake_config.path = $$LIB_INSTALL_DIR +cmake_config.files = $$PWD/../cmake + +INSTALLS += includes target cmake_config QMAKE_PKGCONFIG_LIBDIR = $$target.path QMAKE_PKGCONFIG_VERSION = $$VERSION