add cmake package search configure
author石博文 <sbw@sbw.so>
Fri, 29 Dec 2017 09:26:13 +0000 (17:26 +0800)
committer石博文 <sbw@sbw.so>
Tue, 2 Jan 2018 03:05:00 +0000 (11:05 +0800)
Change-Id: Ib661aa6fe7ac2ab4beeccdd21095166312aa9341

cmake/Dtk/DtkConfig.cmake [new file with mode: 0644]
cmake/DtkCore/DtkCoreConfig.cmake [new file with mode: 0644]
debian/libdtkcore-dev.install
src/src.pro

diff --git a/cmake/Dtk/DtkConfig.cmake b/cmake/Dtk/DtkConfig.cmake
new file mode 100644 (file)
index 0000000..1f4022c
--- /dev/null
@@ -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 (file)
index 0000000..5ddb42c
--- /dev/null
@@ -0,0 +1,4 @@
+
+set(INCLUDE_INSTALLED_DIR "/usr/include/libdtk-2.0/DCore")
+set(DtkCore_LIBRARIES dtkcore)
+include_directories("${INCLUDE_INSTALLED_DIR}")
index 0f7e7425bdc96932d60dda31691f05afcc28c08a..ce9428eb94ff93be9b69fbdc158e1652e8d82147 100644 (file)
@@ -2,3 +2,4 @@ usr/lib/*/lib*.so
 usr/include
 usr/lib/*/pkgconfig/*.pc
 usr/lib/dtk2/*
+usr/lib/*/cmake/*/*.cmake
index 199932dffb670947eb3423b17cfcd0852714f957..665940501501fa7e50e378bbb0d08b2206768a34 100644 (file)
@@ -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