<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi there<br>
    <br>
    I am trying to coax a Cmake generation of a Visual Studio project of
    our cross-platform product, that includes the PNaCl platform.  The
    MSBuild setup for PNaCl is a little bit fussy, and does not like the
    relative pathnames in <AdditionalDependencies>, that get
    produced when the product has target_link_libraries setup between
    the static libraries in the product.  For the sake of this mail I'll
    call the library project 'LibProject', which as it's based on unix
    toolchain, will get the static lib created as libLibProject.a.  To
    be used as a command-line on the PNaCl cross-compiler, then it needs
    to get translated to -lLibProject  (without the lib prefix, or the
    .a suffix).<br>
    <br>
    So going into the Visual Studio generator for the EXE project, at
    present are the relative paths (will use Debug for this example): 
    ../LibProject/Debug/libLibProject.a  which gets added to the
    <AdditionalDependencies> tag in the .vcxproj<br>
    <br>
    To make the PNaCl MSBuild extension work, then instead it needs to
    be:<br>
    <ul>
      <li><AdditionalDependencies>LibProject</AdditionalDependencies></li>
      <li><AdditionalLibraryDirectories>../LibProject/Debug</AdditionalLibraryDirectories></li>
    </ul>
    <p>I am well aware that these get set by the cmake functions:
      target_link_libraries() and link_directories(), so feel this ought
      to be possible by Cmake script.<br>
    </p>
    <p>What I'm struggling with, is finding *a place* where I can:</p>
    <ul>
      <li>Query all the libraries that have become dependent on a target
        (the input to the Generator).  As target_link_libraries cascade,
        so my EXE project does not know about all of its leaf libraries,
        so I'm not really sure if there is a target property with ALL
        the dependent static library projects)<br>
      </li>
      <li>Adjust this list, stripping: path, 'lib' and '.a'</li>
      <li>Inserting link_directories (or the equivalent, presuming it's
        some target property now), corresponding to the relative paths
        that were stripped in the step above</li>
    </ul>
    <p>All of this would need to happen, after we've finished setting up
      the target, but before the generator.  Ideally this would be
      something I defined in the ToolChain folder - but I can't think of
      any kind of callback in the CMake system.</p>
    <p>I'm open to other suggestions, about how to setup this visual
      studio cross-compile.  While PNaCl + MSDev may be rare, I feel
      that cross-compiling for other unix systems with -l and -L library
      and path command-lines ought to have been done before with Visual
      Studio generators.</p>
    <p>Thanks in advance</p>
    <p><br>
    </p>
    <p>Andy<br>
    </p>
  </body>
</html>