JUCECmakeRepoPrototype icon indicating copy to clipboard operation
JUCECmakeRepoPrototype copied to clipboard

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

Open glynternet opened this issue 2 years ago • 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: https://github.com/eyalamirmusic/JUCECmakeRepoPrototype/blob/22d99ee9f3abc13ca32d237492c0f1aeb2ab6525/Apps/AudioAppTemplate/CMakeLists.txt#L16 https://github.com/eyalamirmusic/JUCECmakeRepoPrototype/blob/22d99ee9f3abc13ca32d237492c0f1aeb2ab6525/Apps/AudioAppTemplate/Source/Main.cpp#L8

glynternet avatar Nov 22 '22 19:11 glynternet

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:

Vlsarro avatar Oct 03 '23 10:10 Vlsarro

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

eyalamirmusic avatar Oct 03 '23 11:10 eyalamirmusic