Can't get custom build targets to work

Hey everyone! Loving CLion so far, but I can't seem to get custom build targets to work. I'm using Unreal Engine 4, and it's quite picky with its own build toolchain. Fortunately, it can generate a CMakeLists.txt that CLion happily uses, but for some reason it seems like custom targets aren't recognized properly. They show up alright, but aren't executed as they should - instead, a normal cmake build is started.

For instance, I have a target that looks like this:

ADD_CUSTOM_TARGET(ProjectAzerothEditor ${BUILD}  -project="\"${GAME_PROJECT_FILE}\"" ProjectAzerothEditor Linux Development $(ARGS) SOURCES ${SOURCE_FILES} ${HEADER_FILES} ${CONFIG_FILES})

where $BUILD is this:

SET(BUILD mono ${UE4_ROOT_PATH}/Engine/Binaries/DotNET/UnrealBuildTool.exe )

However, the invoked command is this:

/home/jarl/Programming/C++/clion/bin/cmake/bin/cmake --build /home/jarl/.CLion12/system/cmake/generated/36e64884/36e64884/Debug --target ProjectAzerothEditor -- -j 8

The full build log looks like this:

Have I misunderstood something with how CLion deals with custom build targets, or is there something else going on? Any help would be greatly appreciated.

Please sign in to leave a comment.