Permalink
Browse files

[cmake] require 4.2.7 and further clean up.

  • Loading branch information...
1 parent c012e80 commit 235ecb2f7902e65ca0086f2ee176fc5e962e690a @yuyichao yuyichao committed Dec 10, 2012
Showing with 7 additions and 87 deletions.
  1. +7 −14 CMakeLists.txt
  2. +0 −21 cmake/cmake_uninstall.cmake.in
  3. +0 −6 po/POTFILES.in.in
  4. +0 −46 po/getdescpo
View
@@ -1,35 +1,28 @@
-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required(VERSION 2.6)
project(fcitx-chewing)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
FIND_PACKAGE(Chewing REQUIRED)
FIND_PACKAGE(Gettext REQUIRED)
-FIND_PACKAGE(Fcitx REQUIRED)
+FIND_PACKAGE(Fcitx 4.2.7 REQUIRED)
-# uninstall target
-configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
- IMMEDIATE @ONLY)
-
-add_custom_target(uninstall
- COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
+_fcitx_add_uninstall_target()
set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -fvisibility=hidden ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -fvisibility=hidden ${CMAKE_CXX_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_MODULE_LINKER_FLAGS}")
if(NOT DEFINED LIB_INSTALL_DIR)
- set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
+ set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
endif()
configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/config.h.in"
- "${CMAKE_CURRENT_BINARY_DIR}/config.h"
- )
+ "${CMAKE_CURRENT_SOURCE_DIR}/config.h.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/config.h"
+ )
set(libdir ${LIB_INSTALL_DIR})
@@ -1,21 +0,0 @@
-if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
- message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
-endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
-
-file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
-string(REGEX REPLACE "\n" ";" files "${files}")
-foreach (file ${files})
- message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
- if (EXISTS "$ENV{DESTDIR}${file}" OR IS_SYMLINK "$ENV{DESTDIR}${file}")
- execute_process(
- COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
- OUTPUT_VARIABLE rm_out
- RESULT_VARIABLE rm_retval
- )
- if(NOT ${rm_retval} EQUAL 0)
- message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
- endif (NOT ${rm_retval} EQUAL 0)
- else (EXISTS "$ENV{DESTDIR}${file}" OR IS_SYMLINK "$ENV{DESTDIR}${file}")
- message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
- endif (EXISTS "$ENV{DESTDIR}${file}" OR IS_SYMLINK "$ENV{DESTDIR}${file}")
-endforeach(file)
View
@@ -1,6 +0,0 @@
-# List of source files which contain translatable strings.
-./po/desc.po
-./po/conf.po
-@REL_SOURCE_ROOT@/src/eim.c
-@REL_SOURCE_ROOT@/src/eim.h
-@REL_SOURCE_ROOT@/data/fcitx-chewing.conf.in
View
@@ -1,46 +0,0 @@
-#!/bin/sh
-filename=desc.po
-indir=$1
-outdir=$2
-
-cd "$outdir"
-
-rm -f "$outdir/$filename"; touch "$outdir/$filename"
-
-cat > "$outdir/$filename" <<EOF
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n"
-"POT-Creation-Date: 2010-11-17 11:48+0800\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-EOF
-
-cd $indir
-
-descfiles=`find "$indir" -name ".hg" -prune -or -name "test" -prune -or -iname "*.desc" | grep desc`
-
-# Extract Description
-for f in $descfiles
-do
- awk '/^[\t ]*Description=/ { print "\n#: '$f':" NR"\n" "msgid \"" substr($0, 13)"\"\n" "msgstr \"\""}' "$f" >> "$outdir/$filename"
-done
-
-# Extract Group Name
-grep -nH '^\[' $descfiles | grep -v 'DescriptionFile' | awk ' "^[" { split($0, a, ":"); split(a[3], b, "/"); print substr(b[1], 2); }' | sort | uniq | awk '{ print "# unknown\nmsgid \""$0"\"\nmsgstr \"\"\n"; }' >> "$outdir/$filename"
-
-# Extract Enum Name
-grep -h 'Enum[0-9]' $descfiles | sed -e 's/Enum[0-9]=//g' | sort | uniq | awk '{ print "#: unknown\nmsgid \""$0"\"\nmsgstr \"\"\n"; }' >> "$outdir/$filename"
-

0 comments on commit 235ecb2

Please sign in to comment.