[CMake] generating manual pages from pod

David Cole david.cole at kitware.com
Thu Aug 28 17:20:35 EDT 2008


prog.1 is a file, not a target.

Use INSTALL(FILES instead.

TARGETS is for CMake ADD_LIBRARY and ADD_EXECUTABLE targets.


HTH,
David


On Thu, Aug 28, 2008 at 5:16 PM, Matthew Gates <matthew at porpoisehead.net>wrote:

> Hello,
>
> I have a sub-directory in my project, doc, which contains pod markup of a
> manual page:
>
> doc
> doc/prog.pod
> doc/CMakeLists.txt
>
> I want to generate and install a manual page from this.  The command to
> generate a manual page is:
>
> pod2man -s 1 prog.pod prog.1
>
> ...which creates prog.1 - the manual page file.  I then want to install
> this
> to .../share/man/man1/
>
> In my doc/CMakeLists.txt file I have this so far (which I created after
> reading an old post to this list):
>
> ADD_CUSTOM_TARGET(ManPages ALL)
>
> ADD_CUSTOM_COMMAND(
>  TARGET ManPages
>  SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/prog.pod
>  COMMAND pod2man ARGS -s 1 ${CMAKE_CURRENT_SOURCE_DIR}/prog.pod
> ${CMAKE_CURRENT_BINARY_DIR}/prog.1
>  OUTPUTS ${CMAKE_CURRENT_BINARY_DIR}/prog.1
> )
>
> ADD_CUSTOM_COMMAND(
>  TARGET ManPages
>  SOURCE ManPages
>  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/prog.1
> )
>
> When I build, as I wanted, the prog.1 file is generated in my build
> directory.  Half the problem is solved...  The question is this:  how can I
> install prog.1?  I tried this:
>
> INSTALL(
>  TARGETS ${CMAKE_CURRENT_BINARY_DIR}/prog.1
>  DESTINATION share/man/man1
> )
>
> But when I have that in the doc/CMakeLists.txt file, I get this error:
>
> CMake Error at doc/CMakeLists.txt:22 (INSTALL):
>  install TARGETS given target
>  "...mybuilddir.../doc/prog.1"
>  which does not exist in this directory.
>
>
> So I tried this:
>
> INSTALL(TARGETS prog.1 DESTINATION share/man/man1)
>
> But then I get this error:
>
> CMake Error at doc/CMakeLists.txt:22 (INSTALL):
>  install TARGETS given target "prog.1" which does not exist in this
>  directory.
>
>
> What am I doing wrong?
>
> P.S. I'm using CMake 2.6-patch 0 on Ubuntu Linux/x86.
>
> Thanks in advance,
> Matthew
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080828/ac826a87/attachment.htm>


More information about the CMake mailing list