[CMake] cmake 2.4.2 vs cmake 2.2.3

Vikas Kumar vikasnkumar at users.sourceforge.net
Mon Jun 19 16:36:55 EDT 2006


I agree.
But even though I do not set the install prefix with a trailing "/",
the leading slash becomes necessary.  That REGEX expression is
generated anyway, and the fault is not with the REGEX expression.  The
fault is with the fact that I need to add a leading slash if i use a
cmakelists.txt file from cmake-2.2.3 and am using INSTALL_TARGETS().

So INSTALL_FILES() and INSTALL_TARGETS() is not exactly backward
compatible in cmake-2.4.2 in the way it works for cmake-2.2.3.

Vikas
On 6/19/06, Brad King <brad.king at kitware.com> wrote:
> Vikas Kumar wrote:
> > Hi
> > There is a difference in the way these two versions handle the
> > installation part.
> > Here is the snippet from the cmake_install.cmake file generated with
> > cmake-2.4.2.
> >
> > IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
> >  SET(CMAKE_INSTALL_PREFIX "/home/vikas/installer/")
> > ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
> > STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX
> > "${CMAKE_INSTALL_PREFIX}")
> >
> >
> > Why is the REGEX part replacing the last '/' character ? It is
> > automatically generated by Cmake, so how do I prevent cmake from
> > generating it ?
> > This results in creation of directories named installerbin,
> > installerlib instead of installer/bin and installer/lib. The above
> > code worked fine in cmake-2.2.3
>
> The install prefix should never have been set with a trailing slash.
> Your install rules should use leading slashes if you are using
> INSTALL_TARGETS, INSTALL_FILES, or INSTALL_PROGRAMS.  If you switch to
> using the INSTALL command in 2.4.2 (not compatible with 2.2 though),
> then you do not need a leading slash.
>
> -Brad
>


More information about the CMake mailing list