<br><font size=2 face="sans-serif">Anatoly,</font>
<br>
<br><font size=2 face="sans-serif">Thanks for the advice - I included the
binary dir and all is well</font>
<br>
<br><font size=2 face="sans-serif">Eric</font>
<br>
<br><tt><font size=2>Anatoly Shirokov &lt;shirokov_a@mail.ru&gt; wrote
on 09/25/2009 12:25:16 AM:<br>
<br>
&gt; May be it helps:<br>
&gt; <br>
&gt; generated/CMakeLists.txt:<br>
&gt; <br>
&gt; project (generated)<br>
&gt; <br>
&gt; add_custom_command(...)<br>
&gt; ...<br>
&gt; depends_on_generated/CMakeLists.txt:<br>
&gt; <br>
&gt; project(depends_on_generated)<br>
&gt; ...<br>
&gt; # add the generated binary dir to the search paths<br>
&gt; include_directories(${generated_BINARY_DIR})<br>
&gt; ...<br>
&gt; <br>
&gt; BR, Anatoly<br>
&gt; <br>
&gt; Eric Tellefsen:<br>
&gt; &gt;<br>
&gt; &gt; I am having some trouble with the following.<br>
&gt; &gt;<br>
&gt; &gt; I have a static library project which has a tree structure of
the main <br>
&gt; &gt; directory and a group of sub directories. &nbsp;The main project
has a <br>
&gt; &gt; CMakeLists.txt file as well as the sub directories. &nbsp;Each
of the sub <br>
&gt; &gt; directories CMakeLists.txt file generates .cpp &amp; .h files
from a .wsdl <br>
&gt; &gt; file via calls to gSoap executables. &nbsp;When make is run,
all the sub <br>
&gt; &gt; directory files are generated into the respective <br>
&gt; &gt; CMAKE_CURRENT_BINARY_DIR locations, and then compiled by the
project <br>
&gt; &gt; level generated Makefile. &nbsp;All of this works fine.<br>
&gt; &gt;<br>
&gt; &gt; My seemingly simple problem is as follows. &nbsp;This library
and all of <br>
&gt; &gt; the others being used by my group, I have just converted to CMake
and <br>
&gt; &gt; am using out-of-source builds. &nbsp;Another library depends
on the WSDL <br>
&gt; &gt; (mentioned above) sub directories for header files which are
generated <br>
&gt; &gt; into CMAKE_CURRENT_BINARY_DIR. &nbsp;Unfortunately this inter-library
<br>
&gt; &gt; dependency is looking to the CMAKE_CURRENT_SOURCE_DIR. &nbsp;When
this <br>
&gt; &gt; library builds out-of-source, it cannot find &nbsp;these headers
and the <br>
&gt; &gt; compile fails.<br>
&gt; &gt;<br>
&gt; &gt; My short-term solution was to copy these files from the respective
<br>
&gt; &gt; BINARY to SOURCE directories using a custom command. &nbsp;This
does not <br>
&gt; &gt; seem to work and I cannot understand why. &nbsp;I've put this
code into <br>
&gt; &gt; both the master CMakeLists.txt &nbsp;as well as the specific
subdirectory <br>
&gt; &gt; CMakeLists.txt file.<br>
&gt; &gt;<br>
&gt; &gt; Am I taking the wrong approach? &nbsp;Is my syntax for the custom
command <br>
&gt; &gt; incorrect? &nbsp;I'm stumped and could use some suggestions from
the group.<br>
&gt; &gt;<br>
&gt; &gt; Thanks<br>
&gt; &gt;<br>
&gt; &gt; Eric<br>
&gt; &gt;<br>
&gt; &gt; Custom command is below<br>
&gt; &gt;<br>
&gt; &gt; macro( GenericFileCopy Filename FromDir ToDir )<br>
&gt; &gt;<br>
&gt; &gt; ADD_CUSTOM_COMMAND(<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; OUTPUT &nbsp;${ToDir}/${Filename}<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; COMMAND ${CMAKE_COMMAND} -E chdir
${FromDir} cp ${Filename} <br>
&gt; &gt; ${ToDir}<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; DEPENDS ${FromDir}/${Filename}<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; COMMENT &quot;Copying ${FromDir}/${Filename}
to ${ToDir}&quot;<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; )<br>
&gt; &gt; endmacro( GenericFileCopy )<br>
&gt; &gt;<br>
&gt; &gt; ---<br>
&gt; &gt; This communication may contain confidential and/or privileged
information.<br>
&gt; &gt; If you are not the intended recipient (or have received this
communication<br>
&gt; &gt; in error) please notify the sender immediately and destroy this<br>
&gt; &gt; communication. Any unauthorized copying, disclosure or distribution
of the<br>
&gt; &gt; material in this communication is strictly forbidden.<br>
&gt; &gt;<br>
&gt; &gt; Deutsche Bank does not render legal or tax advice, and the information<br>
&gt; &gt; contained in this communication should not be regarded as such.<br>
&gt; &gt; ------------------------------------------------------------------------<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Powered by www.kitware.com<br>
&gt; &gt;<br>
&gt; &gt; Visit other Kitware open-source projects at http://www.kitware.<br>
&gt; com/opensource/opensource.html<br>
&gt; &gt;<br>
&gt; &gt; Please keep messages on-topic and check the CMake FAQ at: http:<br>
&gt; //www.cmake.org/Wiki/CMake_FAQ<br>
&gt; &gt;<br>
&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt; &gt; http://www.cmake.org/mailman/listinfo/cmake<br>
</font></tt>
<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>