Alexander Neundorf neundorf at kde.org
Wed Sep 6 22:34:00 CEST 2006

On Wednesday 06 September 2006 20:07, Alexander Neundorf wrote:
> On Wednesday 06 September 2006 11:16, Volker Krause wrote:
> > On Tuesday 05 September 2006 23:10, Alexander Neundorf wrote:
> > > Hi Volker,
> > >
> > > On Tuesday 05 September 2006 09:50, Volker Krause wrote:
> > > > On Monday 04 September 2006 23:32, Alexander Neundorf wrote:
> > > > > SVN commit 580957 by neundorf:
> > > > >
> > > > > Remove the FORCE keyword from the various install directories,
> > > > > which we added in Trysil. By now it should be correct in
> > > > > everybodies cache, and without the FORCE it can now even be edited
> > > > > again.
> > > > >
> > > > > Let me know if suddenly some things aren't installed correctly
> > > > > anymore for you.
> > > >
> > > > There is one problem with this: If you now change the install prefix
> > > > all those variables aren't updated, ie. they still point to the
> > > > previous install prefix. That's why we re-added the FORCE option for
> > > > LIB_INSTALL_DIR and added an extra LIB_SUFFIX setting.
> > >
> > > I tested the behaviour with the attached file, just put it in an empty
> > > directory and run cmake on it.
> > > I specified a different LIB_SUFFIX and all depending variables changed
> > > as expected, both when using ccmake and when using cmake
> > > -DLIB_SUFFIX...
> > >
> > > It is a direct copy from the stuff in FindKDE4Internal.cmake.
> > > Can you please test and let me know which issues you have with this ?
> >
> > Well, this obviously works since the FORCE options are there. Here is an
> > simple example to demonstrate the problem without FORCE:
> Ooops, I was *so* sure that I removed them all.
> Very strange.
> Ok I'll have another look

Ok, now is attached what I actually wanted to attach.
If FORCE is used, then the "calculations" are done everytime and the results 
go into the cache.
This has the effect that if you set LIB_SUFFIX to something, it ends up in 
But it has also the effect that changing e.g. EXEC_INSTALL_PREFIX is not 
You can set it to /foo/bar/weirdo/ in ccmake, but after configuring it is set 
back to CMAKE_INSTALL_PREFIX -> due to the force. And since LIB_INSTALL_DIR, 
BIN_INSTALL_DIR etc. use EXEC_INSTALL_PREFIX, they are also set back to 

Without FORCE chaning LIB_SUFFIX in ccmake changes nothing, because the new 
value of LIB_SUFFIX isn't FORCEd into the other variables. 
But now you are able to edit all the install locations you want and set them 
as you want.
But if you run cmake the first time (i.e. with no CMakeCache.txt) like this:
cmake <dir> -DLIB_SUFFIX:STRING=64
then you get the behaviour you actually want.

Yet another option would be to use

