installing libs on Windows

Andreas Pakulat apaku at gmx.de
Mon Jul 23 09:53:35 BST 2007


On 22.07.07 20:13:37, Alexander Neundorf wrote:
> On Sunday 22 July 2007 11:33, Alex Merry wrote:
> > On Saturday 21 Jul 2007, Alexander Neundorf wrote:
> > > It is then also possible to install libs and executables with one
> > > command: INSTALL(TARGETS kdecore  kde4-config
> > >                              LIBRARY DESTINATION ${LIB_INSTALL_DIR}
> > >                              RUNTIME DESTINATION ${BIN_INSTALL_DIR}
> > >                              ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
> >
> > Is there a chance that there could be a macro that does this, so we just
> > have something like kde4_install(kdecore kde4-config)?
> 
> This should also work:
> 
> INSTALL(TARGETS kdecore
>                             DESTINATION ${LIB_INSTALL_DIR}
>                             ARCHIVE DESTINATION ${STATLIB_INSTALL_DIR})
> 
> 
> Then we can set LIB_INSTALL_DIR to bin/ on Windows, and introduce a new 
> STATLIB_INSTALL_DIR. If somebody forgets this second part, the only problem 
> will be that the lib file will end up in bin/ instead of lib, but I think 
> this is not a real problem.

You're confused I think. I can't tell how msvc handles this but for
mingw we have:

.exe == executable program
.dll == shared library
.lib == import library for the corresponding dll, this is needed to link
against the dll
.a   == static library

So We still need the 3-line version as dll+exe go into bin/ and
static+import lib go into lib/

> IMO it would be nice if the same project without any modifications would also 
> work under Windows, which among others means that the dlls should be found in 
> the lib/ directory. 

See above, thats exactly not right, if dll's are in lib/ users have to
change their PATH.

> Is there a problem with adjusting the PATH when installing KDE on Windows ? 

As Ralf already said: It increases startup time and it pollutes PATH. It
surely can be done by the kdewin-installer, but that doesn't take care
of those trying to build kde4 from sources. While the above
cmake-install takes care of doing everything right.

> Can something be done using the registry ?
> Does this help us ?
> http://www.codeguru.com/Cpp/W-P/dll/article.php/c99#more
> 
> If a user downloads and installs KDE4/ a KDE4 application on Windows (e.g. 
> kdevelop), will this have the development stuff, i.e. the .lib files and the 
> headers ?
> If not, then for developing it could be a requirement to adjust the PATH, when 
> building a package, LIB_INSTALL_DIR can be set to bin/, so that it will just 
> work for users. That's possible right now without any modifications.

Except that then developers get a pretty screwed directory layout, files
are then not where they should be (lib-files inside bin/ same for static
libs) and all FindXXX macros have to be adjusted as they don't include
the bin/ dir when searching for libraries.

Andreas

-- 
Don't you wish you had more energy... or less ambition?




More information about the kde-core-devel mailing list