<div dir="ltr">Hi David,<br><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks very much for your reply! That was extremely helpful, and will let several packages document a functional workflow for the future.<br>
<br><div class="gmail_quote">On Tue, Aug 12, 2014 at 5:38 AM, David Cole <span dir="ltr"><<a href="mailto:dlrdave@aol.com" target="_blank">dlrdave@aol.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Unless it is overridden somewhere else along the way, the following is<br>
used to create the link command line for a C++ executable:<br>
<br>
    (found in Modules/CMakeCXXInformation.cmake)<br>
<br>
    if(NOT CMAKE_CXX_LINK_EXECUTABLE)<br>
      set(CMAKE_CXX_LINK_EXECUTABLE<br>
         "<CMAKE_CXX_COMPILER>  <FLAGS> <CMAKE_CXX_LINK_FLAGS><br>
<LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>")<br>
    endif()<br>
<br>
As you can see, by default, the C++ compiler is used as a front end to<br>
link C++ executables...<br>
<br>
Similarly for other types of targets, there are<br>
CMAKE_CXX_CREATE_SHARED_LIBRARY and CMAKE_CXX_CREATE_SHARED_MODULE. And<br>
for other languages, there are CMAKE_${LANG}_CREATE_... variables too.<br></blockquote><div><br></div><div>Ah, that explains one source of confusion. I read CMAKE_CXX_LINK_EXECUTABLE with LINK as an adjective - specify the executable that does linking - whereas the above use of CREATE makes clear that the sense of LINK is intended to be as a verb - specify how to create an executable. The docs did say that this variable specifies a rule, now that I know what to look for. :-(</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In order to use the linker you want, you would have to define a custom<br>
CMAKE_CXX_LINK_EXECUTABLE that uses "<CMAKE_LINKER>" in its definition<br>
of the linker command line.<br></blockquote><div><br></div><div>Right. It's easy to assume that this would be the default behaviour for constructing linking command lines. It's probably too late to consider a change, but I hope the original reasoning works well somewhere! :-)</div>
<div><br></div><div>Mark</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
HTH,<br>
David C.<br>
<br>
<br>
</blockquote></div><br></div></div>