API macro not recognised for CLion 2020.3 on Mac for Unreal 4.25.4

Hi fellow devs, I've been trying to set up a project for CLion on a Mac, using Unreal 4.25.4. The problem I'm running into is that the ${PROJECTNAME}_API macro is not recognised. As a result, CLion marks nearly all classes in the project as having an invalid type.This API macro is defined in a file called Definitions.${PROJECTNAME}.h and it lives in Intermediate/Build/Development/${PROJECTNAME}

The ${PROJECTNAME}EDITOR | DEBUG Target compiles just fine.

Also, on startup of CLion I get a tooltip warning saying "Some source files are located outside of CMakeLists.txt directory. You can change the project root or ignore this in future.

How I went about setting up the project:

  • Open Unreal 4.25.4
  • Create a new empty game project
  • in the Editor Settings > Source Code, set the Source Code Editor to CLion.
  • Create a C++ Class in C++\ /Classes/$PROJECTNAME
  • Choose File > Refresh CLion Project (Or I think it said 'generate' the first time).
  • Close unreal
  • Open unreal again and note that it complains about a missing module called $PROJECTNAME
  • I'll let it fix it.
  • Choose File > Open CLion
  • After all the symbols have been found, I open the C++ file in CLion
  • Now I notice the error.
  • Choose ${PROJECTNAME}EDITOR | DEBUG as the target and build that.
  • The project compiles without issues. The errors remain.

I can't seem to find a clean way of solving this. Does anyone have experience with this issue?

0

Please sign in to leave a comment.