rnbo_example_juce template path error

alexmstahl's icon

Following the reamde in the rnbo_example_juce repository....I've cloned the template and exported my rnbo project.

The documentation says:
Your export directory should look something like this:
rnbo/
rnbo_source.cpp
README.md

But my export directory looks more like:
README.md
description.json
presets.json
dependencies.json
feedback-synth.cpp

./rnbo:

RNBO.cpp
adapters/
common/
etc. etc. etc.

So when I try this step:
cmake .. -G Xcode

I get this error:

CMake Error at thirdparty/juce/extras/Build/CMake/JUCEUtils.cmake:1630 (add_executable):

Cannot find source file:

/Users/alexmstahl/Documents/GitHub/rnbox1/export/rnbo_source.cpp

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h

.hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc

Call Stack (most recent call first):

App.cmake:11 (juce_add_gui_app)

CMakeLists.txt:63 (include)

I tried editing CMakeLists.txt at the top level of my local copy of the repo, but didn't have much luck so far.

Any suggestions?
Thanks for all you do.

Joshua Kit Clayton's icon

Hi @Alex,

There are two ways to solve this. 1) you can change your exported source code file name to the default rnbo_source.cpp by setting the Export Name field in the export side bar (image below) or 2) you can relplace the text "rnbo_source.cpp" inside CMakelists.txt with the name of your exported code (in this case "feedback-synth.cpp")


Or
set(RNBO_CLASS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/export/rnbo_source.cpp" CACHE FILEPATH "The file that holds the generated RNBO class code")

would become

set(RNBO_CLASS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/export/feedback-synth.cpp" CACHE FILEPATH "The file that holds the generated RNBO class code")

alexmstahl's icon

Thanks for the fast reply @Joshua. I'm able to build my rnbo/juce Xcode project now, yay.

Changing the Export Name field to rnbo_source.cpp in Max, that worked right away.

To make the edit to CMakelists.txt work, so I can use my preferred filename, I first had to delete build/CMakeCache.txt.

I believe the rnbo_source.cpp file name was cached by my hasty first attempt, and that caused further confusion last night. Just a small gotcha, all good now.

Joshua Kit Clayton's icon

@Alex Great to hear!
Yes, any changes to CMakelists.txt will require deleting the build folder contents and regenerating. Thanks for pointing that out. For you and anyone else digging into this stuff, here's a great introduction to CMake that might be helpful.

alexmstahl's icon

Thanks again. RNBO JUCE is easy to digest and tastes great!