@ -1,117 +1,397 @@
# INCLUDE ( FindQt3 )
# INCLUDE ( FindQt )
# INCLUDE ( FindKDE3 )
INCLUDE ( kdesvnMacros )
include ( FindQt3 )
# - F i n d t h e K D E 3 i n c l u d e a n d l i b r a r y d i r s , K D E p r e p r o c e s s o r s a n d d e f i n e a s o m e m a c r o s
#
# T h i s m o d u l e d e f i n e s t h e f o l l o w i n g v a r i a b l e s :
# K D E 3 _ D E F I N I T I O N S - c o m p i l e r d e f i n i t i o n s r e q u i r e d f o r c o m p i l i n g K D E s o f t w a r e
# K D E 3 _ I N C L U D E _ D I R - t h e K D E i n c l u d e d i r e c t o r y
# K D E 3 _ I N C L U D E _ D I R S - t h e K D E a n d t h e Q t i n c l u d e d i r e c t o r y , f o r u s e w i t h INCLUDE_DIRECTORIES ( )
# K D E 3 _ L I B _ D I R - t h e d i r e c t o r y w h e r e t h e K D E l i b r a r i e s a r e i n s t a l l e d , f o r u s e w i t h LINK_DIRECTORIES ( )
# Q T _ A N D _ K D E C O R E _ L I B S - t h i s c o n t a i n s b o t h t h e Q t a n d t h e k d e c o r e l i b r a r y
# K D E 3 _ D C O P I D L _ E X E C U T A B L E - t h e d c o p i d l e x e c u t a b l e
# K D E 3 _ D C O P I D L 2 C P P _ E X E C U T A B L E - t h e d c o p i d l 2 c p p e x e c u t a b l e
# K D E 3 _ K C F G C _ E X E C U T A B L E - t h e k c o n f i g _ c o m p i l e r e x e c u t a b l e
# K D E 3 _ F O U N D - s e t t o T R U E i f a l l o f t h e a b o v e h a s b e e n f o u n d
#
# T h e f o l l o w i n g u s e r a d j u s t a b l e o p t i o n s a r e p r o v i d e d :
#
# K D E 3 _ B U I L D _ T E S T S - e n a b l e t h i s t o b u i l d K D E t e s t c a s e s
#
#
# I t a l s o a d d s t h e f o l l o w i n g macros ( from KDE3Macros.cmake )
# S R C S _ V A R i s a l w a y s t h e v a r i a b l e w h i c h c o n t a i n s t h e l i s t o f s o u r c e f i l e s f o r y o u r a p p l i c a t i o n o r l i b r a r y .
#
# KDE3_AUTOMOC ( file1 ... fileN )
# C a l l t h i s i f y o u w a n t t o h a v e a u t o m a t i c m o c f i l e h a n d l i n g .
# T h i s m e a n s i f y o u i n c l u d e " f o o . m o c " i n t h e s o u r c e f i l e f o o . c p p
# a m o c f i l e f o r t h e h e a d e r f o o . h w i l l b e c r e a t e d a u t o m a t i c a l l y .
# Y o u c a n s e t t h e p r o p e r t y S K I P _ A U T O M A K E u s i n g SET_SOURCE_FILES_PROPERTIES ( )
# t o e x c l u d e s o m e f i l e s i n t h e l i s t f r o m b e i n g p r o c e s s e d .
#
# KDE3_ADD_MOC_FILES ( SRCS_VAR file1 ... fileN )
# I f y o u d o n ' t u s e t h e KDE3_AUTOMOC ( ) m a c r o , f o r t h e f i l e s
# l i s t e d h e r e m o c f i l e s w i l l b e created ( named "foo.moc.cpp" )
#
# KDE3_ADD_DCOP_SKELS ( SRCS_VAR header1.h ... headerN.h )
# U s e t h i s t o g e n e r a t e D C O P s k e l e t i o n s f r o m t h e l i s t e d h e a d e r s .
#
# KDE3_ADD_DCOP_STUBS ( SRCS_VAR header1.h ... headerN.h )
# U s e t h i s t o g e n e r a t e D C O P s t u b s f r o m t h e l i s t e d h e a d e r s .
#
# KDE3_ADD_UI_FILES ( SRCS_VAR file1.ui ... fileN.ui )
# U s e t h i s t o a d d t h e Q t d e s i g n e r u i f i l e s t o y o u r a p p l i c a t i o n / l i b r a r y .
#
# KDE3_ADD_KCFG_FILES ( SRCS_VAR file1.kcfgc ... fileN.kcfgc )
# U s e t h i s t o a d d K D E k c o n f i g c o m p i l e r f i l e s t o y o u r a p p l i c a t i o n / l i b r a r y .
#
# KDE3_INSTALL_LIBTOOL_FILE ( target )
# T h i s w i l l c r e a t e a n d i n s t a l l a s i m p l e l i b t o o l f i l e f o r t h e g i v e n t a r g e t .
#
# KDE3_ADD_EXECUTABLE ( name file1 ... fileN )
# C u r r e n t l y i d e n t i c a l t o ADD_EXECUTABLE ( ) , m a y p r o v i d e s o m e a d v a n c e d f e a t u r e s i n t h e f u t u r e .
#
# KDE3_ADD_KPART ( name [WITH_PREFIX] file1 ... fileN )
# C r e a t e a K D E plugin ( KPart, kioslave, etc. ) f r o m t h e g i v e n s o u r c e f i l e s .
# I f W I T H _ P R E F I X i s g i v e n , t h e r e s u l t i n g p l u g i n w i l l h a v e t h e p r e f i x " l i b " , o t h e r w i s e i t w o n ' t .
# I t c r e a t e s a n d i n s t a l l s a n a p p r o p r i a t e l i b t o o l l a - f i l e .
#
# KDE3_ADD_KDEINIT_EXECUTABLE ( name file1 ... fileN )
# C r e a t e a K D E a p p l i c a t i o n i n t h e f o r m o f a m o d u l e l o a d a b l e v i a k d e i n i t .
# A l i b r a r y n a m e d k d e i n i t _ < n a m e > w i l l b e c r e a t e d a n d a s m a l l e x e c u t a b l e w h i c h l i n k s t o i t .
#
# T h e o p t i o n K D E 3 _ E N A B L E _ F I N A L t o e n a b l e a l l - i n - o n e c o m p i l a t i o n i s
# n o l o n g e r s u p p o r t e d .
#
#
# A u t h o r : A l e x a n d e r N e u n d o r f < n e u n d o r f @ k d e . o r g >
IF ( NOT UNIX AND KDE3_FIND_REQUIRED )
MESSAGE ( FATAL_ERROR "Compiling KDE3 applications and libraries under Windows is not supported" )
ENDIF ( NOT UNIX AND KDE3_FIND_REQUIRED )
# I f Q t 4 h a s a l r e a d y b e e n f o u n d , f a i l .
IF ( QT4_FOUND )
IF ( KDE3_FIND_REQUIRED )
MESSAGE ( FATAL_ERROR "KDE3/Qt3 and Qt4 cannot be used together in one project." )
ELSE ( KDE3_FIND_REQUIRED )
IF ( NOT KDE3_FIND_QUIETLY )
MESSAGE ( STATUS "KDE3/Qt3 and Qt4 cannot be used together in one project." )
ENDIF ( NOT KDE3_FIND_QUIETLY )
RETURN ( )
ENDIF ( KDE3_FIND_REQUIRED )
ENDIF ( QT4_FOUND )
SET ( QT_MT_REQUIRED TRUE )
# SET ( QT_MIN_VERSION "3.0.0" )
# t h i s l i n e i n c l u d e s F i n d Q t . c m a k e , w h i c h s e a r c h e s t h e Q t l i b r a r y a n d h e a d e r s
IF ( KDE3_FIND_REQUIRED )
SET ( _REQ_STRING_KDE3 "REQUIRED" )
ENDIF ( KDE3_FIND_REQUIRED )
FIND_PACKAGE ( Qt3 ${ _REQ_STRING_KDE3 } )
FIND_PACKAGE ( X11 ${ _REQ_STRING_KDE3 } )
# n o w t r y t o f i n d s o m e k d e s t u f f
FIND_PROGRAM ( KDECONFIG_EXECUTABLE NAMES kde-config
H I N T S
$ E N V { K D E D I R } / b i n
P A T H S
/ o p t / k d e 3 / b i n
/ o p t / t r i n i t y / b i n
/ o p t / k d e / b i n
/ u s r / k d e 3 / b i n
)
SET ( KDE3PREFIX )
IF ( KDECONFIG_EXECUTABLE )
EXECUTE_PROCESS ( COMMAND ${ KDECONFIG_EXECUTABLE } --version
O U T P U T _ V A R I A B L E k d e _ c o n f i g _ v e r s i o n )
STRING ( REGEX MATCH "KDE: .\\." kde_version ${ kde_config_version } )
IF ( ${ kde_version } MATCHES "KDE: 3\\." )
EXECUTE_PROCESS ( COMMAND ${ KDECONFIG_EXECUTABLE } --prefix
O U T P U T _ V A R I A B L E k d e d i r )
STRING ( REGEX REPLACE "\n" "" KDE3PREFIX "${kdedir}" )
ENDIF ( ${ kde_version } MATCHES "KDE: 3\\." )
ENDIF ( KDECONFIG_EXECUTABLE )
# a t f i r s t t h e K D E i n c l u d e d i r e c o r y
# k p a s s d l g . h c o m e s f r o m k d e u i a n d d o e s n ' t e x i s t i n K D E 4 a n y m o r e
FIND_PATH ( KDE3_INCLUDE_DIR kpassdlg.h
H I N T S
$ E N V { K D E D I R } / i n c l u d e
$ { K D E 3 P R E F I X } / i n c l u d e
P A T H S
/ o p t / k d e 3 / 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 / i n c l u d e
/ u s r / i n c l u d e / k d e
/ u s r / l o c a l / i n c l u d e / k d e
)
# o v e r r i d e t h i s
# SET ( KDE3_INCLUDE_DIR "/usr/include/kde" )
# n o w t h e K D E l i b r a r y d i r e c t o r y
FIND_LIBRARY ( KDE3_KDECORE_LIBRARY NAMES kdecore
H I N T S
$ E N V { K D E D I R } / l i b
$ { K D E 3 P R E F I X } / l i b
P A T H S
/ o p t / k d e 3 / l i b
/ o p t / t r i n i t y / l i b
/ o p t / k d e / l i b
/ u s r / k d e 3 / l i b
)
SET ( QT_AND_KDECORE_LIBS ${ QT_LIBRARIES } ${ KDE3_KDECORE_LIBRARY } )
GET_FILENAME_COMPONENT ( KDE3_LIB_DIR ${ KDE3_KDECORE_LIBRARY } PATH )
IF ( NOT KDE3_LIBTOOL_DIR )
IF ( KDE3_KDECORE_LIBRARY MATCHES lib64 )
SET ( KDE3_LIBTOOL_DIR /lib64/kde3 )
ELSE ( KDE3_KDECORE_LIBRARY MATCHES lib64 )
SET ( KDE3_LIBTOOL_DIR /lib/kde3 )
ENDIF ( KDE3_KDECORE_LIBRARY MATCHES lib64 )
ENDIF ( NOT KDE3_LIBTOOL_DIR )
# n o w s e a r c h f o r t h e d c o p u t i l i t i e s
FIND_PROGRAM ( KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl
H I N T S
$ E N V { K D E D I R } / b i n
$ { K D E 3 P R E F I X } / b i n
P A T H S
/ o p t / k d e 3 / b i n
/ o p t / t r i n i t y / b i n
/ o p t / k d e / b i n
/ u s r / k d e 3 / b i n
)
FIND_PROGRAM ( KDE3_DCOPIDL2CPP_EXECUTABLE NAMES dcopidl2cpp
H I N T S
$ E N V { K D E D I R } / b i n
$ { K D E 3 P R E F I X } / b i n
P A T H S
/ o p t / k d e 3 / b i n
/ o p t / t r i n i t y / b i n
/ o p t / k d e / b i n
/ u s r / k d e 3 / b i n
)
FIND_PROGRAM ( KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler
H I N T S
$ E N V { K D E D I R } / b i n
$ { K D E 3 P R E F I X } / b i n
P A T H S
/ o p t / k d e 3 / b i n
/ o p t / t r i n i t y / b i n
/ o p t / k d e / b i n
/ u s r / k d e 3 / b i n
)
# S E T K D E 3 _ F O U N D
IF ( KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE )
SET ( KDE3_FOUND TRUE )
ELSE ( KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE )
SET ( KDE3_FOUND FALSE )
ENDIF ( KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE )
# a d d s o m e K D E s p e c i f i c s t u f f
SET ( KDE3_DEFINITIONS -DQT_CLEAN_NAMESPACE -D_GNU_SOURCE )
# s e t c o m p i l e r f l a g s o n l y i f K D E 3 h a s a c t u a l l y b e e n f o u n d
IF ( KDE3_FOUND )
SET ( _KDE3_USE_FLAGS FALSE )
IF ( CMAKE_COMPILER_IS_GNUCXX )
SET ( _KDE3_USE_FLAGS TRUE ) # u s e f l a g s f o r g n u c o m p i l e r
EXECUTE_PROCESS ( COMMAND ${ CMAKE_CXX_COMPILER } --version
O U T P U T _ V A R I A B L E o u t )
# g n u g c c 2 . 9 6 d o e s n o t w o r k w i t h f l a g s
# I g u e s s 2 . 9 5 a l s o d o e s n ' t t h e n
IF ( "${out}" MATCHES "2.9[56]" )
SET ( _KDE3_USE_FLAGS FALSE )
ENDIF ( "${out}" MATCHES "2.9[56]" )
ENDIF ( CMAKE_COMPILER_IS_GNUCXX )
# o n l y o n l i n u x , b u t N O T e . g . o n F r e e B S D :
IF ( CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS )
SET ( KDE3_DEFINITIONS ${ KDE3_DEFINITIONS } -D_XOPEN_SOURCE=500 -D_BSD_SOURCE )
SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common" )
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-exceptions -fno-check-new -fno-common" )
ENDIF ( CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS )
# w o r k s o n F r e e B S D , N O T t e s t e d o n N e t B S D a n d O p e n B S D
IF ( CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS )
SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common" )
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common" )
ENDIF ( CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS )
# i f n o s p e c i a l b u i l d t y p e i s s e l e c t e d , a d d - O 2 a s d e f a u l t o p t i m i z a t i o n
IF ( NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS )
SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT -O2" )
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT -O2" )
ENDIF ( NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS )
# SET ( CMAKE_SHARED_LINKER_FLAGS "-avoid-version -module -Wl,--no-undefined -Wl,--allow-shlib-undefined" )
# SET ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc" )
# SET ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc" )
ENDIF ( KDE3_FOUND )
# K D E 3 M a c r o s . c m a k e c o n t a i n s a l l t h e K D E s p e c i f i c m a c r o s
INCLUDE ( KDE3Macros )
FILE ( GLOB GLOB_PATHS_INCLUDE /usr/lib*/qt-3*/include/ )
FIND_PROGRAM ( PKG_CONFIG NAMES pkg-config )
EXECUTE_PROCESS ( COMMAND ${ PKG_CONFIG } "--variable=prefix" "qt-mt"
O U T P U T _ V A R I A B L E _ q t _ m t _ p a t h
E R R O R _ Q U I E T
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
SET ( QT_MT_PATH ${ _qt_mt_path } CACHE STRING "QT Path" FORCE )
FIND_PATH ( QT_INCLUDE_DIR_PLUS qt.h
$ { G L O B _ P A T H S _ I N C L U D E }
$ { Q T _ M T _ P A T H } / i n c l u d e )
IF ( NOT QT_INCLUDE_DIR )
SET ( QT_INCLUDE_DIR ${ QT_INCLUDE_DIR_PLUS } )
ENDIF ( NOT QT_INCLUDE_DIR )
FIND_PROGRAM ( CMAKE_UNAME uname ${ BIN_SEARCH_PATHES } )
IF ( CMAKE_UNAME )
EXECUTE_PROCESS ( COMMAND ${ CMAKE_UNAME } "-m"
O U T P U T _ V A R I A B L E C M A K E _ S Y S T E M _ P R O C E S S O R
E R R O R _ Q U I E T
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
IF ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "64" )
SET ( LIB_SUFFIX "64" CACHE STRING "Define suffix of directory name (32/64)" FORCE )
ELSE ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "64" )
SET ( LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" FORCE )
ENDIF ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "64" )
ENDIF ( CMAKE_UNAME )
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 3 _ I N C L U D E _ D I R S } )
SET ( LIB_SEARCH_PATHES
$ { L I B _ S E A R C H _ P A T H E S }
$ { K D E 3 _ L I B _ D I R } )
MACRO ( KDE3_PRINT_RESULTS )
IF ( KDE3_INCLUDE_DIR )
MESSAGE ( STATUS "Found KDE3 include dir: ${KDE3_INCLUDE_DIR}" )
ELSE ( KDE3_INCLUDE_DIR )
MESSAGE ( STATUS "Didn't find KDE3 headers" )
ENDIF ( KDE3_INCLUDE_DIR )
IF ( KDE3_LIB_DIR )
MESSAGE ( STATUS "Found KDE3 library dir: ${KDE3_LIB_DIR}" )
ELSE ( KDE3_LIB_DIR )
MESSAGE ( STATUS "Didn't find KDE3 core library" )
ENDIF ( KDE3_LIB_DIR )
IF ( KDE3_DCOPIDL_EXECUTABLE )
MESSAGE ( STATUS "Found KDE3 dcopidl preprocessor: ${KDE3_DCOPIDL_EXECUTABLE}" )
ELSE ( KDE3_DCOPIDL_EXECUTABLE )
MESSAGE ( STATUS "Didn't find the KDE3 dcopidl preprocessor" )
ENDIF ( KDE3_DCOPIDL_EXECUTABLE )
IF ( KDE3_DCOPIDL2CPP_EXECUTABLE )
MESSAGE ( STATUS "Found KDE3 dcopidl2cpp preprocessor: ${KDE3_DCOPIDL2CPP_EXECUTABLE}" )
ELSE ( KDE3_DCOPIDL2CPP_EXECUTABLE )
MESSAGE ( STATUS "Didn't find the KDE3 dcopidl2cpp preprocessor" )
ENDIF ( KDE3_DCOPIDL2CPP_EXECUTABLE )
IF ( KDE3_KCFGC_EXECUTABLE )
MESSAGE ( STATUS "Found KDE3 kconfig_compiler preprocessor: ${KDE3_KCFGC_EXECUTABLE}" )
ELSE ( KDE3_KCFGC_EXECUTABLE )
MESSAGE ( STATUS "Didn't find the KDE3 kconfig_compiler preprocessor" )
ENDIF ( KDE3_KCFGC_EXECUTABLE )
ENDMACRO ( KDE3_PRINT_RESULTS )
IF ( KDE3_FIND_REQUIRED AND NOT KDE3_FOUND )
# b a i l o u t i f s o m e t h i n g w a s n ' t f o u n d
KDE3_PRINT_RESULTS ( )
MESSAGE ( FATAL_ERROR "Could NOT find everything required for compiling KDE 3 programs" )
ENDIF ( KDE3_FIND_REQUIRED AND NOT KDE3_FOUND )
IF ( NOT KDE3_FIND_QUIETLY )
KDE3_PRINT_RESULTS ( )
ENDIF ( NOT KDE3_FIND_QUIETLY )
# a d d t h e f o u n d Q t a n d K D E i n c l u d e d i r e c t o r i e s t o t h e c u r r e n t i n c l u d e p a t h
SET ( KDE3_INCLUDE_DIRS ${ QT_INCLUDE_DIR } ${ KDE3_INCLUDE_DIR } )
include ( kdesvnMacros )
IF ( CMAKE_SIZEOF_VOID_P EQUAL 4 )
SET ( DEF_SUFF "" )
ELSE ( CMAKE_SIZEOF_VOID_P EQUAL 4 )
SET ( DEF_SUFF 64 )
ENDIF ( CMAKE_SIZEOF_VOID_P EQUAL 4 )
set ( LIB_SUFFIX ${ DEF_SUFF } CACHE STRING "Define suffix of directory name (32/64)" FORCE )
SET ( LIB_SEARCH_PATHES ${ KDE3_LIB_DIR }
$ E N V { K D E D I R } / l i b
/ o p t / k d e / l i b
/ o p t / k d e 3 / l i b
/ o p t / t r i n i t y / l i b
/ u s r / l i b
/ u s r / l o c a l / l i b
/ u s r / k d e 3 / l i b
)
IF ( LIB_SUFFIX )
SET ( LIB_SEARCH_PATHES
$ E N V { K D E D I R } / l i b $ { L I B _ S U F F I X }
$ E N V { H O M E } / l i b $ { L I B _ S U F F I X }
$ E N V { H O M E } / u s r / l i b $ { L I B _ S U F F I X }
/ o p t / l i b $ { L I B _ S U F F I X }
/ o p t / k d e / l i b $ { L I B _ S U F F I X }
/ o p t / k d e 3 / l i b $ { L I B _ S U F F I X }
/ o p t / t r i n i t y / l i b $ { L I B _ S U F F I X }
/ u s r / l i b $ { L I B _ S U F F I X }
/ u s r / k d e / 3 . 5 / l i b $ { L I B _ S U F F I X }
/ u s r / l o c a l / l i b $ { L I B _ S U F F I X }
$ { L I B _ S E A R C H _ P A T H E S }
)
$ { L I B _ S E A R C H _ P A T H E S } )
ENDIF ( LIB_SUFFIX )
FIND_LIBRARY ( M_LIBRARY NAMES m
FIND_LIBRARY ( KDE3_UI_LIBRARY NAMES kdeui
P A T H S
$ { L I B _ S E A R C H _ P A T H E S }
)
FIND_LIBRARY ( KDE3_UI_LIBRARY NAMES kdeui
FIND_LIBRARY ( KDE3_ PART_LIBRARY NAMES kparts
P A T H S
$ { L I B _ S E A R C H _ P A T H E S }
)
FIND_LIBRARY ( KDE3_PART_LIBRARY NAMES kparts
FIND_LIBRARY ( KDE3_ KIO_LIBRARY NAMES kio
P A T H S
$ { L I B _ S E A R C H _ P A T H E S }
)
FIND_LIBRARY ( KDE3_KIO_LIBRARY NAMES kio
FIND_LIBRARY ( KDE3_ DCOP_LIBRARY NAMES DCOP
P A T H S
$ { L I B _ S E A R C H _ P A T H E S }
)
FIND_LIBRARY ( KDE3_KHTML_LIBRARY NAMES khtml
FIND_LIBRARY ( KDE3_ WALLET_LIBRARY NAMES kwalletclient
P A T H S
$ { L I B _ S E A R C H _ P A T H E S }
)
FIND_LIBRARY ( KDE3_DCOP_LIBRARY NAMES DCOP
FIND_LIBRARY ( KDE3_ KINIT_KDED_LIBRARY NAMES kdeinit_kded
P A T H S
$ { L I B _ S E A R C H _ P A T H E S }
)
FIND_PROGRAM ( KDE3_KDECONFIG_EXECUTABLE NAME kde-config
P A T H S $ { B I N _ S E A R C H _ P A T H E S } )
FIND_PROGRAM ( KDE3_KDECONFIG_EXECUTABLE NAME kde-config PATHS
$ E N V { K D E D I R } / b i n
/ o p t / k d e / b i n
/ o p t / k d e 3 / b i n
/ o p t / t r i n i t y / b i n
/ u s r / k d e 3 / b i n
)
FIND_PROGRAM ( MSGFMT
N A M E S g m s g f m t m s g f m t
P A T H S $ { B I N _ S E A R C H _ P A T H E S } )
N A M E S g m s g f m t m s g f m t )
FIND_PROGRAM ( STRIP
N A M E S s t r i p
P A T H S $ { B I N _ S E A R C H _ P A T H E S } )
FIND_PROGRAM ( KDE3_MEINPROC_EXECUTABLE NAME meinproc
P A T H S $ { B I N _ S E A R C H _ P A T H E S } )
N A M E S s t r i p )
FIND_PROGRAM ( KDE3_MEINPROC_EXECUTABLE NAME meinproc PATHS
$ { K D E 3 _ B I N _ I N S T A L L _ D I R }
$ E N V { K D E D I R } / b i n
/ o p t / k d e / b i n
/ o p t / k d e 3 / b i n
/ o p t / t r i n i t y / b i n
/ u s r / k d e 3 / b i n
)
IF ( KDE3_MEINPROC_EXECUTABLE )
MESSAGE ( STATUS "Found meinproc: ${KDE3_MEINPROC_EXECUTABLE}" )
ELSE ( KDE3_MEINPROC_EXECUTABLE )
MESSAGE ( FATAL_ERROR "Could NOT find meinproc program!" )
MESSAGE ( STATUS "Didn't find meinproc !")
ENDIF ( KDE3_MEINPROC_EXECUTABLE )
IF ( MSGFMT )
EXECUTE_PROCESS ( COMMAND ${ MSGFMT } "--version"
O U T P U T _ V A R I A B L E _ m s g o u t
E R R O R _ Q U I E T
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
EXECUTE_PROCESS ( COMMAND ${ MSGFMT } "--version" "2>&1"
O U T P U T _ V A R I A B L E _ m s g o u t )
STRING ( REGEX MATCH "GNU[\t ]gettext" _isgnu "${_msgout}" )
IF ( NOT _isgnu )
MESSAGE ( STATUS "No gnu msgfmt found!" )
@ -121,63 +401,57 @@ IF(MSGFMT)
ENDIF ( NOT _isgnu )
ELSE ( MSGFMT )
SET ( MSGFMT ":" CACHE STRING "Msgfmt program" )
MESSAGE ( FATAL_ERROR "Could NOT find msgfmt program" )
ENDIF ( MSGFMT )
EXECUTE_PROCESS ( COMMAND ${ KDE3_KDECONFIG_EXECUTABLE } "--prefix"
C O M M A N D x a r g s " e c h o " " - n "
O U T P U T _ V A R I A B L E _ k d e _ p r e f i x _ p a t h
E R R O R _ Q U I E T
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
SET ( KDE_HTML_COMMON_PATH ${ _kde_prefix_path } /share/doc/HTML/en/common CACHE STRING "KDE HTML common Path" FORCE )
# ' c a u s e m y o w n d e f i n e s w e r e n o t g o o d I t a k e t h e m f r o m k d e 4 t r u n k
# a d d s o m e K D E s p e c i f i c s t u f f
SET ( SHARE_INSTALL_PREFIX ${ CMAKE_INSTALL_PREFIX } /share CACHE PATH "Base directory for files which go to share/" FORCE )
SET ( EXEC_INSTALL_PREFIX ${ CMAKE_INSTALL_PREFIX } CACHE PATH "Base directory for executables and libraries" FORCE )
set ( SHARE_INSTALL_PREFIX ${ CMAKE_INSTALL_PREFIX } /share CACHE PATH "Base directory for files which go to share/" FORCE )
set ( EXEC_INSTALL_PREFIX ${ CMAKE_INSTALL_PREFIX } CACHE PATH "Base directory for executables and libraries" FORCE )
#
# # t h e f o l l o w i n g a r e d i r e c t o r i e s w h e r e s t u f f w i l l b e i n s t a l l e d t o
SET ( BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" CACHE PATH "The kde bin install dir (default prefix/bin)" FORCE )
SET ( SBIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/sbin" CACHE PATH "The kde sbin install dir (default prefix/sbin)" FORCE )
SET ( LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE )
SET ( LIBEXEC_INSTALL_DIR "${LIB_INSTALL_DIR}/kde3/libexec" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib/kde3/libexec)" FORCE )
SET ( PLUGIN_INSTALL_DIR "${LIB_INSTALL_DIR}/kde3" CACHE PATH "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde3)" FORCE )
SET ( INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The subdirectory to the header prefix" FORCE )
SET ( CONFIG_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/config" CACHE PATH "The config file install dir" FORCE )
SET ( DATA_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/apps" CACHE PATH "The parent directory where applications can install their data" FORCE )
SET ( HTML_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/doc/HTML" CACHE PATH "The HTML install dir for documentation" FORCE )
SET ( ICON_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/icons" CACHE PATH "The icon install dir (default prefix/share/icons/)" FORCE )
SET ( KCFG_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/config.kcfg" CACHE PATH "The install dir for kconfig files" FORCE )
SET ( LOCALE_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/locale" CACHE PATH "The install dir for translations" FORCE )
SET ( MIME_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/mimelnk" CACHE PATH "The install dir for the mimetype desktop files" FORCE )
SET ( SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/services" CACHE PATH "The install dir for service (desktop, protocol, ...) files" FORCE )
SET ( SERVICETYPES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/servicetypes" CACHE PATH "The install dir for servicestypes desktop files" FORCE )
SET ( SOUND_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/sounds" CACHE PATH "The install dir for sound files" FORCE )
SET ( TEMPLATES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/templates" CACHE PATH "The install dir for templates (Create new file...)" FORCE )
SET ( WALLPAPER_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/wallpapers" CACHE PATH "The install dir for wallpapers" FORCE )
SET ( KCONF_UPDATE_INSTALL_DIR "${DATA_INSTALL_DIR}/kconf_update" CACHE PATH "The kconf_update install dir" FORCE )
set ( BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" CACHE PATH "The kde bin install dir (default prefix/bin)" FORCE )
set ( SBIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/sbin" CACHE PATH "The kde sbin install dir (default prefix/sbin)" FORCE )
set ( LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE )
set ( LIBEXEC_INSTALL_DIR "${LIB_INSTALL_DIR}/kde3/libexec" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib/kde3/libexec)" FORCE )
set ( PLUGIN_INSTALL_DIR "${LIB_INSTALL_DIR}/kde3" CACHE PATH "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde3)" FORCE )
set ( INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The subdirectory to the header prefix" FORCE )
set ( CONFIG_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/config" CACHE PATH "The config file install dir" FORCE )
set ( DATA_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/apps" CACHE PATH "The parent directory where applications can install their data" FORCE )
set ( HTML_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/doc/HTML" CACHE PATH "The HTML install dir for documentation" FORCE )
set ( ICON_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/icons" CACHE PATH "The icon install dir (default prefix/share/icons/)" FORCE )
set ( KCFG_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/config.kcfg" CACHE PATH "The install dir for kconfig files" FORCE )
set ( LOCALE_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/locale" CACHE PATH "The install dir for translations" FORCE )
set ( MIME_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/mimelnk" CACHE PATH "The install dir for the mimetype desktop files" FORCE )
set ( SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/services" CACHE PATH "The install dir for service (desktop, protocol, ...) files" FORCE )
set ( SERVICETYPES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/servicetypes" CACHE PATH "The install dir for servicestypes desktop files" FORCE )
set ( SOUND_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/sounds" CACHE PATH "The install dir for sound files" FORCE )
set ( TEMPLATES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/templates" CACHE PATH "The install dir for templates (Create new file...)" FORCE )
set ( WALLPAPER_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/wallpapers" CACHE PATH "The install dir for wallpapers" FORCE )
set ( KCONF_UPDATE_INSTALL_DIR "${DATA_INSTALL_DIR}/kconf_update" CACHE PATH "The kconf_update install dir" FORCE )
# t h i s o n e s h o u l d n ' t b e u s e d a n y m o r e
SET ( APPLNK_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/applnk" CACHE PATH "Is this still used ?" FORCE )
SET ( AUTOSTART_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/autostart" CACHE PATH "The install dir for autostart files" FORCE )
SET ( XDG_APPS_DIR "${SHARE_INSTALL_PREFIX}/applications/kde" CACHE PATH "The XDG apps dir" FORCE )
SET ( XDG_DIRECTORY_DIR "${SHARE_INSTALL_PREFIX}/desktop-directories" CACHE PATH "The XDG directory" FORCE )
SET ( SYSCONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/etc" CACHE PATH "The kde sysconfig install dir (default/etc)" FORCE )
SET ( MAN_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/man" CACHE PATH "The kde man install dir (default prefix/share/man/)" FORCE )
SET ( INFO_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/info" CACHE PATH "The kde info install dir (default prefix/info)" FORCE )
set ( APPLNK_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/applnk" CACHE PATH "Is this still used ?" FORCE )
set ( AUTOSTART_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/autostart" CACHE PATH "The install dir for autostart files" FORCE )
set ( XDG_APPS_DIR "${SHARE_INSTALL_PREFIX}/applications/kde" CACHE PATH "The XDG apps dir" FORCE )
set ( XDG_DIRECTORY_DIR "${SHARE_INSTALL_PREFIX}/desktop-directories" CACHE PATH "The XDG directory" FORCE )
set ( SYSCONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/etc" CACHE PATH "The kde sysconfig install dir (default/etc)" FORCE )
set ( MAN_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/man" CACHE PATH "The kde man install dir (default prefix/share/man/)" FORCE )
set ( INFO_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/info" CACHE PATH "The kde info install dir (default prefix/info)" FORCE )
# l i n k e r f l a g s - m u s t g e t c h e c k e d
SET ( LINK_NO_UNDEFINED "" )
SET ( lundef "-Wl,--no-undefined" )
KDESVN_CHECK_LINK_FLAG ( ${ lundef } _NO_UNDEFINED )
IF ( _NO_UNDEFINED )
SET ( LINK_NO_UNDEFINED "${lundef}" )
ENDIF ( _NO_UNDEFINED )
SET ( lundef "-Wl,--allow-shlib-undefined" )
KDESVN_CHECK_LINK_FLAG ( ${ lundef } _ALLOW_SHLIB )
IF ( _ALLOW_SHLIB )
SET ( LINK_NO_UNDEFINED "${LINK_NO_UNDEFINED} ${lundef}" )
ENDIF ( _ALLOW_SHLIB )
IF ( CMAKE_SYSTEM MATCHES "Linux*" )
SET ( lundef "-Wl,--no-undefined" )
KDESVN_CHECK_LINK_FLAG ( ${ lundef } _NO_UNDEFINED )
IF ( _NO_UNDEFINED )
SET ( LINK_NO_UNDEFINED "${lundef}" )
ENDIF ( _NO_UNDEFINED )
SET ( lundef "-Wl,--allow-shlib-undefined" )
KDESVN_CHECK_LINK_FLAG ( ${ lundef } _ALLOW_SHLIB )
IF ( _ALLOW_SHLIB )
SET ( LINK_NO_UNDEFINED "${LINK_NO_UNDEFINED} ${lundef}" )
ENDIF ( _ALLOW_SHLIB )
ENDIF ( CMAKE_SYSTEM MATCHES "Linux*" )
# o w n m a c r o s
@ -189,18 +463,18 @@ MACRO(KDESVN_INSTALL_ICONS _theme)
FOREACH ( _current_ICON ${ _icons } )
GET_FILENAME_COMPONENT ( _ctype ${ _current_ICON } EXT )
IF ( ${ _ctype } STREQUAL ".png" )
if ( ${ _ctype } STREQUAL ".png" )
STRING ( REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\1" _size "${_current_ICON}" )
STRING ( REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\2" _group "${_current_ICON}" )
STRING ( REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\3" _name "${_current_ICON}" )
SET ( _sizestring "${_size}x${_size}" )
ENDIF ( ${ _ctype } STREQUAL ".png" )
set ( _sizestring "${_size}x${_size}" )
endif ( ${ _ctype } STREQUAL ".png" )
IF ( ${ _ctype } STREQUAL ".svgz" )
if ( ${ _ctype } STREQUAL ".svgz" )
STRING ( REGEX REPLACE "^.*/[a-zA-Z]+\\-([a-z]+)\\-(.+\\.svgz)$" "\\1" _group "${_current_ICON}" )
STRING ( REGEX REPLACE "^.*/[a-zA-Z]+\\-([a-z]+)\\-(.+\\.svgz)$" "\\2" _name "${_current_ICON}" )
SET ( _sizestring "scalable" )
ENDIF ( ${ _ctype } STREQUAL ".svgz" )
set ( _sizestring "scalable" )
endif ( ${ _ctype } STREQUAL ".svgz" )
SET ( _icon_GROUP "actions" )
@ -256,7 +530,6 @@ MACRO(ADD_POFILES packagename)
ENDMACRO ( ADD_POFILES )
# KDE3_CREATE_HANDBOOK ( docbookfile )
# C r e a t e t h e h a n d b o o k f r o m t h e docbookfile ( using meinproc )
MACRO ( KDE3_CREATE_HANDBOOK _docbook )
@ -278,7 +551,6 @@ MACRO (KDE3_CREATE_HANDBOOK _docbook )
ADD_CUSTOM_TARGET ( handbook ALL DEPENDS ${ _doc } )
ENDMACRO ( KDE3_CREATE_HANDBOOK )
# KDE3_INSTALL_HANDBOOK ( )
# I n s t a l l t h e h a n d b o o k d o c u m e n t a t i o n
MACRO ( KDE3_INSTALL_HANDBOOK _appname )
@ -293,7 +565,7 @@ MACRO (KDE3_INSTALL_HANDBOOK _appname )
FILE ( GLOB _images_src ${ _tmp_src_FILE } /*.png )
INSTALL ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /index.cache.bz2 ${ _books_src } ${ _books_bin } ${ _images_src } ${ _images_bin }
D E S T I N A T I O N $ { H T M L _ I N S T A L L _ D I R } / $ { d i r n a m e } )
D E S T I N A T I O N $ { H T M L _ I N S T A L L _ D I R } / $ { d i r n a m e } )
INSTALL ( CODE "EXECUTE_PROCESS ( COMMAND /bin/ln -s \" ${ KDE_HTML_COMMON_PATH } \" \"$ENV{DESTDIR}${HTML_INSTALL_DIR}/${dirname}/common\" ERROR_QUIET ) " )
INSTALL ( CODE "MESSAGE(STATUS \" Installing $ENV{ DESTDIR } ${ HTML_INSTALL_DIR } / ${ dirname } /common\ ")" )
@ -313,4 +585,3 @@ MACRO (KDE3_INSTALL_HANDBOOK _appname )
ENDFOREACH ( _p )
# E n d o f s p e c i f i c f o r K B F X c o d e
ENDMACRO ( KDE3_INSTALL_HANDBOOK )