[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pftools: CMAKE_INSTALL_PREFIX resolves *sometimes* to /usr instead of $(CURDIR)/debian/$package/usr



Hi,

Andreas Tille kirjoitti 17.12.2020 klo 17.25:
> Hi,
> 
> I'm working on pftools in git[1].  The package builds and the build time
> tests are passing.  However, in the install step the variable
> CMAKE_INSTALL_PREFIX in [2] simply seems to resolve to /usr, since I get
> 
> ...
> -- Installing: /build/pftools-3.2.6/debian/pftools/usr/share/examples/all.prf
> -- Installing: /build/pftools-3.2.6/debian/pftools/usr/share/examples/score.lis
> find: '/usr/share/examples/': No such file or directory

> 
> At other places the variable seems to resolve properly, thought.
> 
> Any idea what might be wrong at this specific line(s) (the next two
> lines in this CMakeLists.txt are the same)?

They do not take DESTDIR into account. They should, because the built-in
cmake function install() does.

Note that
- ${CMAKE_INSTALL_PREFIX}           is /usr
- ${DESTDIR}${CMAKE_INSTALL_PREFIX} is /build/pftools-3.2.6/debian/pftools/usr

Links to documentation.
https://cmake.org/cmake/help/latest/envvar/DESTDIR.html
https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html
https://cmake.org/cmake/help/latest/command/install.html

> Kind regards
> 
>       Andreas.
> 
> [1] https://salsa.debian.org/med-team/pftools
> [2] https://salsa.debian.org/med-team/pftools/-/blob/master/tests/CMakeLists.txt#L49

--
Juhani


Reply to: