<br><font size=2 face="sans-serif">I am having some trouble with the following.</font>
<br>
<br><font size=2 face="sans-serif">I have a static library project which
has a tree structure of the main directory and a group of sub directories.
&nbsp;The main project has a CMakeLists.txt file as well as the sub directories.
&nbsp;Each of the sub directories CMakeLists.txt file generates .cpp &amp;
.h files from a .wsdl file via calls to gSoap executables. &nbsp;When make
is run, all the sub directory files are generated into the respective CMAKE_CURRENT_BINARY_DIR
locations, and then compiled by the project level generated Makefile. &nbsp;All
of this works fine.</font>
<br>
<br><font size=2 face="sans-serif">My seemingly simple problem is as follows.
&nbsp;This library and all of the others being used by my group, I have
just converted to CMake and am using out-of-source builds. &nbsp;Another
library depends on the WSDL (mentioned above) sub directories for header
files which are generated into CMAKE_CURRENT_BINARY_DIR. &nbsp;Unfortunately
this inter-library dependency is looking to the CMAKE_CURRENT_SOURCE_DIR.
&nbsp;When this library builds out-of-source, it cannot find &nbsp;these
headers and the compile fails.</font>
<br>
<br><font size=2 face="sans-serif">My short-term solution was to copy these
files from the respective BINARY to SOURCE directories using a custom command.
&nbsp;This does not seem to work and I cannot understand why. &nbsp;I've
put this code into both the master CMakeLists.txt &nbsp;as well as the
specific subdirectory CMakeLists.txt file.</font>
<br>
<br><font size=2 face="sans-serif">Am I taking the wrong approach? &nbsp;Is
my syntax for the custom command incorrect? &nbsp;I'm stumped and could
use some suggestions from the group.</font>
<br>
<br><font size=2 face="sans-serif">Thanks</font>
<br>
<br><font size=2 face="sans-serif">Eric</font>
<br>
<br><font size=2 face="sans-serif">Custom command is below</font>
<br>
<br><font size=2 face="sans-serif">macro( GenericFileCopy Filename FromDir
ToDir )</font>
<br>
<br><font size=2 face="sans-serif">ADD_CUSTOM_COMMAND(</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; OUTPUT &nbsp;${ToDir}/${Filename}</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; COMMAND
${CMAKE_COMMAND} -E chdir ${FromDir} cp ${Filename} ${ToDir}</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; DEPENDS
${FromDir}/${Filename}</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; COMMENT
&quot;Copying ${FromDir}/${Filename} to ${ToDir}&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; )</font>
<br><font size=2 face="sans-serif">endmacro( GenericFileCopy )</font>
<br>
<br>
<span style="font-family:'Arial',sans-serif; font-size:8pt; color:#000000">---</span><br>
<span style="font-family:'Courier New',monospace; font-size:10pt; color:#000000">This communication may contain confidential and/or privileged information.<br>
If you are not the intended recipient (or have received this communication<br>
in error) please notify the sender immediately and destroy this<br>
communication. Any unauthorized copying, disclosure or distribution of the<br>
material in this communication is strictly forbidden.<br>
<br>
Deutsche Bank does not render legal or tax advice, and the information<br>
contained in this communication should not be regarded as such.</span>