[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-buildsystem
Subject:    Re: Setting paths which depend on CMAKE_INSTALL_PREFIX
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2009-06-05 6:46:27
Message-ID: 20090605064627.GA6105 () trinity ! apaku ! dnsalias ! org
[Download RAW message or body]

On 04.06.09 23:49:14, David Jarvie wrote:
> I'm creating a separate package for KAlarm, and want to default its 
> installation path to the KDE installation directory. In CMakeLists.txt I've 
> got:
> 
> find_package(KDE4 4.1.0 REQUIRED)
> if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>    set(CMAKE_INSTALL_PREFIX "${KDE4_INSTALL_DIR}" CACHE PATH "Install prefix")
> endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
> 
> According to what I've read on this mailing list, this ought to set all the 
> other KDE install paths used by cmake to use the new value of 
> CMAKE_INSTALL_PREFIX also. However, it actually installs into /usr/local 
> instead (which is not where my KDE is installed). I seem to have to add the 
> following definitions (copied from FindKDE4Internal.cmake with appropriate 
> amendments) after the 'set' above to make it work:
> 
> set(EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Base directory 
> for executables and libraries")
> #   set(BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" CACHE PATH "The install 
> dir for executables")
> #   set(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH 
> "The subdirectory relative to the install prefix where libraries will be 
> installed")
> ...etc.
> 
> Is there any way to set all the install paths to use the new definition of 
> CMAKE_INSTALL_PREFIX automatically, without having to define each one like 
> this?

No, because they're set in FindKDE4Internal.cmake, which is run by the
find_package(KDE4) call. So you'd have to set CMAKE_INSTALL_PREFIX
before doing the find_package, but of course you don't know the kde
install prefix.

However I don't think defaulting to the kde install prefix is a good
idea, because then people with kde4 packages from their distro and
running cmake .. in the builddir for kalarm will screw their /usr
directory. /usr belongs to the distribution and self-compiled apps
are not supposed to install anything there. Thats also why cmake and
other buildtools default to /usr/local and not /usr.

Andreas
 
-- 
You two ought to be more careful--your love could drag on for years and years.
_______________________________________________
Kde-buildsystem mailing list
Kde-buildsystem@kde.org
https://mail.kde.org/mailman/listinfo/kde-buildsystem
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic