@ -11,40 +11,15 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # #
# # # # # __ td e _ i n t e r n a l _ s e t u p _ p a t h s _ s t a t u s
# # # # # td e _ i n t e r n a l _ s e t u p _ p a t h
macro ( __tde_internal_setup_paths_status __path __value __method )
message ( STATUS " ${__path}=${__value} [${__method}]" )
endmacro ( __tde_internal_setup_paths_status )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # #
# # # # # _ _ t d e _ i n t e r n a l _ s e t u p _ p a t h
macro ( __tde_internal_setup_path __path __default )
set ( __method "user" )
if ( NOT ${ __path } )
set ( __method "default" )
set ( __kdeconfig_type ${ ARGV2 } )
if ( _use_kdeconfig AND __kdeconfig_type )
execute_process (
C O M M A N D $ { K D E C O N F I G _ E X E C U T A B L E } - - e x p a n d v a r s - - i n s t a l l $ { _ _ k d e c o n f i g _ t y p e }
O U T P U T _ V A R I A B L E $ { _ _ p a t h }
R E S U L T _ V A R I A B L E _ _ r e s u l 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 ( __result )
tde_message_fatal ( "Unable to run kde-config!\n kdelibs are correctly installed?\n LD_LIBRARY_PATH are correctly set?" )
endif ( __result )
endif ( _use_kdeconfig AND __kdeconfig_type )
if ( ${ __path } )
set ( __method "kde-config" )
else ( ${ __path } )
set ( ${ __path } "${__default}" )
endif ( ${ __path } )
endif ( NOT ${ __path } )
__tde_internal_setup_paths_status ( ${ __path } ${ ${__path } } ${ __method } )
endmacro ( __tde_internal_setup_path )
macro ( _tde_internal_setup_path _path _default _comment )
if ( DEFINED ${ _path } )
set ( ${ _path } "${${_path}}" CACHE PATH "${_comment}" )
else ( DEFINED ${ _path } )
set ( ${ _path } "${_default}" )
endif ( DEFINED ${ _path } )
endmacro ( _tde_internal_setup_path )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@ -53,123 +28,39 @@ endmacro( __tde_internal_setup_path )
macro ( tde_setup_paths )
message ( STATUS "Setup install paths:" )
# - - p r e f i x
# i n s t a l l a r c h i t e c t u r e - i n d e p e n d e n t f i l e s i n P R E F I X
if ( NOT PREFIX )
set ( __method "CMAKE_INSTALL_PREFIX" )
set ( PREFIX "${CMAKE_INSTALL_PREFIX}" )
else ( NOT PREFIX )
# P R E F I X h a v e p r e c e d e n c e o v e r C M A K E _ I N S T A L L _ P R E F I X
set ( __method "user" )
set ( CMAKE_INSTALL_PREFIX "${PREFIX}" )
endif ( NOT PREFIX )
__tde_internal_setup_paths_status ( PREFIX ${ PREFIX } ${ __method } )
# - - e x e c - p r e f i x
# i n s t a l l a r c h i t e c t u r e - d e p e n d e n t f i l e s i n E P R E F I X
if ( NOT EPREFIX )
set ( __method "default" )
set ( EPREFIX "${PREFIX}" )
endif ( NOT EPREFIX )
__tde_internal_setup_paths_status ( EPREFIX ${ EPREFIX } ${ __method } )
# w e w i l l u s i n g k d e - c o n f i g f o r d i s c o v e r p a t h s
set ( _use_kdeconfig ${ ARGV0 } )
if ( _use_kdeconfig )
# K D E C O N F I G _ E X E C U T A B L E i s n o t s e t , s o w i l l m u s t t o s e a r c h f o r i t
if ( NOT KDECONFIG_EXECUTABLE )
find_program ( KDECONFIG_EXECUTABLE
N A M E S k d e - c o n f i g
H I N T S $ E N V { K D E D I R } / b i n
P A T H S " $ { E P R E F I X } / b i n " " $ { P R E F I X } / b i n " " $ { C M A K E _ I N S T A L L _ P R E F I X } / b i n " )
if ( NOT KDECONFIG_EXECUTABLE )
tde_message_fatal (
" k d e - c o n f i g e x e c u t a b l e a r e N O T f o u n d !
kdelibs ( -devel ) a r e i n s t a l l e d ? E P R E F I X a r e c o r r e c t l y s e t ?
T r y t o s e t K D E C O N F I G _ E X E C U T A B L E t o k d e - c o n f i g p a t h .
E x a m p l e : c m a k e - D K D E C O N F I G _ E X E C U T A B L E = / u s r / k d e / 3 . 5 / b i n / k d e - c o n f i g " )
endif ( NOT KDECONFIG_EXECUTABLE )
endif ( NOT KDECONFIG_EXECUTABLE )
endif ( _use_kdeconfig )
# - - b i n d i r
# u s e r e x e c u t a b l e s
__tde_internal_setup_path ( BINDIR "${EPREFIX}/bin" "exe" )
# - - s b i n d i r
# s y s t e m a d m i n e x e c u t a b l e s
__tde_internal_setup_path ( SBINDIR "${EPREFIX}/sbin" )
# - - l i b e x e c d i r
# p r o g r a m e x e c u t a b l e s
__tde_internal_setup_path ( LIBEXECDIR "${EPREFIX}/libexec" )
# - - s y s c o n f d i r
# r e a d - o n l y s i n g l e - m a c h i n e d a t a
__tde_internal_setup_path ( SYSCONFDIR "${PREFIX}/etc" )
# - - s h a r e d s t a t e d i r
# m o d i f i a b l e a r c h i t e c t u r e - i n d e p e n d e n t d a t a
__tde_internal_setup_path ( SHAREDSTATEDIR "${PREFIX}/com" )
# - - l o c a l s t a t e d i r
# m o d i f i a b l e s i n g l e - m a c h i n e d a t a
__tde_internal_setup_path ( LOCALSTATEDIR "${PREFIX}/var" )
# - - l i b d i r
# o b j e c t c o d e l i b r a r i e s
__tde_internal_setup_path ( LIBDIR "${EPREFIX}/lib" "lib" )
# - - i n c l u d e d i r
# C h e a d e r f i l e s
__tde_internal_setup_path ( INCLUDEDIR "${PREFIX}/include" "include" )
# - - o l d i n c l u d e d i r
# C h e a d e r f i l e s f o r n o n - g c c
__tde_internal_setup_path ( OLDINCLUDEDIR "/usr/include" )
# - - d a t a r o o t d i r
# r e a d - o n l y a r c h . - i n d e p e n d e n t d a t a r o o t
__tde_internal_setup_path ( DATAROOTDIR "${PREFIX}/share" )
# - - d a t a d i r
# r e a d - o n l y a r c h i t e c t u r e - i n d e p e n d e n t d a t a
__tde_internal_setup_path ( DATADIR "${DATAROOTDIR}" )
# - - i n f o d i r
# i n f o d o c u m e n t a t i o n
__tde_internal_setup_path ( INFODIR "${DATAROOTDIR}/info" )
# - - l o c a l e d i r
# l o c a l e - d e p e n d e n t d a t a
__tde_internal_setup_path ( LOCALEDIR "${DATAROOTDIR}/locale" )
# - - m a n d i r
# m a n d o c u m e n t a t i o n
__tde_internal_setup_path ( MANDIR "${DATAROOTDIR}/man" )
# - - d o c d i r
# d o c u m e n t a t i o n r o o t
__tde_internal_setup_path ( DOCDIR "${DATAROOTDIR}/doc/${PACKAGE}" )
# - - h t m l d i r
# h t m l d o c u m e n t a t i o n
__tde_internal_setup_path ( HTMLDIR "${DOCDIR}" "html" )
# - - d v i d i r
# d v i d o c u m e n t a t i o n
__tde_internal_setup_path ( DVIDIR "${DOCDIR}" )
# - - p d f d i r
# p d f d o c u m e n t a t i o n
__tde_internal_setup_path ( PDFDIR "${DOCDIR}" )
# - - p s d i r
# p s d o c u m e n t a t i o n
__tde_internal_setup_path ( PSDIR "${DOCDIR}" )
# i n s t a l l p a t h s
_tde_internal_setup_path ( EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" "Base directory for executables and libraries" )
_tde_internal_setup_path ( SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share" "Base directory for files which go to share/" )
_tde_internal_setup_path ( BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" "The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)" )
_tde_internal_setup_path ( SBIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/sbin" "The install dir for system executables (default ${EXEC_INSTALL_PREFIX}/sbin)" )
_tde_internal_setup_path ( LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" "The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})" )
_tde_internal_setup_path ( LIBEXEC_INSTALL_DIR "${LIB_INSTALL_DIR}/kde3/libexec" "The subdirectory relative to the install prefix where libraries will be installed (default is ${LIB_INSTALL_DIR}/kde3/libexec)" )
_tde_internal_setup_path ( INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" "The subdirectory to the header prefix" )
_tde_internal_setup_path ( PLUGIN_INSTALL_DIR "${LIB_INSTALL_DIR}/kde3" "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde3)" )
_tde_internal_setup_path ( CONFIG_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/config" "The config file install dir" )
_tde_internal_setup_path ( DATA_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/apps" "The parent directory where applications can install their data" )
_tde_internal_setup_path ( HTML_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/doc/HTML" "The HTML install dir for documentation" )
_tde_internal_setup_path ( ICON_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/icons" "The icon install dir (default ${SHARE_INSTALL_PREFIX}/share/icons/)" )
_tde_internal_setup_path ( KCFG_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/config.kcfg" "The install dir for kconfig files" )
_tde_internal_setup_path ( LOCALE_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/locale" "The install dir for translations" )
_tde_internal_setup_path ( APPS_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/applnk" "The install dir for the application desktop files" )
_tde_internal_setup_path ( MIME_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/mimelnk" "The install dir for the mimetype desktop files" )
_tde_internal_setup_path ( SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/services" "The install dir for service (desktop, protocol, ...) files" )
_tde_internal_setup_path ( SERVICETYPES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/servicetypes" "The install dir for servicestypes desktop files" )
_tde_internal_setup_path ( SOUND_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/sounds" "The install dir for sound files" )
_tde_internal_setup_path ( TEMPLATES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/templates" "The install dir for templates (Create new file...)" )
_tde_internal_setup_path ( WALLPAPER_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/wallpapers" "The install dir for wallpapers" )
_tde_internal_setup_path ( KCONF_UPDATE_INSTALL_DIR "${DATA_INSTALL_DIR}/kconf_update" "The kconf_update install dir" )
_tde_internal_setup_path ( AUTOSTART_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/autostart" "The install dir for autostart files" )
_tde_internal_setup_path ( SYSCONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/etc" "The sysconfig install dir (default ${CMAKE_INSTALL_PREFIX}/etc)" )
_tde_internal_setup_path ( MAN_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/man" "The man install dir (default ${SHARE_INSTALL_PREFIX}/man/)" )
_tde_internal_setup_path ( INFO_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/info" "The info install dir (default ${SHARE_INSTALL_PREFIX}/info)" )
_tde_internal_setup_path ( XDG_MENU_INSTALL_DIR "${SYSCONF_INSTALL_DIR}/xdg/menus" "The XDG menus dir" )
_tde_internal_setup_path ( XDG_APPS_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/applications/kde" "The XDG apps dir" )
_tde_internal_setup_path ( XDG_DIRECTORY_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/desktop-directories" "The XDG directory" )
_tde_internal_setup_path ( XDG_MIME_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/mime/packages" "The install dir for the xdg mimetypes" )
endmacro ( tde_setup_paths )