From 40fe6a00b6dde631a68e40731fabb71680a5454c Mon Sep 17 00:00:00 2001 From: samelian Date: Sun, 24 Oct 2010 21:53:26 +0000 Subject: [kdelibs] follow KDE4 rules for install path names and some other small changes git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1189382 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- CMakeLists.txt | 157 +++++----------- interfaces/khexedit/CMakeLists.txt | 2 +- interfaces/kimproxy/interface/CMakeLists.txt | 2 +- interfaces/kmediaplayer/CMakeLists.txt | 2 +- interfaces/kregexpeditor/CMakeLists.txt | 2 +- interfaces/kscript/CMakeLists.txt | 2 +- interfaces/kspeech/CMakeLists.txt | 2 +- interfaces/ktexteditor/CMakeLists.txt | 2 +- kabc/CMakeLists.txt | 2 +- kdecore/CMakeLists.txt | 16 +- kdecore/kde-config.cpp.cmake | 270 +++++++++++++++++++++++++++ kded/CMakeLists.txt | 6 +- kdeprint/CMakeLists.txt | 2 +- kdoctools/CMakeLists.txt | 4 +- kio/CMakeLists.txt | 8 +- kio/kfile/CMakeLists.txt | 2 +- kio/kioexec/CMakeLists.txt | 5 +- kio/misc/CMakeLists.txt | 5 +- kioslave/http/kcookiejar/CMakeLists.txt | 2 +- kioslave/iso/CMakeLists.txt | 2 +- kparts/CMakeLists.txt | 3 +- kresources/CMakeLists.txt | 4 +- kspell2/CMakeLists.txt | 2 +- kutils/CMakeLists.txt | 2 +- pics/CMakeLists.txt | 2 +- pics/crystalsvg/CMakeLists.txt | 2 +- pics/emoticons/CMakeLists.txt | 2 +- pics/hicolor/CMakeLists.txt | 2 +- 28 files changed, 353 insertions(+), 161 deletions(-) create mode 100644 kdecore/kde-config.cpp.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d8fd9e2c..79a8d9a5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,14 +11,39 @@ cmake_minimum_required( VERSION 2.6 ) -# FIXME KDE3_MODULE_DIR is not set; this is cmake bug? -set( KDE3_MODULE_DIR "/usr/share/cmake/Modules" ) -# directory to our cmake modules +##### general package setup ##################### + +project( kdebase ) + +set( PACKAGE kdelibs ) +set( VERSION "3.5.13" ) + + +##### include essential cmake modules ########### + +include( FindPkgConfig ) +include( CheckIncludeFile ) +include( CheckSymbolExists ) +include( CheckFunctionExists ) +include( CheckCSourceCompiles ) +include( CheckTypeSize ) +include( CheckCSourceRuns ) + + +##### include our cmake modules ################# + set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) +include( TDEMacros ) +include( TDESetupPaths ) + + +##### setup and find essential stuff ############ + +tde_setup_paths( ) +find_package( Qt ) +find_package( TQt ) -project( kdelibs ) -set( VERSION "3.5.12" ) ##### user requested options #################### @@ -41,91 +66,11 @@ OPTION( WITH_ASPELL "Enable aspell support" OFF ) OPTION( WITH_HSPELL "Enable hspell support" OFF ) -##### paths setup ############################### - -if( NOT BIN_INSTALL_DIR ) - set( BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin ) -endif ( NOT BIN_INSTALL_DIR ) - -if( NOT LIB_INSTALL_DIR ) - set( LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib ) -endif( NOT LIB_INSTALL_DIR ) - -if( NOT INCLUDE_INSTALL_DIR ) - set( INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include ) -endif( NOT INCLUDE_INSTALL_DIR ) - -if( NOT SHARE_INSTALL_DIR ) - set( SHARE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share ) -endif( NOT SHARE_INSTALL_DIR ) - -if( NOT ICONS_INSTALL_DIR ) - set( ICONS_INSTALL_DIR ${SHARE_INSTALL_DIR}/icons ) -endif( NOT ICONS_INSTALL_DIR ) - -if( NOT MIME_INSTALL_DIR ) - set( MIME_INSTALL_DIR ${SHARE_INSTALL_DIR}/mimelnk ) -endif( NOT MIME_INSTALL_DIR ) - -if( NOT PLUGIN_INSTALL_DIR ) - set( PLUGIN_INSTALL_DIR ${LIB_INSTALL_DIR}/kde3 ) -endif( NOT PLUGIN_INSTALL_DIR ) - -if( NOT SERVICES_INSTALL_DIR ) - set( SERVICES_INSTALL_DIR ${SHARE_INSTALL_DIR}/services ) -endif( NOT SERVICES_INSTALL_DIR ) - -if( NOT DATA_INSTALL_DIR ) - set( DATA_INSTALL_DIR ${SHARE_INSTALL_DIR}/apps ) -endif( NOT DATA_INSTALL_DIR ) - -if( NOT HTML_INSTALL_DIR ) - set( HTML_INSTALL_DIR ${SHARE_INSTALL_DIR}/doc/HTML ) -endif( NOT HTML_INSTALL_DIR ) - -if( NOT CONFIG_INSTALL_DIR ) - set( CONFIG_INSTALL_DIR ${SHARE_INSTALL_DIR}/config ) -endif( NOT CONFIG_INSTALL_DIR ) - -if( NOT LOCALE_INSTALL_DIR ) - set( LOCALE_INSTALL_DIR ${SHARE_INSTALL_DIR}/locale ) -endif( NOT LOCALE_INSTALL_DIR ) - -if( NOT PKGCONFIG_INSTALL_DIR ) - set( PKGCONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/pkgconfig ) -endif( NOT PKGCONFIG_INSTALL_DIR ) - -if( NOT DCOP_PATH ) - set( DCOP_PATH ${BIN_INSTALL_DIR} ) -endif( NOT DCOP_PATH ) - -if( NOT KDEDIR ) - set( KDEDIR ${CMAKE_INSTALL_PREFIX} ) -endif( NOT KDEDIR ) - - -################################################# - - -if( NOT SYSCONFDIR ) - set( SYSCONFDIR ${CMAKE_INSTALL_PREFIX}/etc ) -endif( NOT SYSCONFDIR ) - -if( NOT XDG_MENUDIR ) - set( XDG_MENUDIR ${SYSCONFDIR}/xdg/menus ) -endif( NOT XDG_MENUDIR ) - - ##### set PKG_CONFIG_PATH ####################### set( ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:${PKGCONFIG_INSTALL_DIR}:${LIB_INSTALL_DIR}/pkgconfig:$ENV{PKG_CONFIG_PATH}" ) -##### include our cmake modules ################# - -include( TDEMacros ) - - ##### check for CPU architecture ################ ### FIXME fast malloc is also available on x86_64 architecture? @@ -164,13 +109,7 @@ endif( NO_BUILTIN ) ##### system checks ############################# -include( CheckIncludeFile ) -include( CheckSymbolExists ) -include( CheckFunctionExists ) -include( FindPkgConfig ) -include( CheckCSourceCompiles ) -include( CheckTypeSize ) -include( CheckCSourceRuns ) + check_include_file( "alloca.h" HAVE_ALLOCA_H ) check_include_file( "arpa/nameser8_compat.h" HAVE_ARPA_NAMESER8_COMPAT_H ) @@ -549,27 +488,27 @@ endif( NOT LIBXSLT_FOUND ) ##### check for Qt3 ############################# -find_package( Qt3 ) -if( NOT QT_FOUND ) - message(FATAL_ERROR "\nQt3 are required, but not found on your system" ) -endif( NOT QT_FOUND ) +# find_package( Qt3 ) +# if( NOT QT_FOUND ) +# message(FATAL_ERROR "\nQt3 are required, but not found on your system" ) +# endif( NOT QT_FOUND ) ##### check for TQt ############################# -pkg_search_module( TQT TQt ) -if( NOT TQT_FOUND ) - message(FATAL_ERROR "\nTQt are required, but not found on your system" ) -endif( NOT TQT_FOUND ) - -set( QT_MOC_EXECUTABLE "tmoc" ) - -# check if Qt is linked against Xft -set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ) -set( CMAKE_REQUIRED_LIBRARIES ${TQT_LDFLAGS} ) -check_function_exists( XftInit KDEINIT_USE_XFT ) -set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} ) -unset( bak_CMAKE_REQUIRED_LIBRARIES ) +# pkg_search_module( TQT TQt ) +# if( NOT TQT_FOUND ) +# message(FATAL_ERROR "\nTQt are required, but not found on your system" ) +# endif( NOT TQT_FOUND ) +# +# set( QT_MOC_EXECUTABLE "tmoc" ) +# +# # check if Qt is linked against Xft +# set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ) +# set( CMAKE_REQUIRED_LIBRARIES ${TQT_LDFLAGS} ) +# check_function_exists( XftInit KDEINIT_USE_XFT ) +# set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} ) +# unset( bak_CMAKE_REQUIRED_LIBRARIES ) ##### check for ALSA ############################ diff --git a/interfaces/khexedit/CMakeLists.txt b/interfaces/khexedit/CMakeLists.txt index 94f2e8f30..b98c8ab5f 100644 --- a/interfaces/khexedit/CMakeLists.txt +++ b/interfaces/khexedit/CMakeLists.txt @@ -19,4 +19,4 @@ install( FILES ##### other data ################################ -install( FILES kbytesedit.desktop DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) +install( FILES kbytesedit.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) diff --git a/interfaces/kimproxy/interface/CMakeLists.txt b/interfaces/kimproxy/interface/CMakeLists.txt index f1335c5f4..d62819ed8 100644 --- a/interfaces/kimproxy/interface/CMakeLists.txt +++ b/interfaces/kimproxy/interface/CMakeLists.txt @@ -19,4 +19,4 @@ install( FILES ##### other data ################################ install( FILES kcm_instantmessenger.desktop DESTINATION ${DATA_INSTALL_DIR}/kcm_componentchooser ) -install( FILES dcopinstantmessenger.desktop DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) +install( FILES dcopinstantmessenger.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) diff --git a/interfaces/kmediaplayer/CMakeLists.txt b/interfaces/kmediaplayer/CMakeLists.txt index 03523c36e..7bef16b69 100644 --- a/interfaces/kmediaplayer/CMakeLists.txt +++ b/interfaces/kmediaplayer/CMakeLists.txt @@ -45,7 +45,7 @@ install( FILES install( FILES kmediaplayerengine.desktop kmediaplayer.desktop - DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) + DESTINATION ${SERVICETYPES_INSTALL_DIR} ) ##### kmediaplayer ############################## diff --git a/interfaces/kregexpeditor/CMakeLists.txt b/interfaces/kregexpeditor/CMakeLists.txt index 5b2f370c8..bac8b8fe1 100644 --- a/interfaces/kregexpeditor/CMakeLists.txt +++ b/interfaces/kregexpeditor/CMakeLists.txt @@ -17,4 +17,4 @@ install( FILES ##### other data ################################ -install( FILES kregexpeditor.desktop DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) +install( FILES kregexpeditor.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) diff --git a/interfaces/kscript/CMakeLists.txt b/interfaces/kscript/CMakeLists.txt index 8a5290c5c..36e049824 100644 --- a/interfaces/kscript/CMakeLists.txt +++ b/interfaces/kscript/CMakeLists.txt @@ -42,7 +42,7 @@ install( FILES ##### other data ################################ -install( FILES scriptinterface.desktop DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) +install( FILES scriptinterface.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) ##### kscript ################################### diff --git a/interfaces/kspeech/CMakeLists.txt b/interfaces/kspeech/CMakeLists.txt index 5bf284687..f9205b83d 100644 --- a/interfaces/kspeech/CMakeLists.txt +++ b/interfaces/kspeech/CMakeLists.txt @@ -18,4 +18,4 @@ install( FILES ##### other data ################################ -install( FILES dcoptexttospeech.desktop DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) +install( FILES dcoptexttospeech.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) diff --git a/interfaces/ktexteditor/CMakeLists.txt b/interfaces/ktexteditor/CMakeLists.txt index 249535a47..ba445df16 100644 --- a/interfaces/ktexteditor/CMakeLists.txt +++ b/interfaces/ktexteditor/CMakeLists.txt @@ -59,7 +59,7 @@ install( FILES install( FILES ktexteditor.desktop ktexteditoreditor.desktop ktexteditorplugin.desktop - DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) + DESTINATION ${SERVICETYPES_INSTALL_DIR} ) install( FILES kcm_ktexteditor.desktop diff --git a/kabc/CMakeLists.txt b/kabc/CMakeLists.txt index 0cddd4770..f03e365f2 100644 --- a/kabc/CMakeLists.txt +++ b/kabc/CMakeLists.txt @@ -63,7 +63,7 @@ install( FILES ##### other data ################################ -install( FILES kab2kabc.desktop DESTINATION ${SHARE_INSTALL_DIR}/autostart ) +install( FILES kab2kabc.desktop DESTINATION ${AUTOSTART_INSTALL_DIR} ) install( FILES kabc_manager.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kresources ) install( FILES countrytransl.map DESTINATION ${DATA_INSTALL_DIR}/kabc ) diff --git a/kdecore/CMakeLists.txt b/kdecore/CMakeLists.txt index 56243a9a3..c475c89c3 100644 --- a/kdecore/CMakeLists.txt +++ b/kdecore/CMakeLists.txt @@ -77,7 +77,7 @@ install( FILES ##### other data ################################ -tde_install_empty_directory( ${SHARE_INSTALL_DIR}/locale/all_languages ) +tde_install_empty_directory( ${LOCALE_INSTALL_DIR}/all_languages ) install( FILES 40.colors Web.colors Royal.colors Rainbow.colors DESTINATION ${CONFIG_INSTALL_DIR}/colors ) @@ -183,18 +183,8 @@ tde_add_library( ${target} SHARED ##### kde-config ################################ -# FIXME need a little research about these parameters -set( prefix ${CMAKE_INSTALL_PREFIX} ) -set( exec_prefix "\${prefix}" ) -set( libdir ${LIB_INSTALL_DIR} ) -set( incdir ${INCLUDE_INSTALL_DIR} ) -set( datadir ${SHARE_INSTALL_DIR} ) -set( sysconfdir ${SYSCONFDIR} ) - -string( REGEX REPLACE "^${SHARE_INSTALL_DIR}" "\${datadir}" kde_datadir ${DATA_INSTALL_DIR} ) -string( REGEX REPLACE "^${prefix}" "\${prefix}" includedir ${INCLUDE_INSTALL_DIR} ) - -configure_file( kde-config.cpp.in kde-config.cpp @ONLY ) +# FIXME still need some research and improvements +configure_file( kde-config.cpp.cmake kde-config.cpp @ONLY ) tde_add_executable( kde-config diff --git a/kdecore/kde-config.cpp.cmake b/kdecore/kde-config.cpp.cmake new file mode 100644 index 000000000..36e3ff583 --- /dev/null +++ b/kdecore/kde-config.cpp.cmake @@ -0,0 +1,270 @@ +// -*- c++ -*- + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const char *description = I18N_NOOP("A little program to output installation paths"); + +static KCmdLineOptions options[] = +{ + { "expandvars", I18N_NOOP("expand ${prefix} and ${exec_prefix} in output"), 0 }, + { "prefix", I18N_NOOP("Compiled in prefix for KDE libraries"), 0 }, + { "exec-prefix", I18N_NOOP("Compiled in exec_prefix for KDE libraries"), 0 }, + { "libsuffix", I18N_NOOP("Compiled in library path suffix"), 0 }, + { "localprefix", I18N_NOOP("Prefix in $HOME used to write files"), 0}, + { "version", I18N_NOOP("Compiled in version string for KDE libraries"), 0 }, + { "types", I18N_NOOP("Available KDE resource types"), 0 }, + { "path type", I18N_NOOP("Search path for resource type"), 0 }, + { "userpath type", I18N_NOOP("User path: desktop|autostart|trash|document"), 0 }, + { "install type", I18N_NOOP("Prefix to install resource files to"), 0}, + { 0,0,0 } +}; + +bool _expandvars = false; + +TQString expandvars(const char *_input) +{ + TQString result = TQString::fromLatin1(_input); + if (!_expandvars) + return result; + + bool changed = false; + int index = result.find("${prefix}"); + if (index >= 0) { + result = result.replace(index, 9, "@CMAKE_INSTALL_PREFIX@"); + changed = true; + } + index = result.find("$(prefix)"); + if (index >= 0) { + result = result.replace(index, 9, "@CMAKE_INSTALL_PREFIX@"); + changed = true; + } + index = result.find("${datadir}"); + if (index >= 0) { + result = result.replace(index, 10, "@SHARE_INSTALL_PREFIX@"); + changed = true; + } + index = result.find("$(datadir)"); + if (index >= 0) { + result = result.replace(index, 10, "@SHARE_INSTALL_PREFIX@"); + changed = true; + } + index = result.find("${exec_prefix}"); + if (index >= 0) { + result = result.replace(index, 14, "@EXEC_INSTALL_PREFIX@"); + changed = true; + } + index = result.find("$(exec_prefix)"); + if (index >= 0) { + result = result.replace(index, 14, "@EXEC_INSTALL_PREFIX@"); + changed = true; + } + index = result.find("${libdir}"); + if (index >= 0) { + result = result.replace(index, 9, "@LIB_INSTALL_DIR@"); + changed = true; + } + index = result.find("$(libdir)"); + if (index >= 0) { + result = result.replace(index, 9, "@LIB_INSTALL_DIR@"); + changed = true; + } + index = result.find("${includedir}"); + if (index >= 0) { + result = result.replace(index, 20, "@INCLUDE_INSTALL_DIR@"); + changed = true; + } + index = result.find("$(includedir)"); + if (index >= 0) { + result = result.replace(index, 20, "@INCLUDE_INSTALL_DIR@"); + changed = true; + } + index = result.find("${sysconfdir}"); + if (index >= 0) { + result = result.replace(index, 13, "@SYSCONF_INSTALL_DIR@"); + changed = true; + } + index = result.find("$(sysconfdir)"); + if (index >= 0) { + result = result.replace(index, 13, "@SYSCONF_INSTALL_DIR@"); + changed = true; + } + if (changed) + return expandvars(result.latin1()); + else + return result; +} + +void printResult(const TQString &s) +{ + if (s.isEmpty()) + printf("\n"); + else + printf("%s\n", s.local8Bit().data()); +} + +int main(int argc, char **argv) +{ + KLocale::setMainCatalogue("kdelibs"); + KAboutData about("kde-config", "kde-config", "1.0", description, KAboutData::License_GPL, "(C) 2000 Stephan Kulow"); + KCmdLineArgs::init( argc, argv, &about); + + KCmdLineArgs::addCmdLineOptions( options ); // Add my own options. + + KInstance a("kde-config"); + (void)KGlobal::dirs(); // trigger the creation + (void)KGlobal::config(); + + // Get application specific arguments + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + + _expandvars = args->isSet("expandvars"); + + if (args->isSet("prefix")) + { + printResult(expandvars("@CMAKE_INSTALL_PREFIX@")); + return 0; + } + + if (args->isSet("exec-prefix")) + { + printResult(expandvars("@EXEC_INSTALL_PREFIX@")); + return 0; + } + + if (args->isSet("libsuffix")) + { + TQString tmp(KDELIBSUFF); + tmp.remove('"'); + printResult(expandvars(tmp.local8Bit())); + return 0; + } + + if (args->isSet("localprefix")) + { + printResult(KGlobal::dirs()->localkdedir()); + return 0; + } + + if (args->isSet("version")) + { + printf("%s\n", KDE_VERSION_STRING); + return 0; + } + + if (args->isSet("types")) + { + TQStringList types = KGlobal::dirs()->allTypes(); + types.sort(); + const char *helptexts[] = { + "apps", I18N_NOOP("Applications menu (.desktop files)"), + "cgi", I18N_NOOP("CGIs to run from kdehelp"), + "config", I18N_NOOP("Configuration files"), + "data", I18N_NOOP("Where applications store data"), + "exe", I18N_NOOP("Executables in $prefix/bin"), + "html", I18N_NOOP("HTML documentation"), + "icon", I18N_NOOP("Icons"), + "kcfg", I18N_NOOP("Configuration description files"), + "lib", I18N_NOOP("Libraries"), + "include", I18N_NOOP("Includes/Headers"), + "locale", I18N_NOOP("Translation files for KLocale"), + "mime", I18N_NOOP("Mime types"), + "module", I18N_NOOP("Loadable modules"), + "qtplugins", I18N_NOOP("Qt plugins"), + "services", I18N_NOOP("Services"), + "servicetypes", I18N_NOOP("Service types"), + "sound", I18N_NOOP("Application sounds"), + "templates", I18N_NOOP("Templates"), + "wallpaper", I18N_NOOP("Wallpapers"), + "xdgdata-apps", I18N_NOOP("XDG Application menu (.desktop files)"), + "xdgdata-dirs", I18N_NOOP("XDG Menu descriptions (.directory files)"), + "xdgconf-menu", I18N_NOOP("XDG Menu layout (.menu files)"), + "tmp", I18N_NOOP("Temporary files (specific for both current host and current user)"), + "socket", I18N_NOOP("UNIX Sockets (specific for both current host and current user)"), + 0, 0 + }; + for (TQStringList::ConstIterator it = types.begin(); it != types.end(); ++it) + { + int index = 0; + while (helptexts[index] && *it != helptexts[index]) { + index += 2; + } + if (helptexts[index]) { + printf("%s - %s\n", helptexts[index], i18n(helptexts[index+1]).local8Bit().data()); + } else { + printf("%s", i18n("%1 - unknown type\n").arg(*it).local8Bit().data()); + } + } + return 0; + } + + TQString type = args->getOption("path"); + if (!type.isEmpty()) + { + printResult(KGlobal::dirs()->resourceDirs(type.latin1()).join(":")); + return 0; + } + + type = args->getOption("userpath"); + if (!type.isEmpty()) + { + if ( type == "desktop" ) + printResult(KGlobalSettings::desktopPath()); + else if ( type == "autostart" ) + printResult(KGlobalSettings::autostartPath()); + else if ( type == "trash" ) + printResult(KGlobalSettings::trashPath()); + else if ( type == "document" ) + printResult(KGlobalSettings::documentPath()); + else + fprintf(stderr, "%s", i18n("%1 - unknown type of userpath\n").arg(type).local8Bit().data() ); + return 0; + } + + type = args->getOption("install"); + if (!type.isEmpty()) + { + const char *installprefixes[] = { + "apps", "@APPS_INSTALL_DIR@", + "config", "@CONFIG_INSTALL_DIR@", + "kcfg", "@KCFG_INSTALL_DIR@", + "data", "@DATA_INSTALL_DIR@", + "exe", "@BIN_INSTALL_DIR@", + "html", "@HTML_INSTALL_DIR@", + "icon", "@ICON_INSTALL_DIR@", + "lib", "@LIB_INSTALL_DIR@", + "module", "@PLUGIN_INSTALL_DIR@", + "qtplugins", "@PLUGIN_INSTALL_DIR@/plugins", + "locale", "@LOCALE_INSTALL_DIR@", + "mime", "@MIME_INSTALL_DIR@", + "services", "@SERVICES_INSTALL_DIR@", + "servicetypes", "@SERVICETYPES_INSTALL_DIR@", + "sound", "@SOUND_INSTALL_DIR@", + "templates", "@TEMPLATES_INSTALL_DIR@", + "wallpaper", "@WALLPAPER_INSTALL_DIR@", + "xdgconf-menu", "@XDG_MENU_INSTALL_DIR@", + "xdgdata-apps", "@XDG_APPS_INSTALL_DIR@", + "xdgdata-dirs", "@XDG_DIRECTORY_INSTALL_DIR@", + "include", "@INCLUDE_INSTALL_DIR@", + 0, 0 + }; + int index = 0; + while (installprefixes[index] && type != installprefixes[index]) { + index += 2; + } + if (installprefixes[index]) { + printResult(expandvars(installprefixes[index+1])); + } else { + printResult("NONE"); // no i18n here as for scripts + } + } + return 0; +} diff --git a/kded/CMakeLists.txt b/kded/CMakeLists.txt index e9e1fd3da..8b660783d 100644 --- a/kded/CMakeLists.txt +++ b/kded/CMakeLists.txt @@ -38,9 +38,9 @@ install( FILES kdedmodule.h DESTINATION ${INCLUDE_INSTALL_DIR} ) ##### other data ################################ -install( FILES kdedmodule.desktop DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) -install( FILES applications.menu DESTINATION ${XDG_MENUDIR} ) -install( FILES kded.upd DESTINATION ${DATA_INSTALL_DIR}/kconf_update ) +install( FILES kdedmodule.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) +install( FILES applications.menu DESTINATION ${XDG_MENU_INSTALL_DIR} ) +install( FILES kded.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) #### kded ####################################### diff --git a/kdeprint/CMakeLists.txt b/kdeprint/CMakeLists.txt index d4c2ed26d..798af8db3 100644 --- a/kdeprint/CMakeLists.txt +++ b/kdeprint/CMakeLists.txt @@ -67,7 +67,7 @@ install( FILES kprintpreviewui.rc DESTINATION ${CONFIG_INSTALL_DIR}/ui ) install( FILES testprint.ps specials.desktop DESTINATION ${DATA_INSTALL_DIR}/kdeprint ) install( FILES kdeprintd.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded ) install( FILES kdeprintrc DESTINATION ${CONFIG_INSTALL_DIR} ) -install( FILES kdeprintrc.upd DESTINATION ${DATA_INSTALL_DIR}/kconf_update ) +install( FILES kdeprintrc.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) ##### driverparse ############################### diff --git a/kdoctools/CMakeLists.txt b/kdoctools/CMakeLists.txt index 7d1b336ba..2d4ff72ab 100644 --- a/kdoctools/CMakeLists.txt +++ b/kdoctools/CMakeLists.txt @@ -35,8 +35,8 @@ link_directories( ##### other data ################################ install( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/checkXML DESTINATION ${BIN_INSTALL_DIR} ) -install( PROGRAMS move_kio_help_cache.sh DESTINATION ${DATA_INSTALL_DIR}/kconf_update ) -install( FILES kio_help.upd DESTINATION ${DATA_INSTALL_DIR}/kconf_update ) +install( PROGRAMS move_kio_help_cache.sh DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) +install( FILES kio_help.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) install( FILES help.protocol ghelp.protocol DESTINATION ${SERVICES_INSTALL_DIR} ) # FIXME why automake version is so complicated? diff --git a/kio/CMakeLists.txt b/kio/CMakeLists.txt index 9be73d93b..1a548e0fc 100644 --- a/kio/CMakeLists.txt +++ b/kio/CMakeLists.txt @@ -38,11 +38,11 @@ install( FILES application.desktop kurifilterplugin.desktop kcomprfilter.desktop kscan.desktop kdatatool.desktop kfileplugin.desktop kcmodule.desktop - DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) + DESTINATION ${SERVICETYPES_INSTALL_DIR} ) -install( FILES kioslave.upd DESTINATION ${DATA_INSTALL_DIR}/kconf_update ) -install( PROGRAMS useragent.pl proxytype.pl DESTINATION ${DATA_INSTALL_DIR}/kconf_update ) -install( FILES renamedlgplugin.desktop DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) +install( FILES kioslave.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) +install( PROGRAMS useragent.pl proxytype.pl DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) +install( FILES renamedlgplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) install( FILES kpasswdserver.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded ) install( FILES data.protocol DESTINATION ${SERVICES_INSTALL_DIR} ) diff --git a/kio/kfile/CMakeLists.txt b/kio/kfile/CMakeLists.txt index b94d12ea0..453654571 100644 --- a/kio/kfile/CMakeLists.txt +++ b/kio/kfile/CMakeLists.txt @@ -51,7 +51,7 @@ install( FILES install( FILES kpropsdlgplugin.desktop - DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) + DESTINATION ${SERVICETYPES_INSTALL_DIR} ) ##### kfile ##################################### diff --git a/kio/kioexec/CMakeLists.txt b/kio/kioexec/CMakeLists.txt index 995141c0d..043f017c6 100644 --- a/kio/kioexec/CMakeLists.txt +++ b/kio/kioexec/CMakeLists.txt @@ -43,7 +43,4 @@ tde_add_executable( ${target} AUTOMOC DESTINATION ${BIN_INSTALL_DIR} ) -# FIXME need a review -# create symlink to kfmexec -file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_kfmexec_symlink.cmake "exec_program(${CMAKE_COMMAND} ARGS -E create_symlink ${target} \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${BIN_INSTALL_DIR}/kfmexec\")\n") -set_target_properties( ${target} PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/make_kfmexec_symlink.cmake) +tde_install_symlink( ${target} ${BIN_INSTALL_DIR}/kfmexec ) diff --git a/kio/misc/CMakeLists.txt b/kio/misc/CMakeLists.txt index 595ac050b..763380167 100644 --- a/kio/misc/CMakeLists.txt +++ b/kio/misc/CMakeLists.txt @@ -99,7 +99,4 @@ tde_add_executable( ${target} DESTINATION ${BIN_INSTALL_DIR} ) -# FIXME need a review -# create symlink to fileshare -file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_filesharelist_symlink.cmake "exec_program(${CMAKE_COMMAND} ARGS -E create_symlink fileshareset \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${BIN_INSTALL_DIR}/filesharelist\")\n") -set_target_properties( ktelnetservice PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/make_filesharelist_symlink.cmake ) +tde_install_symlink( ${target} ${BIN_INSTALL_DIR}/filesharelist ) diff --git a/kioslave/http/kcookiejar/CMakeLists.txt b/kioslave/http/kcookiejar/CMakeLists.txt index 9cd4b17f7..5104c948c 100644 --- a/kioslave/http/kcookiejar/CMakeLists.txt +++ b/kioslave/http/kcookiejar/CMakeLists.txt @@ -32,7 +32,7 @@ link_directories( ##### other data ################################ install( FILES kcookiejar.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded ) -install( FILES kcookiescfg.upd DESTINATION ${DATA_INSTALL_DIR}/kconf_update ) +install( FILES kcookiescfg.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) install( FILES domain_info DESTINATION ${DATA_INSTALL_DIR}/khtml ) diff --git a/kioslave/iso/CMakeLists.txt b/kioslave/iso/CMakeLists.txt index 2b7f57071..faa540221 100644 --- a/kioslave/iso/CMakeLists.txt +++ b/kioslave/iso/CMakeLists.txt @@ -36,7 +36,7 @@ link_directories( install( FILES iso.protocol DESTINATION ${SERVICES_INSTALL_DIR} ) install( FILES isoservice.desktop DESTINATION ${DATA_INSTALL_DIR}/konqueror/servicemenus ) install( FILES kio_isorc DESTINATION ${CONFIG_INSTALL_DIR} ) -install( FILES kio_iso.desktop DESTINATION ${SHARE_INSTALL_DIR}/applnk ) +install( FILES kio_iso.desktop DESTINATION ${APPS_INSTALL_DIR} ) ##### kio_iso ################################### diff --git a/kparts/CMakeLists.txt b/kparts/CMakeLists.txt index e1fecef53..2e8fa2252 100644 --- a/kparts/CMakeLists.txt +++ b/kparts/CMakeLists.txt @@ -17,7 +17,6 @@ include_directories( ${TQT_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR} - #${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR}/kdecore ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/dcop @@ -47,7 +46,7 @@ install( FILES install( FILES kpart.desktop krop.desktop krwp.desktop browserview.desktop - DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) + DESTINATION ${SERVICETYPES_INSTALL_DIR} ) #### kparts ##################################### diff --git a/kresources/CMakeLists.txt b/kresources/CMakeLists.txt index 7e3e98313..213cb7efc 100644 --- a/kresources/CMakeLists.txt +++ b/kresources/CMakeLists.txt @@ -42,10 +42,10 @@ install( FILES ##### other data ################################ -install( FILES kresources_plugin.desktop kresources_manager.desktop DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) +install( FILES kresources_plugin.desktop kresources_manager.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) # FIXME what is xdg_apps_DATA = kresources.desktop -install( FILES kresources.desktop DESTINATION ${SHARE_INSTALL_DIR}/applications/kde ) +install( FILES kresources.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) ##### kresources ################################ diff --git a/kspell2/CMakeLists.txt b/kspell2/CMakeLists.txt index ac2df9720..29b45aba9 100644 --- a/kspell2/CMakeLists.txt +++ b/kspell2/CMakeLists.txt @@ -44,7 +44,7 @@ install( FILES ##### other data ################################ -install( FILES kspellclient.desktop DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) +install( FILES kspellclient.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) #### kspell2base ################################ diff --git a/kutils/CMakeLists.txt b/kutils/CMakeLists.txt index adf1a6631..4ea95455f 100644 --- a/kutils/CMakeLists.txt +++ b/kutils/CMakeLists.txt @@ -45,7 +45,7 @@ install( FILES ##### other data ################################ -install( FILES kplugininfo.desktop DESTINATION ${SHARE_INSTALL_DIR}/servicetypes ) +install( FILES kplugininfo.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) #### kutils ##################################### diff --git a/pics/CMakeLists.txt b/pics/CMakeLists.txt index 5aacdb482..e8955da34 100644 --- a/pics/CMakeLists.txt +++ b/pics/CMakeLists.txt @@ -37,7 +37,7 @@ link_directories( ##### other data ################################ -tde_install_symlink( crystalsvg ${SHARE_INSTALL_DIR}/icons/default.kde ) +tde_install_symlink( crystalsvg ${ICON_INSTALL_DIR}/default.kde ) ##### ksvgtopng ################################# diff --git a/pics/crystalsvg/CMakeLists.txt b/pics/crystalsvg/CMakeLists.txt index 04c9d81fc..9db5eada7 100644 --- a/pics/crystalsvg/CMakeLists.txt +++ b/pics/crystalsvg/CMakeLists.txt @@ -11,5 +11,5 @@ # FIXME generating png icons are not implemented -install( FILES index.theme DESTINATION ${ICONS_INSTALL_DIR}/crystalsvg ) +install( FILES index.theme DESTINATION ${ICON_INSTALL_DIR}/crystalsvg ) tde_install_icons( ) diff --git a/pics/emoticons/CMakeLists.txt b/pics/emoticons/CMakeLists.txt index 6dbb77b23..86d7adb18 100644 --- a/pics/emoticons/CMakeLists.txt +++ b/pics/emoticons/CMakeLists.txt @@ -21,4 +21,4 @@ install( FILES teeth.png thumbs_down.png thumbs_up.png tongue.png unhappy.png unlove.png wilted_rose.png wink.png foot_in_mouth.png innocent.png undecided.png - DESTINATION ${SHARE_INSTALL_DIR}/emoticons/Default ) + DESTINATION ${SHARE_INSTALL_PREFIX}/emoticons/Default ) diff --git a/pics/hicolor/CMakeLists.txt b/pics/hicolor/CMakeLists.txt index 5998fe2a8..79a569a66 100644 --- a/pics/hicolor/CMakeLists.txt +++ b/pics/hicolor/CMakeLists.txt @@ -9,4 +9,4 @@ # ################################################# -install( FILES index.theme DESTINATION ${ICONS_INSTALL_DIR}/hicolor ) +install( FILES index.theme DESTINATION ${ICON_INSTALL_DIR}/hicolor ) -- cgit v1.2.1