Announcing beta CLion support in the Projucer

I’m trying the CLion exporter. I’ve been using Xcode, and my project builds fine there. When I export to CLion and build I receive the error:

‘pluginterfaces/vst/vsttypes.h’ file not found.

It’s possibly the same problem timur found but I tried building from the command line and received the same error:

In file included from /Users/chrisgr/CK/JuceLibraryCode/include_juce_audio_processors.mm:9:
In file included from /Users/chrisgr/CK/Builds/CLion/../../JUCE.git/modules/juce_audio_processors/juce_audio_processors.mm:27:
In file included from /Users/chrisgr/CK/Builds/CLion/../../JUCE.git/modules/juce_audio_processors/juce_audio_processors.cpp:164:
In file included from /Users/chrisgr/CK/Builds/CLion/../../JUCE.git/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp:30:
/Users/chrisgr/CK/Builds/CLion/../../JUCE.git/modules/juce_audio_processors/format_types/juce_VST3Headers.h:93:11: fatal error: 'pluginterfaces/vst/vsttypes.h' file not found
 #include <pluginterfaces/vst/vsttypes.h>
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I’m using Juce pulled from the dev branch as of Dec 4 using Projucer built from that version. I assume my vst library directory location is configured correctly in Projucer since the project builds in Xcode.

Can you build the audio plug-in demo at JUCE/examples/audio\ plugin\ demo?

Xcode can resolve paths to headers more ambitiously than other IDEs if USE_HEADERMAP is enabled. Is that it?

I got the same error building the plugin demo host in CLion. I realized that I need to set each project’s path to the VST3 SDK in that project’s exporter Settings page for Xcode. I set that for Demo Host and it built successfully.

So I looked back at my own project’s Project Settings for VST3 SDK. It was greyed and the greyed entry was not correct. I know it was correct at one time. I haven’t needed to look it since setting up the project some time ago as it was working fine. I’m surprised exports from Projucer have been building on Xcode with the wrong entry.

Anyway I entered the correct path for my project’s VST3 SDK for the Xcode exporter and now I can export to CLion and build correctly. Problem solved!

I just noticed another issue. It seems that a Projucer project’s header files are not added to the CLion project.

The cpp files are listed in the CLion project directory, but header files are not. When I try to jump to a cpp file’s header file (keyboard shortcut Ctrl+Cmd+Up) CLion reports the “header file does not belong to any project target”.

The same problem occurs with my project and with the Plugin Host example.

When you start CLion it will prompt you to “Change the project root” so that it has visibility of all your files. If you do this (usually by moving two directories higher in the tree) everything should work as expected.

There’s no (non-hacky) way of getting CLion to do this automatically from the content of CMakeLists.txt. Please add your weight to this issue: https://youtrack.jetbrains.com/issue/CPP-8644

That fixed it. Thanks.

Hi there,
Been trying to get this working for a while but can’t seem to understand the following errors.

Thanks for your help!

[ 12%] Building CXX object CMakeFiles/APP.dir/C_/Projucer/NewProject/JuceLibraryCode/include_juce_video.cpp.obj
In file included from C:/PROGRA~1/JUCE/modules/juce_gui_extra/juce_gui_extra.cpp:152:0,
                 from C:\Projucer\NewProject\JuceLibraryCode\include_juce_gui_extra.cpp:9:
C:/PROGRA~1/JUCE/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp: In static member function 'static void juce::WebBrowserComponent::clearCookies()':
C:/PROGRA~1/JUCE/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp:407:99: error: cannot convert 'const char* const' to 'LPCWSTR {aka const wchar_t*}' for argument '1' to 'void* FindFirstUrlCacheEntryW(LPCWSTR, LPINTERNET_CACHE_ENTRY_INFOW, LPDWORD)'
     ::HANDLE urlCacheHandle = ::FindFirstUrlCacheEntry (searchPattern, entry.getData(), &entrySize);
                                                                                                   ^
C:/PROGRA~1/JUCE/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp:412:94: error: cannot convert 'const char* const' to 'LPCWSTR {aka const wchar_t*}' for argument '1' to 'void* FindFirstUrlCacheEntryW(LPCWSTR, LPINTERNET_CACHE_ENTRY_INFOW, LPDWORD)'
         urlCacheHandle = ::FindFirstUrlCacheEntry (searchPattern, entry.getData(), &entrySize);
                                                                                              ^
mingw32-make.exe[3]: *** [CMakeFiles\APP.dir\build.make:363: CMakeFiles/APP.dir/C_/Projucer/NewProject/JuceLibraryCode/include_juce_gui_extra.cpp.obj] Error 1
mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:67: CMakeFiles/APP.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:79: CMakeFiles/APP.dir/rule] Error 2
mingw32-make.exe: *** [Makefile:117: APP] Error 2

This has been fixed on the develop branch, but the fix it hasn’t yet made to the the master branch or the release version of JUCE.

You can find the develop branch on GitHub: https://github.com/WeAreROLI/JUCE/tree/develop

I have added the three exporters, why is the clion button still disabled?

The Projucer is failing to find your CLion installation for some reason.

What do you see if you look in File -> Global Search Paths ?

image

Will that be the problem that I am installing Clion via the Jetbrains ToolBox?

UPDATE>
I was able to get the button working, by installing without using the Jetbrains ToolBox.

OK, that’s good to know. Thank you for reporting!

1 Like

Hi
Not sure if this has been reported, but clion/cmake does not like projectnames with spaces. so a project like “My App” would fail in clion but work in xcode/vs. Maybe the exporter could add an underscore, or remove the spaces or something?
But. Man, clion is so much better than xcode, xcode feels like coding with mittens

Thanks for reporting - I’ll fix that shortly.

Actually, we already substitute spaces with underscores:

[100%] Linking CXX CFBundle shared module "Plug-in Name With Spaces.vst/Contents/MacOS/Plug-in Name With Spaces"

What’s giving you trouble? Are you using the develop branch?

Hi, thanks for the response.
No my Projucer is the pre-built version from the website. And, not sure if it makes a difference, I’m not compiling plugins but standalone apps.

I encountered the same issue. The problem is that the cmake binary itself cannot be found.

Fix:

in jucer_ProjectExport_CLion.h, replace

                        << "    COMMAND cmake -E remove_directory " << productPath << newLine
                        << "    COMMAND cmake -E copy_directory \"${CMAKE_BINARY_DIR}/" << productFilename << "\" " << productPath << newLine

with

                        << "    COMMAND ${CMAKE_COMMAND} -E remove_directory " << productPath << newLine
                        << "    COMMAND ${CMAKE_COMMAND} -E copy_directory \"${CMAKE_BINARY_DIR}/" << productFilename << "\" " << productPath << newLine

How can I create a release build in CLion? The CMakeLists seems to contain a release config but I don’t know where to select it in CLion. This is what it looks right now:

43

Preferences -> Build, Execution, Deployment

1 Like