# ExternalProject logging mystery

**URL:** <https://discourse.cmake.org/t/externalproject-logging-mystery/15226>\
**Category:** Code\
**Tags:** os:linux\
**Created:** [October 8, 2025, 9:13am UTC](https://discourse.cmake.org/t/externalproject-logging-mystery/15226 "2025-10-08T09:13:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergeniously](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/e495f1/32.png) [@sergeniously](https://discourse.cmake.org/u/sergeniously)\
**Post date:** [October 8, 2025, 9:13am UTC](https://discourse.cmake.org/t/externalproject-logging-mystery/15226/1 "2025-10-08T09:13:41Z")

</div>

Look at this:

```cmake
ExternalProject_Add(boost
	PATCH_COMMAND echo "using gcc : ${CMAKE_SYSTEM_PROCESSOR} : ${CMAKE_CXX_COMPILER_CMD} $<SEMICOLON>" > <SOURCE_DIR>/user-config.jam
	LOG_PATCH OFF
	...
)

```

This works well.

Now look at that (`LOG_PATCH ON`):

```cmake
ExternalProject_Add(boost
	PATCH_COMMAND echo "using gcc : ${CMAKE_SYSTEM_PROCESSOR} : ${CMAKE_CXX_COMPILER_CMD} $<SEMICOLON>" > <SOURCE_DIR>/user-config.jam
	LOG_PATCH ON
	...
)

```

That goes wrong and does not produce `user-config.jam` (without any error).

Any ideas what’s the problem?

---

<div class="post-metadata">

**Author:** ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Post date:** [October 9, 2025, 3:23am UTC](https://discourse.cmake.org/t/externalproject-logging-mystery/15226/2 "2025-10-09T03:23:43Z")

</div>

Your COMMAND is assuming a particular shell is used, but ExternalProject does not guarantee that, or even that any particular shell is used at all. More specifically, don’t put shell redirection in your COMMAND (the `>` part). If you need to use shell redirection, put the command in a shell script and run that shell script as your COMMAND. You may need to pass in some details as arguments to the shell script.
