set_source_files_properties() worked for me in the past - but I did it in the root CMake file and built the path to the file with ${CMAKE_SOURCE_DIR}/ā¦/ā¦/yadayada. Not sure if this makes a difference, I think it shouldnāt, but maybe it does.
Thanks for your answer! I think, however, that putting the āset_source_files_properties(ā¦)ā command in the root CMake file is not desirable, as Iād have to do this in every individual project that uses āmy_moduleā. And later on, if I add an Objective C file to āmy_moduleā, I have to update the CMake file in all projects that use āmy_moduleā.
Yes, I completely agree. I just wanted to point out, that set_source_files_properties () worked for me under the circumstances I described - I donāt know if this actually required or not.
Edit: because I didnāt RTFM - hereās to @reuk for not resorting to guesgeneering like me
By default, source file properties are only visible to targets added in the same directory ( CMakeLists.txt ).
If you add your module in one subdirectory, and your dependent target in a different subdirectory, the flags will not be visible to the dependent target.
Unfortunately I canāt think of a straightforward way to get per-file flags working along with juce_add_modules. Might it be possible to convert your ARC-dependent code to a staticlib instead?