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

List:       kde-core-devel
Subject:    AW: installing libs on Windows
From:       "Nhuh Put" <nhuh.put () web ! de>
Date:       2007-07-21 3:18:00
Message-ID: 00aa01c7cb45$bee77410$3301a8c0 () spika
[Download RAW message or body]

Hello
The install destination should be changed only for libraries, which are
loaded at application initialisation, not for libraries which are loaded
with QLibrary or KLibLoader.
I would rather add a new macro for this, as the longer install syntax is
easily forgotten (see the patch in the attachment).
There is also a new option in the new cmake version, but I didn't find any
documentation about it.

	PutHuhn

-----Ursprüngliche Nachricht-----
Von: Alexander Neundorf
Gesendet: Samstag, 21. Juli 2007 04:55
Betreff: installing libs on Windows

Hi,

on Windows there is no RPATH, so the only way for executables to find their 
dlls (e.g. kdecore.dll) is that either 
A) the dlls are in the same directory as the executable, or 
B) the directory where the dlls are is in the PATH.

In KDE4 we currently do:
INSTALL(TARGETS kdecore DESTINATION ${LIB_INSTALL_DIR})
This means we rely on option B).

We could do the following:
INSTALL(TARGETS kdecore 
                             LIBRARY DESTINATION ${LIB_INSTALL_DIR}
                             RUNTIME DESTINATION ${BIN_INSTALL_DIR}
                             ARCHIVE DESTINATION ${LIB_INSTALL_DIR})

This will install the .so and .dylib files to LIB_INSTALL_DIR ("LIBRARY"), 
the .dll files and executables to BIN_INSTALL_DIR ("RUNTIME") and the .lib 
and .a files also to LIB_INSTALL_DIR ("ARCHIVE").

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})

The Windows developers would prefer this, the executables will be able to
run 
without changing the PATH. How will the executables actually be installed ? 
Via an installer which can also adjust the PATH maybe ?

Anyway, this would mean that this full syntax has to be used for every 
installed library, otherwise it won't work on Windows.
As it is now, it's a bit harder for the Windows guys but safes the average 
Linux KDE hacker from thinking about Windows and he can just do 
INSTALL(TARGETS mylib DESTINATION lib)
(of course LIB_INSTALL_DIR is better but in most cases it's just the same 
result) and it will still work on Windows (if the system is already able to 
run any KDE app).

So, are their objections against using the full INSTALL() syntax everywhere
?

Bye
Alex



["windows_bin2.patch" (application/octet-stream)]

Index: modules/FindKDE4Internal.cmake
===================================================================
--- modules/FindKDE4Internal.cmake	(revision 687968)
+++ modules/FindKDE4Internal.cmake	(working copy)
@@ -193,6 +193,11 @@
 # KDE4_INSTALL_HANDBOOK()
 #   Install the handbook documentation
 #
+# KDE4_INSTALL_LIBRARY( lib )
+#   Installs lib into LIB_INSTALL_DIR. Use this for libraries, wich are expected to get automatically
+#   linked in on application start.
+#   This macro takes care to install dlls into BIN_INSTALL_DIR on the Windows platform.
+#
 # KDE4_CREATE_HTML_HANDBOOK( docbookfile )
 #   Create HTML version of the handbook from the docbookfile (using meinproc)
 #
Index: modules/KDE4Macros.cmake
===================================================================
--- modules/KDE4Macros.cmake	(revision 687968)
+++ modules/KDE4Macros.cmake	(working copy)
@@ -884,3 +884,12 @@
     install_xdg_mimetypes(${CMAKE_INSTALL_PREFIX} ${ARGN})
 
 endmacro (KDE4_INSTALL_XDG_MIMETYPES)
+
+macro (KDE4_INSTALL_LIBRARY _lib)
+    install(TARGETS ${_lib}
+             RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+             LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+             ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+    )
+endmacro(KDE4_INSTALL_LIBRARY)
+


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

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