[SCM] KDE Localization module packaging branch, master, updated. debian/4.6.4-1-10-gf4cb49e

Modestas Vainius modax at alioth.debian.org
Mon Jul 18 18:16:11 UTC 2011


The following commit has been merged in the master branch:
commit 7f17ce17c98f27b5eef8b9d5a19babf083c0f0e9
Author: Modestas Vainius <modax at debian.org>
Date:   Mon Jul 18 15:46:10 2011 +0300

    Implement exclusion of subdirectories at cmake level.
    
    This is done by hijacking system FindKDE4 (debian/cmake/FindKDE4.cmake) and
    adding custom code to it which overrides add_subdirectory() call. This
    technique is used to fully exclude all kdepim-runtime and kdepim translations.
---
 debian/changelog            |    3 +++
 debian/cmake/FindKDE4.cmake |   29 +++++++++++++++++++++++++++++
 debian/rules                |    4 +++-
 3 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b9f1ac7..3e60eba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,9 @@ kde-l10n (4:4.6.5-0r1) UNRELEASED; urgency=low
   * New upstream release.
   * Bump kde-sc-dev-latest build-dependency to 4:4.6.5.
   * Use dh_auto_* tools in debian/rules wherever it makes sense.
+  * Hijack FindKDE4 module in order to implement exclusion of subdirectories at
+    cmake level. Use this technique to fully exclude all kdepim-runtime and
+    kdepim translations.
 
  -- Modestas Vainius <modax at debian.org>  Mon, 04 Jul 2011 11:54:22 +0300
 
diff --git a/debian/cmake/FindKDE4.cmake b/debian/cmake/FindKDE4.cmake
new file mode 100644
index 0000000..d7476fa
--- /dev/null
+++ b/debian/cmake/FindKDE4.cmake
@@ -0,0 +1,29 @@
+# Parameters
+# DEBIAN_EXCLUDE_DIRS - a list of subdirectories to exclude from subprojects.
+#                       This can be used to exclude specific KDE modules from
+#                       the build.
+
+# Shut up cmake about empty subdirectories
+cmake_policy(SET CMP0014 OLD)
+
+# Override add_subdirectory() built-in function
+function(add_subdirectory subdir)
+	# Do not add directory if it's in the DEBIAN_EXCLUDE_DIRS list
+	set(add_this_dir 1)
+	foreach (dir ${DEBIAN_EXCLUDE_DIRS})
+		if (${dir} STREQUAL ${subdir})
+			set(add_this_dir 0)
+			break()
+		endif(${dir} STREQUAL ${subdir})
+	endforeach (dir ${DEBIAN_EXCLUDE_DIRS})
+	if (add_this_dir)
+		_add_subdirectory(${subdir})
+	else (add_this_dir)
+		# Get directory name
+		file(RELATIVE_PATH parent_dir ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
+		message(STATUS "${PROJECT_NAME}: excluding directory ${parent_dir}/${subdir}")
+	endif (add_this_dir)
+endfunction(add_subdirectory)
+
+# Include system FindKDE4.cmake
+include("${CMAKE_ROOT}/Modules/FindKDE4.cmake")
diff --git a/debian/rules b/debian/rules
index d969516..9d94944 100755
--- a/debian/rules
+++ b/debian/rules
@@ -51,7 +51,9 @@ build: $(STAMP_BUILD)
 
 $(STAMP_BUILD): | prepare_build
 	# Building the '$(cur_lang)' language ...
-	dh_auto_configure -Scmake -D$(cur_lang) -B$(cur_lang_builddir) -- -DCMAKE_BUILD_TYPE=Debian
+	dh_auto_configure -Scmake -D$(cur_lang) -B$(cur_lang_builddir) -- -DCMAKE_BUILD_TYPE=Debian \
+	    -DCMAKE_MODULE_PATH='$(CURDIR)/debian/cmake' \
+	    -DDEBIAN_EXCLUDE_DIRS='kdepim-runtime;kdepim'
 	$(MAKE) -C $(cur_lang_builddir)
 	touch $@
 

-- 
KDE Localization module packaging



More information about the pkg-kde-commits mailing list