JUCECmakeRepoPrototype
JUCECmakeRepoPrototype copied to clipboard
Using `JUCE_APPLICATION_NAME_STRING` and `TARGET_PROPERTY` in template CMake files
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
Hello. A couple of thoughts on the subject.
"$<TARGET_PROPERTY:${TargetName},JUCE_PROJECT_NAME>"
is meant to get JUCE_PROJECT_NAME
property 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:
-
_juce_write_configure_time_info target, especially see line 321
here is our
PROJECT_NAME
, but noJUCE_PROJECT_NAME
- _juce_initialise_target target
You are correct, that's a bug, I will fix that shortly.