cmake problem on win32
Ralf Habacker
ralf.habacker at freenet.de
Thu Oct 23 06:35:11 CEST 2008
Alexander Neundorf schrieb:
> On Wednesday 22 October 2008, Christian Ehrlicher wrote:
>
>> Andreas Pakulat schrieb:
>>
>>> On 21.10.08 22:48:39, Andreas Pakulat wrote:
>>>
>>>> Hi,
>>>>
>>>> I've got a small problem here with using INCLUDE_INSTALL_DIR during
>>>> cmake time. It seems as if that variable is set to "include" instead of
>>>> an absolute path. This causes a problem with kdevplatform, because that
>>>> variable is used to write a KDevPlatformConfig.cmake with the right
>>>> include-dir.
>>>>
>>>> This file now ends up with
>>>>
>>>> set(KDevPlatform_INCLUDE_DIR "include/kdevplatform")
>>>>
>>>> which of course doesn't work.
>>>>
>>>> Everything is fine on linux, it only breaks on windows.
>>>>
>>>> KDevPlatformConfig.cmake.in looks like this:
>>>>
>>>> set(KDevPlatform_INCLUDE_DIR "@INCLUDE_INSTALL_DIR@/kdevplatform")
>>>>
>
>
>
>>> Apparently the reason is FindKDE4Internal.cmake. On Win32 it sets the
>>> variable to just "include", while on other platforms it also prepends
>>> CMAKE_INSTALL_PREFIX. This seems to happen for all other variables set
>>> there as well, is this intentional? Can it be changed to be the same on
>>> all platforms? I'd like to avoid the extra check in KDevPlatform if
>>> possible.
>>>
>> Where does INCLUDE_INSTALL_DIR come from? You can't know where the user
>> installs your app in the end so using INCLUDE_INSTALL_DIR on windows
>> isn't a good idea at all.
>>
>
> Yes.
> The FOO_INSTALL_DIR variables are the install destination of the current
> project, they don't have to match with anything else already installed.
>
> KDE4_LIB_DIR and KDE4_INCLUDE_DIR are the locations where kdelibs has been
> installed to and are determined by FindKDE4Internal.cmake (FOO_INSTALL_DIR
> are just initialized by FindKDE4Internal.cmake, (basically) independent from
> any already installed things).
>
> So the code above is actually correct (except the relative directory).
> For a project _using_ KDevPlatform KDevPlatform_INCLUDE_DIR will be what
> INCLUDE_INSTALL_DIR was while building KDevPlatform.
>
> On Windows FOO_INSTALL_DIR are relative directories because of what Christian
> said, the user can install them anywhere. I think it was Ralph who was
> working on this.
> Have a look at kdelibs/CreateKDELibsDependenciesFile.cmake.
> There is a macro MAKE_INSTALL_PATH_ABSOLUTE(), which converts relative paths
> to absolute ones. Not really. it prefixes them with the _variable_
> KDE4_INSTALL_DIR (note that the $ is escaped). Then KDE4_INSTALL_DIR is set
> like this:
> if (NOT KDE4_INSTALL_DIR)
> set(KDE4_INSTALL_DIR \"${CMAKE_INSTALL_PREFIX}\")
> endif (NOT KDE4_INSTALL_DIR)
>
> I.e. the install locations are still somewhat flexible (but it doesn't seem
> completely finished yet).
>
what do you think is required to finish it completly ? - I remember the
most annoying problem in this area was that export_library_dependencies
wrotes absolute pathes and was not able to create variable based
dependencies. Second it was impossible to patch the output from
export_library_dependencies at configure time to make those dependencies
variable by hand.
Ralf
More information about the Kde-windows
mailing list