Search code examples
c++netbeansassimp

How can I compile Assimp with Netbeans in debug mode?


I am not a C/C++ developer, I tried to google but I couldn't find anything about.

Trying to write a simple java port of Assimp, I modified the Main.cpp code runs fine but it doesn't stop at the breakpoint, I guess because I am not compiling in debug mode.

My steps:

  • cloned assimp
  • from terminal in the directory cmake -G "Unix Makefiles"
  • opened the project in Netbeans from "existing sources"
  • compiled

This is my project Debug Property:

enter image description here

I don't have any other configuration other than the "Default" one.

How can I solve?


Solution

  • Cmake based projects are configured using the cmake configuration. Instead of switching to debug / release configuration within netbeans - as usual for "default" C/C++ Projects - you have to set CMAKE_BUILD_TYPE variable accordingly.

    Using command line:

    • Debug: cmake -DCMAKE_BUILD_TYPE=Debug
    • Release: cmake -DCMAKE_BUILD_TYPE=Release

    You do not need to repeat the other flags like, -G ….

    Alternatively use the CMake GUI.

    To get the selectable build configurations you can create them your own (go to Build -> Pre-Build and add calls as above).


    TIP

    It's recommended to do an out-of-source build.