<div dir="ltr">prog.1 is a file, not a target.<br><br><div>Use INSTALL(FILES instead.</div><div><br></div><div>TARGETS is for CMake ADD_LIBRARY and ADD_EXECUTABLE targets.</div><div><br></div><div><br></div><div>HTH,</div>
<div>David</div><div><br></div><div><br></div><div><div class="gmail_quote">On Thu, Aug 28, 2008 at 5:16 PM, Matthew Gates <span dir="ltr"><<a href="mailto:matthew@porpoisehead.net">matthew@porpoisehead.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<br>
<br>
I have a sub-directory in my project, doc, which contains pod markup of a<br>
manual page:<br>
<br>
doc<br>
doc/prog.pod<br>
doc/CMakeLists.txt<br>
<br>
I want to generate and install a manual page from this. The command to<br>
generate a manual page is:<br>
<br>
pod2man -s 1 prog.pod prog.1<br>
<br>
...which creates prog.1 - the manual page file. I then want to install this<br>
to .../share/man/man1/<br>
<br>
In my doc/CMakeLists.txt file I have this so far (which I created after<br>
reading an old post to this list):<br>
<br>
ADD_CUSTOM_TARGET(ManPages ALL)<br>
<br>
ADD_CUSTOM_COMMAND(<br>
TARGET ManPages<br>
SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/prog.pod<br>
COMMAND pod2man ARGS -s 1 ${CMAKE_CURRENT_SOURCE_DIR}/prog.pod<br>
${CMAKE_CURRENT_BINARY_DIR}/prog.1<br>
OUTPUTS ${CMAKE_CURRENT_BINARY_DIR}/prog.1<br>
)<br>
<br>
ADD_CUSTOM_COMMAND(<br>
TARGET ManPages<br>
SOURCE ManPages<br>
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/prog.1<br>
)<br>
<br>
When I build, as I wanted, the prog.1 file is generated in my build<br>
directory. Half the problem is solved... The question is this: how can I<br>
install prog.1? I tried this:<br>
<br>
INSTALL(<br>
TARGETS ${CMAKE_CURRENT_BINARY_DIR}/prog.1<br>
DESTINATION share/man/man1<br>
)<br>
<br>
But when I have that in the doc/CMakeLists.txt file, I get this error:<br>
<br>
CMake Error at doc/CMakeLists.txt:22 (INSTALL):<br>
install TARGETS given target<br>
"...mybuilddir.../doc/prog.1"<br>
which does not exist in this directory.<br>
<br>
<br>
So I tried this:<br>
<br>
INSTALL(TARGETS prog.1 DESTINATION share/man/man1)<br>
<br>
But then I get this error:<br>
<br>
CMake Error at doc/CMakeLists.txt:22 (INSTALL):<br>
install TARGETS given target "prog.1" which does not exist in this<br>
directory.<br>
<br>
<br>
What am I doing wrong?<br>
<br>
P.S. I'm using CMake 2.6-patch 0 on Ubuntu Linux/x86.<br>
<br>
Thanks in advance,<br>
<font color="#888888">Matthew<br>
</font><br>_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div></div>