summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-24 14:09:13 -0600
committerSlávek Banko <slavek.banko@axis.cz>2012-06-24 03:54:16 +0200
commitd4f48c6d7bfb713e4b41d47bac4e3aff016a80b5 (patch)
tree397e5a24b3be3b9cf927f24a83425df71ae956e0
parente453cfde27592f1e277173a96d6de643ced4d5e7 (diff)
downloadtdeio-locate-d4f48c6d7bfb713e4b41d47bac4e3aff016a80b5.tar.gz
tdeio-locate-d4f48c6d7bfb713e4b41d47bac4e3aff016a80b5.zip
Initial conversion of kio-locate to CMake
This probably won't build yet (cherry picked from commit 78e0d2cd45f327df654c8dd17f7098271398177f)
-rw-r--r--CMakeLists.txt76
-rw-r--r--ConfigureChecks.cmake30
-rw-r--r--SConstruct82
-rw-r--r--doc/CMakeLists.txt12
-rw-r--r--po/CMakeLists.txt17
-rw-r--r--po/de/kio-locate.po (renamed from po/de.po)0
-rw-r--r--po/fr/kio-locate.po (renamed from po/fr.po)0
-rw-r--r--src/CMakeLists.txt46
-rw-r--r--src/SConscript40
9 files changed, 181 insertions, 122 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..c1eb547
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,76 @@
+#################################################
+#
+# (C) 2011 Timothy Pearson
+# kb9vqf (AT) pearsoncomputing.net
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+cmake_minimum_required( VERSION 2.8 )
+
+
+##### general package setup #####################
+
+project( kio-locate )
+
+
+##### include essential cmake modules ###########
+
+include( CheckCXXSourceCompiles )
+include( CheckFunctionExists )
+include( CheckIncludeFileCXX )
+include( CheckLibraryExists )
+include( CheckStructHasMember )
+include( CheckSymbolExists )
+include( CheckTypeSize )
+include( FindPkgConfig )
+
+
+##### include our cmake modules #################
+
+set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
+include( TDEMacros )
+
+
+##### setup install paths #######################
+
+include( TDESetupPaths )
+tde_setup_paths( )
+
+
+##### user requested modules ####################
+
+option( BUILD_ALL "Build all" OFF )
+option( BUILD_DOC "Build doc" ${BUILD_ALL} )
+option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
+
+
+##### configure checks ##########################
+
+include( ConfigureChecks.cmake )
+
+
+###### global compiler settings #################
+
+add_definitions(
+ -DHAVE_CONFIG_H
+)
+
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
+set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
+set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
+
+
+##### source directories ########################
+
+add_subdirectory( src )
+tde_conditional_add_subdirectory( BUILD_DOC doc )
+tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
+
+
+##### write configure files #####################
+
+configure_file( config.h.cmake config.h @ONLY )
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
new file mode 100644
index 0000000..2cfe6d4
--- /dev/null
+++ b/ConfigureChecks.cmake
@@ -0,0 +1,30 @@
+#################################################
+#
+# (C) 2010 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+if( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE )
+ find_program( MSGFMT_EXECUTABLE msgfmt )
+ if( NOT MSGFMT_EXECUTABLE )
+ tde_message_fatal( "msgfmt program is required, but was not found on your system" )
+ endif( )
+endif( )
+
+check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY )
+check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY )
+
+check_include_file( stdint.h HAVE_STDINT_H )
+check_include_file( systems.h HAVE_SYSTEMS_H )
+check_include_file( linux/inotify.h HAVE_INOTIFY )
+
+check_function_exists( statvfs HAVE_STATVFS )
+
+# common required stuff
+find_package( TQt )
+find_package( TDE )
diff --git a/SConstruct b/SConstruct
deleted file mode 100644
index dd1e218..0000000
--- a/SConstruct
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/python
-# kio-locate
-#
-# Copyright (C) 2005 by Tobi Vollebregt
-# tobivollebregt@gmail.com
-#
-# Thanks to Google's Summer Of Code Program!
-#
-# Copyright (C) 2005 by Armin Straub
-# linux@arminstraub.de
-#
-# Adapted from the example shipping with bksys.
-# Thomas Nagy, 2004, 2005
-# Thanks for this great tool!
-
-"""
-help -> scons -h
-compile -> scons
-clean -> scons -c
-install -> scons install
-uninstall -> scons -c install
-configure -> scons configure prefix=/tmp/ita debug=full extraincludes=/usr/local/include:/tmp/include prefix=/usr/local
-
-Run from a subdirectory -> scons -u
-The variables are saved automatically after the first run (look at cache/kde.cache.py, ..)
-"""
-
-###################################################################
-# LOAD THE ENVIRONMENT AND SET UP THE TOOLS
-###################################################################
-
-## Load the builders in config
-env = Environment( tools=['default', 'generic', 'kde'], toolpath=['./admin'])
-
-# Set the build directory so we can do "rm -rf build" to clean up.
-BuildDir('build/src', 'src')
-
-env.KDEuse("environ")
-#env.KDEuse("environ rpath lang_qt thread nohelp")
-
-# Add -DHAVE_UDS_HIDDEN if we detected the UDS_HIDDEN patch.
-if '1' in env['HAVE_UDS_HIDDEN']:
- env.Append(CPPFLAGS = ['-DHAVE_UDS_HIDDEN'])
-
-###################################################################
-# SCRIPTS FOR BUILDING THE TARGETS
-###################################################################
-
-## target processing is done in the subdirectories
-env.subdirs('build/src')
-
-############################
-## Process the documentation
-############################
-
-## Use a distinct environment
-myenv=env.Copy()
-
-## Define this to enable docbook file dependency tracking
-#myenv['i_am_a_documentation_writer']=1
-
-# This shouldn't be needed, but it works around a (possible) bug in bksys 1.5.2.rc1.
-# myenv['_BUILDDIR_']='build'
-
-## Use docfolder for each documentation directory
-## The parameters of docfolder are: documentation dir, language code, app name
-myenv.docfolder('doc/en/', 'en', 'kio-locate/')
-#myenv.docfolder('doc/fr/', 'fr', 'kio-locate/')
-
-############################
-## Process the translations
-############################
-
-## They are usually located in the po/ directory
-## We use myenv here because it has the _BUILDDIR_ workaround. See above.
-myenv.KDElang('po/', 'kio-locate')
-
-###################################################################
-# CONVENIENCE FUNCTIONS TO EMULATE 'make dist' and 'make distclean'
-###################################################################
-
-env.dist('kio-locate')
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 0000000..a8b8de4
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,12 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+tde_auto_add_subdirectories()
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100644
index 0000000..61233cd
--- /dev/null
+++ b/po/CMakeLists.txt
@@ -0,0 +1,17 @@
+#################################################
+#
+# (C) 2011 Timothy Pearson
+# kb9vqf (AT) pearsoncomputing.net
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+file( GLOB_RECURSE po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} kio-locate.po )
+
+foreach( _po ${po_files} )
+ get_filename_component( _lang ${_po} PATH )
+ tde_create_translation( FILES ${_po} LANG ${_lang} )
+endforeach( )
diff --git a/po/de.po b/po/de/kio-locate.po
index 2714455..2714455 100644
--- a/po/de.po
+++ b/po/de/kio-locate.po
diff --git a/po/fr.po b/po/fr/kio-locate.po
index 54def3e..54def3e 100644
--- a/po/fr.po
+++ b/po/fr/kio-locate.po
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..6677503
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,46 @@
+#################################################
+#
+# (C) 2011 Timothy Pearson
+# kb9vqf (AT) pearsoncomputing.net
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include_directories(
+ ${TQT_INCLUDE_DIRS}
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/tdecore
+ ${CMAKE_SOURCE_DIR}/tdecore
+ ${CMAKE_SOURCE_DIR}/kio/kio
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+
+##### other data ################################
+
+install( FILES locate.protocol DESTINATION ${SERVICES_INSTALL_DIR} )
+install( FILES locater.protocol DESTINATION ${SERVICES_INSTALL_DIR} )
+install( FILES rlocate.protocol DESTINATION ${SERVICES_INSTALL_DIR} )
+install( FILES locate.desktop DESTINATION ${SERVICES_INSTALL_DIR}/searchproviders )
+
+
+##### kbzip2filter ##############################
+
+set( target kio_locate )
+
+set( ${target}_SRCS
+ klocateconfig.kcfgc klocateconfigwidget.ui klocateconfigfilterwidget.ui
+ klocateconfiglocatewidget.ui kio_locate.cpp locater.cpp pattern.cpp
+)
+
+tde_add_kpart( ${target} AUTOMOC
+ SOURCES ${${target}_SRCS}
+ LINK kio-shared
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+) \ No newline at end of file
diff --git a/src/SConscript b/src/SConscript
deleted file mode 100644
index 4b27cee..0000000
--- a/src/SConscript
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/python
-# kio-locate
-#
-# Copyright (C) 2005 by Tobi Vollebregt
-# tobivollebregt@gmail.com
-#
-# Thanks to Google's Summer Of Code Program!
-#
-# Copyright (C) 2005 by Armin Straub
-# linux@arminstraub.de
-#
-# Adapted from the example shipping with bksys.
-# Thomas Nagy, 2004, 2005
-# Thanks for this great tool!
-
-Import('env')
-
-# The kioslave library is kio_test5.so and not libkio_test5.so (empty string)
-obj=env.kobject('kioslave')
-obj.target='kio_locate'
-obj.source="""
- klocateconfig.kcfgc
- klocateconfigwidget.ui
- klocateconfigfilterwidget.ui
- klocateconfiglocatewidget.ui
- kio_locate.cpp
- locater.cpp
- pattern.cpp
-"""
-obj.libs='tqt kio'
-obj.linkflags='-module' # add more link flags
-obj.execute()
-
-# Install the protocol files
-env.KDEinstall('KDESERV', '', 'locate.protocol')
-env.KDEinstall('KDESERV', '', 'locater.protocol')
-env.KDEinstall('KDESERV', '', 'rlocate.protocol')
-
-# Install the searchprovider file
-env.KDEinstall('KDESERV', '/searchproviders', 'locate.desktop')