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