On 2013-01-07 16:14-0700 Orion Poplawski wrote:

> On 01/07/2013 12:57 PM, Alan W. Irwin wrote:
>> To Andrew and Orion:
>> 
>> One of my testers for ephcom is David Howells who works as a developer
>> for RedHat.  He found that rpm's for ephcom that he implemented could
>> not be built without using DESTDIR for all install(CODE logic in the
>> ephcom build system.  For example ephcom's doc/CMakeLists.txt file now
>> has this code fragment (which was originally copied without DESTDIR
>> from doc/CMakeLists.txt in PLplot).
>> 
>> doc/CMakeLists.txt:  install(CODE "message(STATUS \"Installing:
>> ${DOC_DIR}/doxygen/html tree\")\nexecute_process(COMMAND
>> ${CMAKE_COMMAND} -E copy_directory
>> ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html
>> ${DESTDIR}${CMAKE_INSTALL_DOCDIR}/doxygen/html)")
>> 
>> Do you agree that DESTDIR should also be used in the equivalent PLplot
>> file?  How have you guys been getting around this potential issue
>> for Debian and Fedora packaging of PLplot?
>
> I really don't think you ever want to specify ${DESTDIR} in *any* cmake 
> scripts.  cmake will automatically do the right things behind the scenes to 
> handle DESTDIR.

Well, I am now in the position of having two developers that are familiar
with Fedora disagreeing with each other.  :-)

So I did my own test, and it turns out David was correct, and
install(CODE .... is a special case.

For example, looking at standard results generated by cmake
(e.g., in src/cmake_install.cmake) there are references to
$ENV{DESTDIR} all over the place, but no reference to
${DESTDIR} (for the above fix) or $ENV{DESTDIR} (if I fix
with that instead) in doc/cmake_install.cmake.

With -DBUILD_DOX_DOC=ON (Orion would not
have seen this issue before if he did not use this option to
build and install the doxygen documentation), for
the current svn trunk PLplot build system (for the
case where no fix has been applied for the issue),

make -j4 DESTDIR=/tmp install >& destdir.out

generates all sorts of errors when doing doxygen processing starting
with

QGDict::hashAsciiKey: Invalid null key

and ending with a segfault.

After implementing the use of DESTDIR (as above) or the $ENV{DESTDIR}
alternative in the install(CODE logic in doc/CMakeLists.txt, all the
above issues went away.  However, for some odd reason you do not get
the desired result; even though the obvious errors go away, the
install location is _still_ without the DESTDIR prefix.  This is a
small but still fairly serious issue that affects four different
projects (PLplot, libLASi, ephcom, and te_gen) where I am helping to
maintain the build system.

So I created a very simple test project that demonstrated how DESTDIR
was being ignored within the install(CODE... command, and I have now
posted a question about this peculiar result to the cmake-developers
list. With some luck a proper fix to cmake will be forthcoming for
this issue or else somebody responding on the cmake developers list
will be able to suggest a simple workaround that honors setting the
DESTDIR environment variable when installing doxygen-generated files
into the install tree.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to