[CMake] execute_process appending redirected output

Aaron Ten Clay aaron at madebyai.com
Wed Dec 28 01:04:20 EST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/27/11 16:16, Belcourt, Kenneth wrote:
> Hi,
>
> I'm trying to get CMake to execute this command
>
> INSTALL(CODE
> "EXECUTE_PROCESS (COMMAND cat
\"${CMAKE_CURRENT_SOURCE_DIR}/onejar_classpath.txt >>
${CMAKE_INSTALL_PREFIX}/onejar/boot-manifest.mf\")"
> )
>
> but this doesn't work, here's the error I get when I run the install.
>
> cat: /home/wec_devs/bkn.cn/caslvipre/rpa/deport/onejar_classpath.txt >>
/home/wec_devs/bkn.cn/caslvipre/U233_INTEL/onejar/boot-manifest.mf: No
such file or directory
>
> I've checked that both the source and target files exist and are
writable. Any ideas on how to get this to work?
>
> Thanks.
>
> -- Noel Belcourt
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

It looks as thought you might be missing some escaped double-quotes. The
"/home/wec_devs/bkn.cn/caslvipre/rpa/deport/onejar_classpath.txt >>
/home/wec_devs/bkn.cn/caslvipre/U233_INTEL/onejar/boot-manifest.mf" is
one argument in your example. Try this:

INSTALL(CODE
  "EXECUTE_PROCESS (COMMAND cat
\"${CMAKE_CURRENT_SOURCE_DIR}/onejar_classpath.txt\" >>
\"${CMAKE_INSTALL_PREFIX}/onejar/boot-manifest.mf\")"
)


It's also worth noting that this is not a cross-platform command. Maybe
look at file(READ ...) followed by file(APPEND ...)?

- -- 
Aaron Ten Clay
MadeByAI Consulting
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk76sWQACgkQXXAPYyclsaVZOQCfWGoKsR/oXT7m9MmJzOnzt/l2
M1YAnjthOkhjOqlaUdEqm+XYjj/fU+oc
=Z0ID
-----END PGP SIGNATURE-----



More information about the CMake mailing list