I found a workaround using the new custom build targets in CLion version 2019.1. For a UE4 project, cmake eventually just runs Unreal’s custom Build.sh script. So I configured a custom build target that invokes Build.sh directly. Follow the instructions in the [CLion documentation to setup a custom build target][1]. Here’s a screenshot of my configuration:
This is working great! However, I discovered a bug: a custom tool fails to run if the tool has any whitespace in the path. For example, the default Unreal Engine installation resides in a directory named “Epic Games”. Because of the space between “Epic” and “Games”, the tool doesn’t run. I worked around this by renaming the directory to “EpicGames” with no space. Would you like me to open a new ticket for this issue?