@ -1,71 +1,47 @@
PROJECT ( kbfx )
CMAKE_MINIMUM_REQUIRED ( VERSION 2.4.2 FATAL_ERROR )
SET ( CMAKE_MODULE_PATH ${ CMAKE_SOURCE_DIR } /cmakemodules )
SET ( CMAKE_COLOR_MAKEFILE ON CACHE STRING "Enable/Disable color output during build." FORCE )
# SET ( CMAKE_VERBOSE_MAKEFILE OFF CACHE STRING "Enable/Disable cmake debug output during build." FORCE )
# O p t i m i z a t i o n f l a g s
# SET ( CMAKE_CXX_FLAGS_DISTRIBUTION "-O3" )
# SET ( CMAKE_C_FLAGS_DISTRIBUTION "-O3" )
# G l o b a l v a r i a b l e C M A K E _ B U I L D _ T Y P E
# None ( CMAKE_C_FLAGS or CMAKE_CXX_FLAGS used )
# Debug ( CMAKE_C_FLAGS_DEBUG or CMAKE_CXX_FLAGS_DEBUG )
# Release ( CMAKE_C_FLAGS_RELEASE or CMAKE_CXX_FLAGS_RELEASE )
# RelWithDebInfo ( CMAKE_C_FLAGS_RELWITHDEBINFO or CMAKE_CXX_FLAGS_RELWITHDEBINFO
# MinSizeRel ( CMAKE_C_FLAGS_MINSIZEREL or CMAKE_CXX_FLAGS_MINSIZEREL )
IF ( NOT CMAKE_BUILD_TYPE )
SET ( CMAKE_BUILD_TYPE RelWithDebInfo
C A C H E
S T R I N G " S p e c i f y b u i l d t y p e : N o n e D e b u g R e l e a s e R e l W i t h D e b I n f o M i n S i z e R e l . "
F O R C E )
ENDIF ( NOT CMAKE_BUILD_TYPE )
OPTION ( USE_STRIGI "Enable use of Strigi search support (disabled)" OFF )
OPTION ( USE_MENUDRAKE "Use 'menudrake' instead of 'kmenuedit' in Mandriva (auto)" ON )
OPTION ( USE_KDE4 "Compile for KDE4 (disabled)" OFF )
SET ( BIN_SEARCH_PATHES
$ E N V { H O M E } / b i n
$ E N V { H O M E } / u s r / b i n
$ E N V { K D E D I R } / b i n
$ { C M A K E _ I N S T A L L _ P R E F I X } / b i n
/ o p t / k d e / b i n
/ o p t / t r i n i t y / b i n
/ o p t / k d e 4 / b i n
/ u s r / k d e / 3 . 5 / b i n
/ u s r / b i n
/ u s r / l o c a l / b i n
/ o p t / b i n
)
SET ( INCLUDE_SEARCH_PATHES
$ E N V { H O M E } / i n c l u d e
$ E N V { H O M E } / u s r / i n c l u d e
$ E N V { K D E D I R } / i n c l u d e
/ o p t / k d e / i n c l u d e
/ o p t / t r i n i t y / i n c l u d e
/ o p t / k d e 4 / i n c l u d e
/ u s r / k d e / 3 . 5 / i n c l u d e
/ u s r / i n c l u d e
/ u s r / l o c a l / i n c l u d e
/ o p t / i n c l u d e
$ { C M A K E _ S Y S T E M _ I N C L U D E _ P A T H }
)
SET ( LIB_SEARCH_PATHES
$ E N V { H O M E } / l i b
$ E N V { H O M E } / u s r / l i b
$ E N V { K D E D I R } / l i b
/ o p t / k d e / l i b
/ o p t / t r i n i t y / l i b
/ o p t / k d e 4 / l i b
/ u s r / k d e / 3 . 5 / l i b
/ u s r / l i b
/ u s r / l o c a l / l i b
/ o p t / l i b
)
# S e t t i n g v e r s i o n s
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# ( C ) 2 0 1 1 T i m o t h y P e a r s o n
# kb9vqf ( AT ) p e a r s o n c o m p u t i n g . n e t
#
# I m p r o v e m e n t s a n d f e e d b a c k a r e w e l c o m e
#
# T h i s f i l e i s r e l e a s e d u n d e r G P L > = 2
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
cmake_minimum_required ( VERSION 2.8 )
# # # # # g e n e r a l p a c k a g e s e t u p # # # # # # # # # # # # # # # # # # # # #
project ( kio-locate )
# # # # # i n c l u d e e s s e n t i a l c m a k e m o d u l e s # # # # # # # # # # #
include ( CheckCXXSourceCompiles )
include ( CheckFunctionExists )
include ( CheckIncludeFileCXX )
include ( CheckLibraryExists )
include ( CheckStructHasMember )
include ( CheckSymbolExists )
include ( CheckTypeSize )
include ( FindPkgConfig )
# # # # # i n c l u d e o u r c m a k e m o d u l e s # # # # # # # # # # # # # # # # #
set ( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include ( TDEMacros )
# # # # # s e t u p i n s t a l l p a t h s # # # # # # # # # # # # # # # # # # # # # # #
include ( TDESetupPaths )
tde_setup_paths ( )
# # # # # s e t v e r s i o n n u m b e r s # # # # # # # # # # # # # # # # # # # # # # #
# F o r v e r s i o n s t h a t a r e s t a b l e s e t t o 1 , e l s e t o 0
SET ( APPLICATION_STABLE 1 )
@ -95,194 +71,67 @@ SET(VERSION ${APPLICATION_VERSION})
SET ( STRIGI_VERSION "0.3.11" )
SET ( GENTOO_KEYWORDS "x86 ~ppc ~amd64" )
# P r e p a r e d o c b o o k p a r t
CONFIGURE_FILE ( ${ CMAKE_SOURCE_DIR } /doc/en/index.docbook.in ${ CMAKE_BINARY_DIR } /doc/en/index.docbook @ONLY )
IF ( USE_STRIGI )
FIND_PACKAGE ( Strigi REQUIRED )
INCLUDE_DIRECTORIES ( ${ STRIGI_INCLUDE_DIR } )
MESSAGE ( STATUS "Strigi support is: ON!" )
ELSE ( USE_STRIGI )
MESSAGE ( STATUS "Strigi support is: OFF!" )
ENDIF ( USE_STRIGI )
FIND_PROGRAM ( HAVE_MANDRAKE menudrake )
IF ( HAVE_MANDRAKE AND USE_MENUDRAKE )
SET ( MANDRAKE "1" )
MESSAGE ( STATUS "Will use 'menudrake' instead of 'kmenuedit'!" )
ELSE ( HAVE_MANDRAKE AND USE_MENUDRAKE )
SET ( MANDRAKE "" )
MESSAGE ( STATUS "Will use 'kmenuedit'!" )
ENDIF ( HAVE_MANDRAKE AND USE_MENUDRAKE )
IF ( NOT USE_KDE4 )
MESSAGE ( STATUS "Building for KDE3" )
INCLUDE ( TestCXXAcceptsFlag )
SET ( CMAKE_CXX_FLAGS_DEBUG
" $ { C M A K E _ C X X _ F L A G S _ D E B U G } - D T E S T I N G _ R C = \ " \ \ \ " \ $ { C M A K E _ S O U R C E _ D I R } / c o n f i g d i a l o g / k b f x c o n f i g a p p u i . r c \ \ \ " \ " " )
CHECK_CXX_ACCEPTS_FLAG ( "-fexceptions" CXX_EXCEPTION )
CHECK_CXX_ACCEPTS_FLAG ( "-fstack-protector" CXX_PROTECTOR )
FIND_PACKAGE ( KDE3 REQUIRED )
INCLUDE ( FindKdeLibs )
INCLUDE ( MacroEnsureVersion )
# D u m m y m a c r o s f o r c o m p a t i b i l i t y
MACRO ( KDE4_AUTOMOC _dummy )
ENDMACRO ( KDE4_AUTOMOC )
MACRO ( KDE4_ADD_LIBRARY _dummy _dummy1 _dummy2 )
ENDMACRO ( KDE4_ADD_LIBRARY )
MACRO ( KDE4_INSTALL_LIBTOOL_FILE _dummy _dummy1 )
ENDMACRO ( KDE4_INSTALL_LIBTOOL_FILE )
MACRO ( KDE4_ADD_UI3_FILES _dummy _dummy1 )
ENDMACRO ( KDE4_ADD_UI3_FILES )
MACRO ( KDE4_ADD_DCOP_SKELS _dummy _dummy1 )
ENDMACRO ( KDE4_ADD_DCOP_SKELS )
MACRO ( KDE4_ADD_EXECUTABLE _dummy _dummy1 )
ENDMACRO ( KDE4_ADD_EXECUTABLE )
MACRO ( KDE4_INSTALL_ICONS _dummy )
ENDMACRO ( KDE4_INSTALL_ICONS )
ELSE ( NOT USE_KDE4 )
MESSAGE ( STATUS "Building for KDE4" )
FIND_PACKAGE ( KDE4 REQUIRED )
ADD_DEFINITIONS ( ${ KDE4_DEFINITIONS } ${ QT_DEFINITIONS } )
SET ( INCLUDE_SEARCH_PATHES
$ { I N C L U D E _ S E A R C H _ P A T H E S }
$ { K D E 4 _ I N C L U D E S }
)
SET ( LIB_SEARCH_PATHES
$ { L I B _ S E A R C H _ P A T H E S }
$ { K D E 4 _ L I B _ D I R }
)
ENDIF ( NOT USE_KDE4 )
IF ( NOT QT_FOUND )
MESSAGE ( "TQt3 not found, assuming TQt4 was desired" )
SET ( TQT_INCLUDE_DIR "/usr/include/qt4" )
ELSE ( )
SET ( TQT_INCLUDE_DIR "${QT_INCLUDE_DIR}" )
ENDIF ( )
INCLUDE_DIRECTORIES (
$ { C M A K E _ B I N A R Y _ D I R }
$ { C M A K E _ B I N A R Y _ D I R } / k b f x l i b / d a t a
$ { C M A K E _ B I N A R Y _ D I R } / k b f x l i b / c o m m o n
$ { C M A K E _ B I N A R Y _ D I R } / s r c
$ { C M A K E _ B I N A R Y _ D I R } / c o n f i g d i a l o g
$ { C M A K E _ B I N A R Y _ D I R } / p l u g i n s / c o m m o n
$ { C M A K E _ S O U R C E _ D I R }
$ { C M A K E _ S O U R C E _ D I R } / k b f x l i b / d a t a
$ { C M A K E _ S O U R C E _ D I R } / k b f x l i b / c o m m o n
$ { C M A K E _ S O U R C E _ D I R } / s r c
$ { C M A K E _ S O U R C E _ D I R } / c o n f i g d i a l o g
$ { C M A K E _ S O U R C E _ D I R } / p l u g i n s / c o m m o n
$ { T Q T _ I N C L U D E _ D I R }
$ { K D E 3 _ I N C L U D E _ D I R }
$ { K D E 3 _ I N C L U D E _ D I R } / k b f x
$ { K D E 3 _ I N C L U D E _ D I R } / k b f x / p l u g i n s
$ { I N C L U D E _ S E A R C H _ P A T H E S }
)
IF ( NOT USE_KDE4 )
IF ( CXX_EXCEPTION )
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions" )
ENDIF ( CXX_EXCEPTION )
IF ( CXX_PROTECTOR )
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector" )
ENDIF ( CXX_PROTECTOR )
ADD_DEFINITIONS ( ${ KDE3_DEFINITIONS } ${ QT_DEFINITIONS } )
SET ( EXECUTABLE_OUTPUT_PATH ${ PROJECT_BINARY_DIR } /bin )
SET ( LIBRARY_OUTPUT_PATH ${ PROJECT_BINARY_DIR } /lib )
IF ( KDE3_KDECONFIG_EXECUTABLE )
EXECUTE_PROCESS ( COMMAND ${ KDE3_KDECONFIG_EXECUTABLE } "--version" OUTPUT_VARIABLE output )
STRING ( REGEX MATCH "KDE: [0-9]+\\.[0-9]+\\.[0-9]+" KDEVERSION "${output}" )
STRING ( REGEX REPLACE "^KDE: " "" KDEVERSION "${KDEVERSION}" )
ENDIF ( KDE3_KDECONFIG_EXECUTABLE )
SET ( KDE_MIN_VERSION "3.5.0" )
MACRO_ENSURE_VERSION ( ${ KDE_MIN_VERSION } ${ KDEVERSION } VERSION_OK )
IF ( NOT VERSION_OK )
MESSAGE ( FATAL_ERROR "You need at least KDE Version of 3.5.0 in order to compile KBFX.\n Please upgrade your KDE or install the development files of KDE." )
ENDIF ( NOT VERSION_OK )
ENDIF ( NOT USE_KDE4 )
SET ( KBFX_LIB_INSTALL_DIR ${ LIB_INSTALL_DIR } )
SET ( QT_UIC_EXECUTABLE "/usr/bin/uic-tqt" )
SET ( QT_MOC_EXECUTABLE "/usr/bin/tmoc" )
SET ( CMAKE_CXX_FLAGS "-I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT" )
ADD_SUBDIRECTORY ( kbfxlib/data )
ADD_SUBDIRECTORY ( kbfxlib/common )
ADD_SUBDIRECTORY ( src )
ADD_SUBDIRECTORY ( configdialog )
ADD_SUBDIRECTORY ( skin/vector )
ADD_SUBDIRECTORY ( skin/raster/default )
ADD_SUBDIRECTORY ( skin/raster/2panels )
ADD_SUBDIRECTORY ( images )
ADD_SUBDIRECTORY ( doc )
ADD_SUBDIRECTORY ( doc/en )
ADD_SUBDIRECTORY ( doc/common )
ADD_SUBDIRECTORY ( po )
ADD_SUBDIRECTORY ( plugins/common )
ADD_SUBDIRECTORY ( plugins/applications )
ADD_SUBDIRECTORY ( plugins/settings )
ADD_SUBDIRECTORY ( plugins/plasmoids )
ADD_SUBDIRECTORY ( plugins/recentstuff )
IF ( USE_STRIGI )
ADD_SUBDIRECTORY ( plugins/strigi )
ENDIF ( USE_STRIGI )
CONFIGURE_FILE ( ${ CMAKE_SOURCE_DIR } /config.h.in ${ CMAKE_BINARY_DIR } /config.h @ONLY )
CONFIGURE_FILE ( ${ CMAKE_SOURCE_DIR } /kbfx.spec.in ${ CMAKE_BINARY_DIR } /kbfx.spec @ONLY )
CONFIGURE_FILE ( ${ CMAKE_SOURCE_DIR } /kbfx.ebuild.in ${ CMAKE_BINARY_DIR } /kbfx- ${ GENTOO_VERSION } .ebuild @ONLY )
CONFIGURE_FILE ( ${ CMAKE_SOURCE_DIR } /strigi.ebuild.in ${ CMAKE_BINARY_DIR } /strigi- ${ STRIGI_VERSION } .ebuild @ONLY )
CONFIGURE_FILE ( ${ CMAKE_SOURCE_DIR } /kbfx-svn.ebuild.in ${ CMAKE_BINARY_DIR } /kbfx-9999.ebuild @ONLY )
# # # # # u s e r r e q u e s t e d m o d u l e s # # # # # # # # # # # # # # # # # # # #
option ( BUILD_ALL "Build all" OFF )
option ( BUILD_DOC "Build doc" ${ BUILD_ALL } )
option ( BUILD_TRANSLATIONS "Build translations" ${ BUILD_ALL } )
option ( USE_STRIGI "Enable use of Strigi search support (disabled)" OFF )
option ( USE_MENUDRAKE "Use 'menudrake' instead of 'kmenuedit' in Mandriva (auto)" ON )
# # # # # c o n f i g u r e c h e c k s # # # # # # # # # # # # # # # # # # # # # # # # # #
include ( ConfigureChecks.cmake )
# # # # # # g l o b a l c o m p i l e r s e t t i n g s # # # # # # # # # # # # # # # # #
add_definitions (
- D H A V E _ C O N F I G _ H
)
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS} -DTQT_THREAD_SUPPORT" )
set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
# # # # # s o u r c e d i r e c t o r i e s # # # # # # # # # # # # # # # # # # # # # # # #
add_subdirectory ( kbfxlib )
add_subdirectory ( src )
add_subdirectory ( configdialog )
add_subdirectory ( skin )
add_subdirectory ( images )
add_subdirectory ( plugins )
tde_conditional_add_subdirectory ( BUILD_DOC doc )
tde_conditional_add_subdirectory ( BUILD_TRANSLATIONS po )
tde_conditional_add_subdirectory ( USE_STRIGI plugins/strigi )
SET ( DIST_INCLUDE "kbfx-9999.ebuild kbfx.spec kbfx-${GENTOO_VERSION}.ebuild strigi-${STRIGI_VERSION}.ebuild" )
SET ( DIST_EXCLUDE "Helperstuff" )
CONFIGURE_FILE (
configure_file (
" $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / c m a k e m o d u l e s / m a k e d i s t . s h . i n "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / m a k e d i s t . s h "
I M M E D I A T E
@ O N L Y )
ADD_CUSTOM_TARGET ( dist
add_custom_target ( dist
" $ { C M A K E _ B I N A R Y _ D I R } / m a k e d i s t . s h "
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ B I N A R Y _ D I R } )
IF ( NOT USE_KDE4 )
CONFIGURE_FILE (
" $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / c m a k e m o d u l e s / c m a k e _ u n i n s t a l l . c m a k e . i n "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c m a k e _ u n i n s t a l l . c m a k e "
I M M E D I A T E @ O N L Y )
ADD_CUSTOM_TARGET ( uninstall
" $ { C M A K E _ C O M M A N D } " - P " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c m a k e _ u n i n s t a l l . c m a k e " )
ENDIF ( NOT USE_KDE4 )
FILE ( GLOB _POFILES po/*.po )
FOREACH ( _p ${ _POFILES } )
SET ( POFILES "${_p} ${POFILES}" )
ENDFOREACH ( _p )
SET ( MESSAGES_DIR ${ CMAKE_SOURCE_DIR } )
CONFIGURE_FILE (
" $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / c m a k e m o d u l e s / p a c k a g e _ m e s s a g e s . s h . i n "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / p a c k a g e _ m e s s a g e s . s h "
I M M E D I A T E
@ O N L Y )
ADD_CUSTOM_TARGET ( package-messages
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / p a c k a g e _ m e s s a g e s . s h " )
configure_file (
" $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / c m a k e m o d u l e s / c m a k e _ u n i n s t a l l . c m a k e . i n "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c m a k e _ u n i n s t a l l . c m a k e "
I M M E D I A T E @ O N L Y )
add_custom_target ( uninstall
" $ { C M A K E _ C O M M A N D } " - P " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c m a k e _ u n i n s t a l l . c m a k e " )
# # # # # w r i t e c o n f i g u r e f i l e s # # # # # # # # # # # # # # # # # # # # #
configure_file ( config.h.in config.h @ONLY )
configure_file ( kbfx.spec.in kbfx.spec @ONLY )
configure_file ( kbfx.ebuild.in kbfx- ${ GENTOO_VERSION } .ebuild @ONLY )
configure_file ( strigi.ebuild.in strigi- ${ STRIGI_VERSION } .ebuild @ONLY )
configure_file ( kbfx-svn.ebuild.in kbfx-9999.ebuild @ONLY )