Thanks.

If I have a two or three step process as in the automap example which is the better idiom:
- I have one custom command do each of the steps.
- I wrap the steps a script kept in a centralized place and have the custom command call it.

Example:  automake:
.xml.h:
    cat base.xml $< > $.hprep
    transmogrify $*.hprep


build/tools/transmogrify.py
  import os
  os.system('cat %s %s.xml > %s.hprep' % (sys.argv[0], sys.argv[1], sys.argv[1]))
  os.system('transmogrify %s.hprep' % sys.argv[1])

    # Convert
    ADD_CUSTOM_COMMAND(
      OUTPUT    tmpFile
      COMMAND   ${TOOLSDIR}/transmogrify.py
      ARGS     ${BASEFILE_PATH} ${TMP_MCFILE_NAME}
    )


On 10/3/06, Brad King <[EMAIL PROTECTED]> wrote:
Just list the output source files in a target:

http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_generate_a_source_file_during_the_build.3F

In your code these lines:

    # Convert
    ADD_CUSTOM_COMMAND(
      OUTPUT    tmpFile
      COMMAND   transmogrify
      ARGS     ${TMP_MCFILE}
    )

do not make sense because it creates an output called "tmpFile" over and
over again in that FOREACH loop.  Each rule should have its own output,
and all outputs you want to generate should be listed in a target.

-Brad



--
Peter Kahn
[EMAIL PROTECTED]

_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to