Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To rename an include file from SDL.h to SDL2/SDL.h using CMake in C programming, follow these steps:

  1. Open the CMakeLists.txt file in your project's root directory.

  2. Replace the following line:

    include_directories(${SDL2_INCLUDE_DIRS})
    

    with:

    include_directories(${SDL2_INCLUDE_DIRS}/SDL2)
    
  3. In any files that include the SDL.h header, replace the following line:

    #include <SDL.h>
    

    with:

    #include <SDL2/SDL.h>
    
  4. Save your changes and rebuild the project.