installing libs on Windows

Andreas Pakulat apaku at gmx.de
Tue Jul 24 09:45:17 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.

Ok, thats fine with me (now that I understand what ARCHIVE means).

> So if somebody with only cmake and Linux knowledge writes library and a small 
> kde4 app:
> 
> add_library(mylib foo.cpp)
> install(TARGETS mylib DESTINATION lib)
> 
> find_package(KDE4 REQUIRED)
> include_directories(${KDE4_INCLUDES})
> 
> set(kfooSrcs main.cpp mywidget.cpp)
> qt4_wrap_cpp(kfooSrcs mywidget.h)
> add_executable(kfoo ${kfooSrcs})
> target_link_libraries(kfoo foo ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS})
> install(TARGETS kfoo DESTINATION bin )
> 
> This will work, no special KDE4 macros required.
> (it won't have automatic RPATH handling, fancy install dirs, automoc, enable 
> final, but it will work without problems).
> 
> 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. 

IMHO all this should be handled by CMake automatically. I mean I'm with
you that it should work without further changes required on windows. But
that would require CMake to be bit more intelligent and install dll's
into bin/ automatically (allowing an override via the full-blown
syntax). I don't quite understand why CMake doesn't handle this properly
already - isn't it supposed to help with cross-platform issues?

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

Its a bit of a nuisance especially for new developers..

> Can something be done using the registry ?
> Does this help us ?
> http://www.codeguru.com/Cpp/W-P/dll/article.php/c99#more

Ralf, how hard is it to change the registry inside kdewin-installer?
That article sounds promising and would even work if we're installing
shortcuts into the menu or on the desktop.

> 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 ?

No, lib (i.e. headers and import lib) are separated from bin in the
packages.

> 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.

As Ralf already said, taking your example above without modifications
except that LIB_INSTALL_DIR will be set to bin/ on win32 it would
pollute the bin/ dir with the import and static libraries and also make
it harder to package those development parts because the current
packaging tool just zips up a list of files from a certain directory
without changing their position under that directory (i.e. moving from
one subdir to another). 

So I think we should rather leave cmake-stuff as it is and see that we
go with the registry-thing. (Unless of course thats a problem)

Andreas

-- 
You will be awarded a medal for disregarding safety in saving someone.




More information about the kde-core-devel mailing list