<font size=2 face="sans-serif">I have sort of an interesting directory
structure for my projects. I have a folder for libraries, a folder for
executables, and a folder for packages. The packages folder contains debian
packages that combine libraries and executables from the other two folders.
So they look sort of like:</font>
<br>
<br><font size=2 face="sans-serif">IF(NOT TARGET executable_a)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; ADD_SUBDIRECTORY(</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &quot;${PROJECT_SOURCE_DIR}/../../executables/executable_a&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &quot;${CMAKE_BINARY_DIR}/executable_a&quot;)</font>
<br><font size=2 face="sans-serif">ENDIF()</font>
<br>
<br><font size=2 face="sans-serif">INSTALL(</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; TARGET
executable_a</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; DESTINATION
bin)</font>
<br>
<br><font size=2 face="sans-serif">This then gets packaged up into a *.deb
with the executable in it. Well, that's what I would like it to do. Unfortunately,
INSTALL(TARGET is giving me an error about &quot;executable_a&quot; not
being the current directory or something close to that. I can get around
this by using:</font>
<br>
<br><font size=2 face="sans-serif">INSTALL(</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; PROGRAM
&quot;${CMAKE_BINARY_DIR}/executable_a/executable_a&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; DESTINATION
bin)</font>
<br>
<br><font size=2 face="sans-serif">But this seems more brittle than the
INSTALL(TARGET usage. What is the reasoning behind this error message?
I don't understand why it shouldn't just work.</font>
<br>
<br><font size=2 face="sans-serif">On a side note, I don't put the INSTALL(TARGET
command in executable_a's folder because not everyone that ADD_SUBDIRECTORY
on that folder wants executable_a to be installed. In fact this is the
problem I was trying to solve by moving the INSTALL command up a level.</font>
<br>
<br><font size=2 face="sans-serif">-------------------------------------------------------------<br>
Aaron Wright</font>
<br>