Initial conversion of kio-locate to CMake

This probably won't build yet
pull/1/head
Timothy Pearson 13 years ago
parent bc53daed9e
commit 78e0d2cd45

@ -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 )

@ -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 )

@ -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')

@ -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()

@ -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( )

@ -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}
)

@ -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')
Loading…
Cancel
Save