eyalamirmusic/JUCECmakeRepoPrototype

Using `JUCE_APPLICATION_NAME_STRING` and `TARGET_PROPERTY` in template CMake files

Opened this issue · 2 comments

Hi @eyalamirmusic,

Thanks so much for these templates. I've been searching around in the CMake docs for how to understand setting the target property of JUCE_PROJECT_NAME so that it's used in getApplicationName but I've not quite been able to work it out still; at least partially because I'm not that familiar with Cmake still.

How is this meant to be used?

References:

JUCE_APPLICATION_NAME_STRING="$<TARGET_PROPERTY:${TargetName},JUCE_PROJECT_NAME>"

const String getApplicationName() override { return JUCE_APPLICATION_NAME_STRING; }

Hello. A couple of thoughts on the subject.

"$<TARGET_PROPERTY:${TargetName},JUCE_PROJECT_NAME>" is meant to get JUCE_PROJECT_NAMEproperty of your JUCE application target but there is no such property.

JUCE_PROJECT_NAME should be changed to JUCE_PRODUCT_NAME in my opinion. So correct version would look like this:

 JUCE_APPLICATION_NAME_STRING="$<TARGET_PROPERTY:${TargetName},JUCE_PRODUCT_NAME>" 

I can be wrong but it stems from these JUCE cmake functions:

You are correct, that's a bug, I will fix that shortly.