<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>hi..</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal; ">I have an existing project which has headers with paths of the form "<project>/header.h" i.e. "Eigen/Core". So there may be multiple headers in <project> referring to each other using these paths. I'm not sure how to set this up properly for a super build. </div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal; "><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal; ">The file is in the source directory
 sit in <span style="background-color: transparent; "><project>/include/header.h . I think i want it to be available in <build dir>/include/<project>/header.h before the sources which depend on the headers are built and <install dir>/include/<project>/header.h for putting it into a framework.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal; "><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal; ">The VES build seems to be using the process_dir macro to copy the headers to the install directory but the problem is that the headers of this project and other projects in the same build refer to each other using the <project>/header.h paths.</div><div style="color: rgb(0, 0, 0);
 font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal; "><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal; ">I suppose they could be copied to the <build dir>, but it might be better to soft-link them so that build errors are fixed in one place and there are no date issues. Maybe <span style="background-color: transparent; ">something like this:</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal; "><span style="background-color: transparent; "><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal; "><span
 style="background-color: transparent; "><div>===========================</div><div></div><div>top-level superbuild.cmake:</div><div>===========================</div><div><div>set(base "${CMAKE_BINARY_DIR}/CMakeExternals")</div><div><div>set(build_prefix ${base}/Build)</div><div><br></div></div></div><div>macro(crosscompile_project proj tag toolchain_file)</div><div>  ExternalProject_Add(</div>...<br>      -DBUILD_PREFIX:PATH=${build_prefix}<br>  )<br><div>endmacro()</div><div><br></div></span></div><div>===========================</div><div></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal; "><span style="background-color: transparent; ">CMakeLists.txt for the project:</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent;
 font-style: normal; "><div>===========================</div><div></div></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal; "># to avoid problems with adding the link target multiple times. It seems simpler but maybe</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal; "># there is a better way?</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal; "><div style="background-color: transparent; ">cmake_policy(SET CMP0002 OLD)</div><div style="background-color: transparent; "><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif;
 font-style: normal; ">macro(link_dirs SOURCE_DIR DEST_DIR)</div><div style="background-color: transparent; ">  add_custom_target(link ALL)</div><div style="background-color: transparent; "><br></div><div style="background-color: transparent; ">  # TBD perhaps this should be PRE-BUILD or BUILD?</div><div style="background-color: transparent; "><span style="background-color: transparent; ">  add_custom_command(</span><br></div><div style="background-color: transparent; ">    TARGET link</div><div style="background-color: transparent; ">    COMMAND ln -fsh ${SOURCE_DIR} ${DEST_DIR}</div><div style="background-color: transparent; ">    )</div><div style="background-color: transparent; ">endmacro(<span style="background-color: transparent; ">)</span></div><div style="background-color: transparent; "><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new
 roman', 'new york', times, serif; font-style: normal; ">execute_process(COMMAND mkdir ${BUILD_PREFIX}/include)</div><div style="background-color: transparent; ">set(projdirs project0 project1)<br></div><div style="background-color: transparent; ">foreach(d ${projdirs}) </div><div style="background-color: transparent; "><span style="background-color: transparent; ">    link_dirs(${CMAKE_CURRENT_SOURCE_DIR}/${d}/include ${</span>BUILD_PREFIX<span style="background-color: transparent; ">}/include/${d})</span><br></div><div style="background-color: transparent; "><span style="background-color: transparent; ">endforeach(d) </span><br></div><div style="background-color: transparent; "><br></div><div style="background-color: transparent; ">include_directories(${BUILD_PREFIX}/include)</div><div><div>add_dependencies(mainproject link) # the mainproject target is added elsewhere</div><div><br></div><div><span style="background-color:
 transparent; ">Then, at install time, a VES-style makeFramework.sh is used to create the framework.</span><br></div></div><div>Can someone suggest a better way of doing this? I don't have a lot of experience with cmake yet and would like to keep things simple.</div><div><br></div><div>thanks!</div></div>  </div></body></html>