On Thursday 14 February 2008, Alexander Neundorf wrote:
> Hi,
>
> On Thursday 14 February 2008, Christian Ehrlicher wrote:
> > Hi,
> >
> > following the discussion in 'Re: Getting rid of the LIB_INSTALL_DIR hack
> > on windows' (http://lists.kde.org/?t=120015619300001&r=1&w=2) I created
> > a patch which introduces a new var KDE4_LIB_DESTINATION.
...
> Next option:
> We could also add
> set(INSTALL_TARGET_DEFAULT_ARGUMENTS RUNTIME DESTINATION bin COMPONENT User
>                                      LIBRARY DESTINATION lib COMPONENT User
>                                      ARCHIVE DESTINATION lib COMPONENT
> Devel )
>
> and then do
> install(TARGETS konsole kdecore kdeui ${INSTALL_TARGETS_DEFAULT_ARGUMENTS})
>
> Later on this could be extended once we require (or can optionally use, not
> sure about that) CMake 2.6 which supports library frameworks on OSX, they
> need even more locations.

I think I prefer this option. It works with cmake 2.4.5 and we will be able to 
extend it later on. It kind of slightly breaks source compatibility on 
Windows, but since we don't have an official release there this is no 
problem.
A patch for this is attached. If we agree on this, I'd prefer if one of the 
windows developers could apply it, after he made sure installing works 
correctly on his system.

Comments ?

Alex
Index: FindKDE4Internal.cmake
===================================================================
--- FindKDE4Internal.cmake	(revision 775564)
+++ FindKDE4Internal.cmake	(working copy)
@@ -489,14 +489,7 @@
 if (WIN32)
 # use relative install prefix to avoid hardcoded install paths in cmake_install.cmake files
 
-# ok, this is more like a hack to get dll's installed into the same directory as the executables
-# without having to use the full syntax of INSTALL(TARGETS ...) everywhere. 
-# LIB_INSTALL_DIR is set to a list of arguments, the first being the "default" destination
-# which is then overridden by the following three specialized destinations
-   set(LIB_INSTALL_DIR      "lib${LIB_SUFFIX}"
-                            RUNTIME DESTINATION "bin"
-                            LIBRARY DESTINATION "lib${LIB_SUFFIX}"
-                            ARCHIVE DESTINATION "lib${LIB_SUFFIX}"  ) # The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})
+   set(LIB_INSTALL_DIR      "lib${LIB_SUFFIX}" )            # The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})
 
    set(EXEC_INSTALL_PREFIX  "" )        # Base directory for executables and libraries
    set(SHARE_INSTALL_PREFIX "share" )   # Base directory for files which go to share/
@@ -602,6 +595,31 @@
 endif (WIN32)
 
 
+# The INSTALL_TARGETS_DEFAULT_ARGS variable should be used when libraries are installed.
+# The arguments are also ok for regular executables, i.e. executables which don't go
+# into sbin/ or libexec/, but for installing executables the basic syntax 
+# INSTALL(TARGETS kate DESTINATION "${BIN_INSTALL_DIR}")
+# is enough, so using this variable there doesn't help a lot.
+# The variable must not be used for installing plugins.
+# Usage is like this:
+#    install(TARGETS kdecore kdeui ${INSTALL_TARGETS_DEFAULT_ARGS} )
+#
+# This will install libraries correctly under UNIX, OSX and Windows (i.e. dll's go
+# into bin/.
+# Later on it will be possible to extend this for installing OSX frameworks
+# The COMPONENT Devel argument has the effect that static libraries belong to the 
+# "Devel" install component. If we use this also for all install() commands
+# for header files, it will be possible to install
+#   -everything: make install OR cmake -P cmake_install.cmake
+#   -only the development files: cmake -DCOMPONENT=Devel -P cmake_install.cmake
+#   -everything except the development files: cmake -DCOMPONENT=Unspecified -P cmake_install.cmake
+# This can then also be used for packaging with cpack.
+
+set(INSTALL_TARGETS_DEFAULT_ARGS  RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
+                                  LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
+                                  ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" COMPONENT Devel )
+
+
 ##############  add some more default search paths  ###############
 # always search in the directory where cmake is installed 
 # and in the current installation prefix
_______________________________________________
Kde-buildsystem mailing list
Kde-buildsystem@kde.org
https://mail.kde.org/mailman/listinfo/kde-buildsystem

Reply via email to