<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Brandon J. Van Every wrote:
<blockquote cite="mid44C2562A.9030500@gmail.com" type="cite">
  <meta http-equiv="Context-Type"
 content="text/html; charset=ISO-8859-1">
  <title></title>
William A. Hoffman wrote:
  <blockquote
 cite="mid6.2.0.14.2.20060722084854.0844e320@pop.nycap.rr.com"
 type="cite">
    <pre>At 08:17 AM 7/22/2006, Brad King wrote:
  </pre>
    <blockquote type="cite">
      <pre>Brandon J. Van Every wrote:
    </pre>
      <blockquote type="cite">
        <pre>Ok, the CMake 2.4.2 documentation for the projectName version of TRY_COMPILE is only 3 short sentences.  IIUYC, you are saying I'm going to have to write a CMakeLists.txt wrapper, and a subdirectory, for each and every tool like "makeinfo," if I want to prove that they work in the build.
      </pre>
      </blockquote>
      <pre>You can create a macro to wrap this all up.  The source tree for the TRY_COMPILE can be created with FILE(WRITE) and FILE(MAKE_DIRECTORY).
    </pre>
    </blockquote>
    <pre>Regardless of the documentation, try-compile and not exec_process is what is supposed
to be used for system introspection.  The build time environment is often different
than the cmake time environment, and if you are testing programs that will be run
at build time, try-compile/try_run is the only way to do that.  I assume that you are
planning to run makeinfo at build time, so it should be tested at build time.  Remember
cmake is not a build tool, but rather a build generator, and is not running during
the build.
  </pre>
  </blockquote>
  <br>
Ok, but given the shenanigans that must occur just to test if a tool
works, the wrapped up functionality really should make it into CMake.&nbsp;
I just can't abide that a user should have to do this much stuff to
test a tool.&nbsp; I will write a macro and put it on the wiki.&nbsp; What is the
process for getting user contributed macros into the Standard CMake
Modules?&nbsp; That would be good information to have on the wiki, on this
page: <a href="http://www.cmake.org/Wiki/CMake_User_Contributed_Macros">http://www.cmake.org/Wiki/CMake_User_Contributed_Macros</a><br>
  <br>
</blockquote>
<br>
I am finding it nearly impossible to write such a macro in practice.&nbsp;
The problem is that a custom COMMAND has no understanding of native
CMake paths.&nbsp; So I must convert the paths to a native format, and
FILE(TO_NATIVE_PATH ...) does not properly escape and quote the path
for use by COMMAND.&nbsp; Also, the COMMAND string needs to be saved
somehow.&nbsp; It needs to be used by TRY_COMPILE, and again by my
CMakeLists.txt, so that I'm doing exactly the same thing each time.&nbsp;
Saving the string is problematic because passing the string around
tends to destroy the quoting.&nbsp; I have put a full work day into this,
for what should be a fairly trivial tool test, and I still don't quite
have something that works.&nbsp; I may yet come up with an interface that
does work, but I definitely wouldn't expect most CMake users (even
experienced ones) to go through all this pain.<br>
<br>
What I'm saying is, tool testing is very weak in CMake, and a better
way is needed.&nbsp; When/if I get to the end of this tunnel, I will make a
specific recommendation rather than just complaining.<br>
<br>
<br>
Cheers,<br>
Brandon Van Every<br>
<br>
<br>
</body>
</html>