[CMake] Undocumented FILE(INSTALL ...

Eric Noulard eric.noulard at gmail.com
Tue Oct 14 17:18:16 EDT 2008


Hi All,

I am using

CONFIGURE_FILE(doc_install.in doc_install.cmake @ONLY)
INSTALL(SCRIPT ${CMAKE_BINARY_DIR}/doc_install.cmake COMPONENT DOC)

The doc_install.cmake contains CMake commands used to copy
the result of Doxygen outputs (1 dir and 1 file)

I discovered that my doc_install.cmake was broken when trying
to build RPM or DEB package.

because... the script did not handle DESTDIR.

So I did have look at some CMake generated
cmake_install.cmake for a target and saw:

FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE
FILES "/my/build/tree/myapp")

so nice I did

cmake --help-command file

and there is NO  "INSTALL" for the FILE command?
is the doc missing?
do I miss something myself?

In the end I manage to handle DESTDIR  another way inside doc_install.in with:

EXECUTE_PROCESS(COMMAND @CMAKE_COMMAND@ -E copy
@DoxyTools_OUTPUT_DIR@/latex/refman.pdf
$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/doc/certi/@DOCSET@/CERTI_ at DOCSET@.pdf)

But I still wonder if the undocumented FILE(INSTALL wouldn't be a
better solution.

-- 
Erk


More information about the CMake mailing list