[CMake] generating manual pages from pod

Matthew Gates matthew at porpoisehead.net
Thu Aug 28 17:16:43 EDT 2008


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080828/611fea6d/attachment.pgp>


More information about the CMake mailing list