CMake generating a strange postfix entitled "_artefacts""

Dear All,
I am using CMake and I encountered a strange phenomenon (or maybe not for those who know this issue).


During the build process, the executable resides in FeatureEx_artefacts instead of just FeatureEx.
Where does the _artefacts come from? I have it nowhere in my CMake file.

Thanks,

The _artefacts folder is automatically created by the juce_add_gui_app call. As well as holding the final executable, this folder also holds intermediate files such as generated sources, plists, and entitlements files - the purpose of the folder is to avoid file naming collisions between these generated files in the case that multiple targets are added in the same CMakeLists/directory. The choice of folder name was somewhat arbitrary, I just picked a name that was unlikely to be used by CMake itself, and which would be unique for each target.

Is this folder/naming causing any issues?

Dear reuk,
Thank you for the prompt reply.
I am integrating JUCE with OpenCV and PyTorch, several DLL’s are copied to the final executable directory via a cmake directive. Therefore, since the postfix _artefacts does not exist anywhere in the namespace, I have two binary folders: one FeatureEx holding all the DLL’s ( and trained PyTorch models) and the FeatureEx_artefacts folder which holds the executable but not the required runtime files.

Also, I imagined i could still use the commonly used cmake style:

SET( PROJ_NAME {PROJECT_NAME} ) SET( PROJ_SOURCES_DIR src) SET( PROJ_SOURCES {PROJ_SOURCES_DIR}/neural.cpp )
SET( PROJ_INCLUDES include)
SET( PROJ_HEADERS {PROJ_INCLUDES}/neural.h) set(PROJECT_INCLUDE_DIR {PROJ_INCLUDES})
SET(PROJECT_SOURCE_DIR {PROJ_SOURCES}) add_executable({PROJ_NAME} {PROJ_SOURCES} {PROJ_HEADERS} ${PROJECT_INCLUDE_DIR})

However the addition of the JUCE dependency seems to render this obsolete and take precedence.

I shall upload a full example to git.

Thanks,

At the end this is what I did:


The postfix is hardcoded and I don’t like it, but its working fine and I have OpenCV, Libtorch and JUCE playing together.

Can’t you use something like
<TARGET_FILE_DIR:{PROJECT_NAME}>