[CMake] Fwd: CPACK/NSIS: Subfolders/components related generation issue

Eric Noulard eric.noulard at gmail.com
Tue Jul 26 16:11:53 EDT 2011


2011/7/26 Laszlo Papp <lpapp at kde.org>:
> Hi,
>
> I am trying to make our cpack setup work for an NSIS installer. I
> would like to make a very first step towards a component based
> installer on Windows.

Do you get component installer with other CPack generators or not?
RPM or DEB on Linux (with at least CMake 2.8.4 and better CMake 2.8.5) ?

What happen with  ZIP or TGZ on Windows and/or Linux?

By the way which version of CMake/CPack are you using?

I did take the time to git clone gluon a give the compilation a try
on my Linux box (with CMake/CPack 2.8.5):


The trouble is you are using ABSOLUTE INSTALL PATH

like in:

install(	
    TARGETS GluonCore
    RUNTIME DESTINATION bin
    LIBRARY DESTINATION ${LIB_INSTALL_DIR}
    ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
    FRAMEWORK DESTINATION ${LIB_INSTALL_DIR}
)

which seems to be set like:
set(LIB_INSTALL_DIR     ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} CACHE
INTERNAL "The subdirectory relative to the install prefix where
libraries will be installed.")

This is the culprit,
you do not need the "${CMAKE_INSTALL_PREFIX}" part
try to drop it (for every xxx_INSTALL_DIR)

ABSOLUTE install path do not play well with component install because
component install needs DESTDIR to work.

Thus ABSOLUTE install path breaks CPack component unless you set
CPACK_SET_DESTDIR to ON
but even with that you won't get what you want.

ABSOLUTE install path breaks the building of RPM relocatable package.

ABSOLUTE install path makes you sometimes do real-install when you believe
you are creating a package: i.e. the package is almost empty and the missing
files are installed on the system at their absolute path. You discover
this issue
only when you don't have the right to create file at the ABSOLUTE DESTINATION.

The only case where ABSOLUTE path may be used is for things like
installing files in /etc on linux or something similar, and I'm not
sure this is already
playing well with component.
etc...

So the solution begins with DOT NOT USE ABSOLUTE INSTALL PATH,
give it a try and tell us how it goes.


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list