[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-i18n-doc
Subject: [PATCH] Port autogen.sh to ECM
From: Aurélien Gâteau <agateau () kde ! org>
Date: 2014-04-14 11:12:30
Message-ID: ligfqv$a6f$1 () ger ! gmane ! org
[Download RAW message or body]
Hi,
Attached patch ports l1On-kf5/scripts/autogen.sh to ECM.
For the sake of simplification, I replaced calls to
macro_optional_add_subdirectory() with calls to add_subdirectory() since the
code generating the CMakeLists.txt checks the directory exists before adding
an add_subdirectory()" call.
I tested it with a handful of messages and doc .po. There is an issue with
doc installation failing to create a "common" symlink, but the problem needs
to be fixed in kdoctools as far as I understand.
Assuming this patch is OK for you, would you mind if I also create a
separate commit to fix the indentation? The current inconsistent mix of tabs
and spaces makes it annoying to work with.
Aurélien
["autogen-ecm.diff" (text/x-patch)]
Index: autogen.sh
===================================================================
--- autogen.sh (révision 1384126)
+++ autogen.sh (copie de travail)
@@ -13,7 +13,7 @@
fname=$(basename $manfile)
name=${fname%.docbook}
no=${name##*.}
- echo "kde4_create_manpage($fname $no INSTALL_DESTINATION \
\${MAN_INSTALL_DIR}/\${CURRENT_LANG}/ )" >> $subdir/CMakeLists.txt + echo \
"kdoctools_create_manpage($fname $no INSTALL_DESTINATION \
\${MAN_INSTALL_DIR}/\${CURRENT_LANG}/ )" >> $subdir/CMakeLists.txt done
}
@@ -31,8 +31,8 @@
for subdir in $list_dir; do
echo "add_subdirectory( $subdir )" >> $dir_local/CMakeLists.txt
if test -f $dir_local/index.docbook; then
- if ! grep -q "kde4_create_handbook" $dir_local/CMakeLists.txt; then
- echo "kde4_create_handbook(index.docbook INSTALL_DESTINATION \
\${HTML_INSTALL_DIR}/\${CURRENT_LANG}/ )" >> $dir_local/CMakeLists.txt; + if \
! grep -q "kdoctools_create_handbook" $dir_local/CMakeLists.txt; then + \
echo "kdoctools_create_handbook(index.docbook INSTALL_DESTINATION \
\${HTML_INSTALL_DIR}/\${CURRENT_LANG}/ )" >> $dir_local/CMakeLists.txt; fi
fi
add_cmake_files_doc $dir_local/$subdir;
@@ -65,7 +65,7 @@
if [ ! -z $documentationnotfound_found ]; then
add_subdir="SUBDIR khelpcenter/$subdir";
fi
- echo "kde4_create_handbook(index.docbook INSTALL_DESTINATION \
\${HTML_INSTALL_DIR}/\${CURRENT_LANG}/ $add_subdir )" >> \
$dir_local/$subdir/CMakeLists.txt; + echo \
"kdoctools_create_handbook(index.docbook INSTALL_DESTINATION \
\${HTML_INSTALL_DIR}/\${CURRENT_LANG}/ $add_subdir )" >> \
$dir_local/$subdir/CMakeLists.txt; fi
;;
esac
@@ -88,13 +88,16 @@
if test ! -f CMakeLists.txt; then # not in sub-language dir
cat > $dir/CMakeLists.txt <<EOF
project(kde-i18n-$dir)
+cmake_minimum_required(VERSION 2.8.12)
-# Search KDE installation
-find_package(KDE4 REQUIRED)
find_package(Gettext REQUIRED)
-include (KDE4Defaults)
-include(MacroOptionalAddSubdirectory)
+find_package(ECM 0.0.12 REQUIRED)
+set(CMAKE_MODULE_PATH \${ECM_MODULE_PATH} \${ECM_KDE_MODULE_DIR})
+include(KDEInstallDirs)
+
+find_package(KF5DocTools REQUIRED)
+
if (NOT GETTEXT_MSGMERGE_EXECUTABLE)
MESSAGE(FATAL_ERROR "Please install the msgmerge binary")
endif (NOT GETTEXT_MSGMERGE_EXECUTABLE)
@@ -110,13 +113,13 @@
# UI message catalogs.
if test -d $dir/messages; then
- echo "macro_optional_add_subdirectory( messages )" >> \
$dir/CMakeLists.txt + echo "add_subdirectory(messages)" >> \
$dir/CMakeLists.txt
: > $dir/messages/CMakeLists.txt
dirs=`cd $dir/messages && find * -maxdepth 1 -type d -not -empty | fgrep -v \
others | fgrep -v www.kde.org | fgrep -v "\.svn" | grep -v ^www$ | grep -v koffice` \
for dir2 in $dirs; do
echo "file(GLOB _po_files *.po)" > $dir/messages/$dir2/CMakeLists.txt
- echo "GETTEXT_PROCESS_PO_FILES(\${CURRENT_LANG} ALL \
INSTALL_DESTINATION \${LOCALE_INSTALL_DIR} \${_po_files} )" >> \
$dir/messages/$dir2/CMakeLists.txt + echo \
"GETTEXT_PROCESS_PO_FILES(\${CURRENT_LANG} ALL INSTALL_DESTINATION \
\${LOCALE_INSTALL_DIR} PO_FILES \${_po_files} )" >> \
$dir/messages/$dir2/CMakeLists.txt echo "add_subdirectory($dir2)" >> \
$dir/messages/CMakeLists.txt done
files=`cd $dir/messages && find -L . -maxdepth 1 -type f | egrep -v \
"CMakeLists.txt|no-auto-merge" | sed -e "s,^./,,"` @@ -128,7 +131,7 @@
# Documentation.
dirs=
if test -d $dir/docs; then
- echo "macro_optional_add_subdirectory( docs )" >> $dir/CMakeLists.txt;
+ echo "add_subdirectory(docs)" >> $dir/CMakeLists.txt;
add_cmake_files_doc $dir/docs;
add_cmake_files_manpage $dir/docs;
fi
@@ -163,7 +166,7 @@
if test -d $dir/data; then
# remove old CMakeLists.txt
rm -f $dir/data/CMakeLists.txt;
- echo "macro_optional_add_subdirectory( data )" >> $dir/CMakeLists.txt
+ echo "add_subdirectory(data)" >> $dir/CMakeLists.txt
dirs=`cd $dir/data && find * -maxdepth 0 -type d -not -empty | fgrep -v \
.svn` for dir2 in $dirs; do
echo "add_subdirectory($dir2)" >> $dir/data/CMakeLists.txt
@@ -177,7 +180,7 @@
# Transcript files.
if test -d $dir/scripts; then
- echo "macro_optional_add_subdirectory( scripts )" >> $dir/CMakeLists.txt
+ echo "add_subdirectory(scripts)" >> $dir/CMakeLists.txt
dirs2=`cd $dir/scripts && find * -maxdepth 0 -type d -not -empty | fgrep -v \
.svn | fgrep -v internal` : > $dir/scripts/CMakeLists.txt
cmakeincfile=CMakeInclude.cmake
@@ -198,7 +201,7 @@
sublangs=`find $dir -maxdepth 1 -type d -iname "$dir[_@]*" -not -empty`
for subl in $sublangs; do
sublc=`basename $subl`
- echo "macro_optional_add_subdirectory( $sublc )" >> $dir/CMakeLists.txt
+ echo "add_subdirectory($sublc)" >> $dir/CMakeLists.txt
done
# Recurse for sub-languages.
agcmd=`echo $0`
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic