<div dir="ltr"><div><div>Hi Chris,<br></div><br>you're definitely not the first to want this (see <a href="https://gitlab.kitware.com/cmake/cmake/issues/12877">https://gitlab.kitware.com/cmake/cmake/issues/12877</a>). However, as per the comment in that issue, it's not something we can expect in any foreseeable future.<br><br></div>Petr<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 1 November 2017 at 17:35, Chris Green <span dir="ltr"><<a href="mailto:greenc@fnal.gov" target="_blank">greenc@fnal.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have a case where a custom command produces multiple outputs, at least some of which depend on a property of a library target, viz:<br>
<br>
  if (BD_WANT_PCM)<br>
    set(PCM_OUTPUT<br>
      $<TARGET_PROPERTY:${dictname}_<wbr>dict,LIBRARY_OUTPUT_DIRECTORY><wbr>/${CMAKE_SHARED_LIBRARY_PREFIX<wbr>}${dictname}_dict_rdict.pcm)<br>
    if (GD_PCM_OUTPUT_VAR)<br>
      set(${GD_PCM_OUTPUT_VAR} ${PCM_OUTPUT} PARENT_SCOPE)<br>
    endif()<br>
  endif()<br>
  add_custom_command(<br>
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${<wbr>dictname}_dict.cpp<br>
    # Extra outputs commented out until custom_command OUTPUT supports<br>
    # generator flags.<br>
    ${SOURCE_OUTPUT} # ${GD_ROOTMAP_OUTPUT} ${PCM_OUTPUT}<br>
  ...<br>
<br>
Here, ${PCM_OUTPUT} needs to be specified to be put in the same directory as the library produced for the target ${dictname}_dict, which may be something particular to that target rather than its defaulted value of ${CMAKE_LIBRARY_OUTPUT_DIRECTO<wbr>RY} or ${LIBRARY_OUTPUT_PATH}. Unfortunately, this fails to work as of CMake 3.9.2. Is this something which is reasonable to want and/or easy to do. Is there some other way to have the desired flexibility?<br>
<br>
Thanks for any help,<br>
<br>
Chris.<br>
<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMak<wbr>e_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/su<wbr>pport.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/co<wbr>nsulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/tr<wbr>aining.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/cmake</a><br>
</blockquote></div><br></div>