installing libs on Windows

Alexander Neundorf neundorf at kde.org
Mon Jul 23 01:13:37 BST 2007


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.

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. 
Is there a problem with adjusting the PATH when installing KDE on Windows ? 
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.

Bye
Alex




More information about the kde-core-devel mailing list