<div dir="ltr"><div class="" style="font-family:-moz-fixed;font-size:14px" lang="x-western">Hi
<br>In have two projects. One is the parent, the second one is the child.
The second one is the generator for the parent. I require to include the
child project inside the parent, build it and use the executable of the
child to generate files for the parent. I was able to include the child
project and build it in parent through ExternalProject_Add command. What
I'm not able to do is to use the executable from the child project and
generate files for the parent project. Can I get some help with this? An
working example combining these two functionalities? Here is how I do it:
<br>
<br>include(ExternalProject)
<br>
<br>set(code_gen_PREFIX "${PROJECT_SOURCE_DIR}/code_gen")
<br>set(code_gen_SVN_URL "<i class=""><span class="">/</span>url/to/child/proj<span class="">/</span></i>")
<br>set(code_gen_CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release;
-DCMAKE_INSTALL_PREFIX=${PROJECT_SOURCE_DIR}<i class=""><span class="">/</span>bins<span class="">/</span></i>)
<br>
<br>ExternalProject_Add(code_generator
<br>PREFIX ${code_gen_PREFIX}
<br>SVN_REPOSITORY ${code_gen_SVN_URL}
<br>SVN_USERNAME ${code_gen_SVN_USER}
<br>SVN_PASSWORD ${code_gen_SVN_PASS}
<br>CMAKE_ARGS ${code_gen_CMAKE_ARGS}
<br>STAMP_DIR ${code_gen_PREFIX}
<br>)
<br>
<br>
<br>add_executable(code_generator IMPORTED GLOBAL)
<br>set_property(TARGET code_generator PROPERTY IMPORTED_LOCATION
"${PROJECT_SOURCE_DIR}<i class=""><span class="">/</span>bins<span class="">/</span></i>")
<br>
<br>add_custom_command(
<br>OUTPUT file1 file2 file3 file4
<br>COMMAND code_generator args_for_code_generator_app
<br>COMMAND code_generator args_for_code_generator_app
<br>)
<br>Some notes:
<br>Each call of the command outputs two files, that's why I have 4 files
for the output.
<br>The step with ExternalProject_Add is working, all the variables are
properly set.
<br>${PROJECT_SOURCE_DIR}<i class=""><span class="">/</span>bins<span class="">/</span></i> is good, I checked it multiple times and
executable is on this path.
<br>I get this type of error
<br><i class=""><span class="">/</span>bin/sh: 1:${PROJECT_SOURCE_DIR}/bins<span class="">/</span></i>: Permission denied
<br>Both of the projects are CMake projects.
<br><div class=""><br>
<br></div></div></div>