Cinder with Visual Studio Code + CMake on Mac



I have a colleague who was telling me he was successfully using Code as an IDE for openFrameworks on Mac. According to him, you just need to have a Makefile to be able to build and run from Code directly.

I am getting a little tired of XCode and was wondering if it would be possible to switch to Code when working on Cinder. Curious if anyone got that setup working. There was a similar question on the forum from 2016 but wondering if something changes in the past two years.


Window resolution with highDensityDisplay

Hi couleurs,
I’ve managed to use it with cmake based project and with a couple extensions in vscode ( cpptools and cmaketools )

the only change I had to made was to move CMakeLists.txt ( and set the correct paths there ) to the root of the project folder. After building for the first time I set the binary path in the launch.json for enabling break points and debuging


Thanks for your answer! I was just getting to something similar using the following links:

One question that’s still remaining is how to run the app after building in tasks.json? I’m able to launch it after building by hardcoding the app name in the task, but wondering if there is something more scalable? My buddy who works on the oF project is able to just use “make run”. Thanks!


I think after running the cmake you can just make -j4


My understanding is that the make -j4 command builds the app (using 4 jobs) but doesn’t actually run it.


This is how I do it on macOS. It’s not perfect, but works. I added the following to the CMakeLists.txt:


set( CMAKE_BUILD_TYPE "Release" )
#set( CMAKE_BUILD_TYPE "Debug" )



add_custom_target( run

You can run make run from the build directory with this.

The main drawback is that you have to specify the build type in the project file to be able to locate the application. Last time I checked there was a CMAKE_RUNTIME_OUTPUT_DIRECTORY variable that could solve this, but it is not accessible from app CMakeLists as I found. Maybe someone knows a fix for this.



This worked great! Thanks Gabor :slight_smile:


Hi Gabor,

You could do the following after the app target has been created ( i.e after the call to ci_make_app ) to retrieve the binary output directory:



# This will save the bin output directory for target APP_NAME to variable OUTPUT_DIR.

add_custom_target( run
    COMMAND open ${OUTPUT_DIR}/${APP_NAME}.app
    DEPENDS ${OUTPUT_DIR}/${APP_NAME}.app/Contents/MacOS/${APP_NAME}



Great! Thanks Petros.

I had to change the get_target_property line to this to work:



Thanks Petros, that worked great!

Follow-up question: did you have to do anything special to attach the log / error output from the app to your IDE? In my case I’m using VSCode and not getting the logs directly in VSCode console.


I just noticed another odd discrepancy between VSCode + CMake vs Xcode:

When calling settings->setHighDensityDisplayEnabled() the contentScale properly returns 2 with the Xcode setup (I’m on a Macbook with Retina display), whereas it returns 1 with VSCode + CMake. Any idea where this could come from? I’m positive they’re both pointing to the same Cinder path.



After further investigation, it seems due to the fact that self.window.backingScaleFactor returns 1 and not 2 in

Then I found this post: which talks about a NSHighResolutionCapable property in Info.plist. This must be properly set by default in Xcode, but I guess I have to figure out how to set that property with CMake. Let me know if you have any idea how to do that. I’ll post an update if I figure it out.


This sounds very similar to Windows, where you have to enable “High DPI aware” in the application manifest. Sorry I can not be of any help, but I just wanted to remark on the similarities.


@paul.houx interesting! Xcode seems to set it up properly by default even when the Info.plist doesn’t have the property explicitly set.

I was finally able to resolve the issue by explicitly adding the NSHighResolutionCapable to my plist, and then asking CMake to attach the plist with the following code after the ci_make_app call:


In my case I pointed to the same plist as Xcode’s so it’s shared but you could point to a different one if you want. Thanks!