Then you can edit LIB_SUFFIX and EXEC_INSTALL_PREFIX later on and 
LIB_INSTALL_DIR will reflect the changes (since now it doesn't come from the 
But in this case you are not able to change LIB_INSTALL_DIR to arbitrary 
locations (as it is possible with CACHE and no FORCE). I expect that then 
there will also be people which will complain.

So to make it short:
as it is now:
specifiy LIB_SUFFIX when running cmake the first time
after that edit every install location as you want 

Is that ok for you ?

Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net
-------------- next part --------------
#add some KDE specific stuff
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
set(SHARE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/share CACHE PATH "Base directory for files which go to share/")
set(EXEC_INSTALL_PREFIX  ${CMAKE_INSTALL_PREFIX}       CACHE PATH  "Base directory for executables and libraries")
## the following are directories where stuff will be installed to
set(BIN_INSTALL_DIR          "${EXEC_INSTALL_PREFIX}/bin"                  CACHE PATH "The kde info install dir (default prefix/info)")
set(SBIN_INSTALL_DIR         "${EXEC_INSTALL_PREFIX}/sbin"                 CACHE PATH "The kde info install dir (default prefix/info)")
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})")
set(LIBEXEC_INSTALL_DIR      "${LIB_INSTALL_DIR}/kde4/libexec"             CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib/kde4/libexec)")
set(PLUGIN_INSTALL_DIR       "${LIB_INSTALL_DIR}/kde4"                     CACHE PATH "The subdirectory relative to the install prefix where plugins will be installed (default is ${KDE4_LIB_INSTALL_DIR}/kde4)")
set(INCLUDE_INSTALL_DIR      "${CMAKE_INSTALL_PREFIX}/include"             CACHE PATH "The subdirectory to the header prefix")
set(CONFIG_INSTALL_DIR       "${SHARE_INSTALL_PREFIX}/config"              CACHE PATH "The config file install dir")
set(DATA_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/apps"                CACHE PATH "The parent directory where applications can install their data")
set(HTML_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/doc/HTML"            CACHE PATH "The HTML install dir for documentation")
set(ICON_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/icons"               CACHE PATH "The icon install dir (default prefix/share/icons/)")
set(KCFG_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/config.kcfg"         CACHE PATH "The install dir for kconfig files")
set(LOCALE_INSTALL_DIR       "${SHARE_INSTALL_PREFIX}/locale"              CACHE PATH "The install dir for translations")
set(MIME_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/mimelnk"             CACHE PATH "The install dir for the mimetype desktop files")
set(SERVICES_INSTALL_DIR     "${SHARE_INSTALL_PREFIX}/services"            CACHE PATH "The install dir for service (desktop, protocol, ...) files")
set(SERVICETYPES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/servicetypes"        CACHE PATH "The install dir for servicestypes desktop files")
set(SOUND_INSTALL_DIR        "${SHARE_INSTALL_PREFIX}/sounds"              CACHE PATH "The install dir for sound files")
set(TEMPLATES_INSTALL_DIR    "${SHARE_INSTALL_PREFIX}/templates"           CACHE PATH "The install dir for templates (Create new file...)")
set(WALLPAPER_INSTALL_DIR    "${SHARE_INSTALL_PREFIX}/wallpapers"          CACHE PATH "The install dir for wallpapers")
set(KCONF_UPDATE_INSTALL_DIR "${DATA_INSTALL_DIR}/kconf_update"            CACHE PATH "The kconf_update install dir")
# this one shouldn't be used anymore
set(APPLNK_INSTALL_DIR       "${SHARE_INSTALL_PREFIX}/applnk"              CACHE PATH "Is this still used ?")
set(AUTOSTART_INSTALL_DIR    "${SHARE_INSTALL_PREFIX}/autostart"           CACHE PATH "The install dir for autostart files")

set(XDG_APPS_DIR             "${SHARE_INSTALL_PREFIX}/applications/kde"    CACHE PATH "The XDG apps dir")
set(XDG_DIRECTORY_DIR        "${SHARE_INSTALL_PREFIX}/desktop-directories" CACHE PATH "The XDG directory")

set(SYSCONF_INSTALL_DIR      "${CMAKE_INSTALL_PREFIX}/etc"                 CACHE PATH "The kde sysconfig install dir (default /etc)")
set(MAN_INSTALL_DIR          "${CMAKE_INSTALL_PREFIX}/man"                 CACHE PATH "The kde man install dir (default prefix/man/)")
set(INFO_INSTALL_DIR         "${CMAKE_INSTALL_PREFIX}/info"                CACHE PATH "The kde info install dir (default prefix/info)")

message(STATUS "suffix: ${LIB_SUFFIX}")
message(STATUS "exec pref ${EXEC_INSTALL_PREFIX}")
message(STATUS "bin: ${BIN_INSTALL_DIR}")
message(STATUS "sbin: ${SBIN_INSTALL_DIR}")
message(STATUS "lib: ${LIB_INSTALL_DIR}")
message(STATUS "libexec: ${LIBEXEC_INSTALL_DIR}")
message(STATUS "plugin: ${PLUGIN_INSTALL_DIR}")

More information about the Kde-buildsystem mailing list