configuring_an_ide.rst 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. .. _doc_configuring_an_ide:
  2. Configuring an IDE
  3. ==================
  4. We assume that you already `cloned <https://github.com/godotengine/godot>`_
  5. and :ref:`compiled <toc-compiling>` Godot.
  6. Kdevelop
  7. --------
  8. It is a free, open source IDE (Integrated Development Environment)
  9. for Linux, Solaris, FreeBSD, Mac OS X and other Unix flavors.
  10. You can find a video tutorial `here <https://www.youtube.com/watch?v=yNVoWQi9TJA>`_.
  11. Or you may follow this text version tutorial.
  12. Start by opening Kdevelop and choosing "open project".
  13. .. image:: /img/kdevelop_newproject.png
  14. Choose the directory where you cloned Godot.
  15. .. image:: /img/kdevelop_openproject.png
  16. For the build system, choose "custom build system".
  17. .. image:: /img/kdevelop_custombuild.png
  18. Now that the project has been imported, open the project configuration.
  19. .. image:: /img/kdevelop_openconfig.png
  20. Add the following includes/imports:
  21. ::
  22. . // a dot to indicate the root of the Godot project
  23. core/
  24. core/os/
  25. core/math/
  26. tools/
  27. drivers/
  28. platform/x11/ // make that platform/osx/ is you're using OS X
  29. .. image:: /img/kdevelop_addincludes.png
  30. Apply the changes then switch to the "Custom Buildsystem" tab.
  31. Leave the build directory blank. Enable build tools and add ``scons``
  32. as the executable and add ``platform=x11 target=debug`` (``platform=osx``
  33. if you're on OS X).
  34. .. image:: /img/kdevelop_buildconfig.png
  35. Next we need to tell KDevelop where to find the binary.
  36. From the "run" menu, choose "Configure Launches".
  37. .. image:: /img/kdevelop_configlaunches.png
  38. Click "Add new" if no launcher exists. Then add the path to your
  39. executable in the executable section. Your executable should be located
  40. in the ``bin/`` sub-directory and should be named something like
  41. ``godot.x11.tools.64`` (the name could be different depending on your
  42. platform and depending on your build options).
  43. .. image:: /img/kdevelop_configlaunches2.png
  44. That's it! Now you should be good to go :)
  45. Eclipse
  46. -------
  47. TODO.
  48. QtCreator
  49. ---------
  50. Importing the project
  51. ^^^^^^^^^^^^^^^^^^^^^
  52. - Choose *New Project* -> *Import Project* -> *Import Existing Project*.
  53. - Set the path to your Godot root directory and enter the project name.
  54. - Here you can choose which folders and files will be visible to the project. C/C++ files
  55. are added automatically. Potentially useful additions: \*.py for buildsystem files, \*.java for Android development,
  56. \*.mm for OSX. Click "Next".
  57. - Click *Finish*.
  58. - Add a line containing ``.`` to *project_name.includes* to get working code completion.
  59. Build and run
  60. ^^^^^^^^^^^^^
  61. Build configuration:
  62. - Click on *Projects* and open the *Build* tab.
  63. - Delete the pre-defined ``make`` build step.
  64. - Click *Add Build Step* -> *Custom Process Step*.
  65. - Type ``scons`` in the *Command* field.
  66. - Fill the *Arguments* field with your compilation options. (e.g.: ``p=x11 target=debug -j 4``)
  67. Run configuration:
  68. - Open the *Run* tab.
  69. - Point the *Executable* to your compiled Godot binary (e.g: ``%{buildDir}\bin\godot.windows.tools.64.exe``)
  70. - If you want to run a specific game or project, point *Working directory* to the game directory.
  71. - If you want to run the editor, add ``-e`` to the *Command line arguments* field.
  72. Xcode
  73. -----
  74. Project Setup
  75. ^^^^^^^^^^^^^
  76. - Create an |xcode external build| project anywhere
  77. - Set the *Build tool* to the path to scons
  78. Modify Build Target's |xcode Info Tab|:
  79. - Set *Arguments* to something like: platform=osx tools=yes bits=64 target=debug
  80. - Set *Directory* to the path to Godot's source folder. Keep it blank if project is already there.
  81. - You may uncheck *Pass build settings in environment*
  82. Add a Command Line Target:
  83. - Go to |xcode File > New > Target...| and add a new |xcode command line target|
  84. - Name it something so you know not to compile with this target
  85. - e.g. GodotXcodeIndex
  86. - Goto the newly created target's *Build Settings* tab and search for *Header Search Paths*
  87. - Set *Header Search Paths* to an absolute path to Godot's source folder
  88. - Make it recursive by adding two \*'s to the end of the path
  89. - e.g. /Users/me/repos/godot-source/\**
  90. Add Godot Source to the Project:
  91. - Drag and drop godot source into project file browser.
  92. - |xcode Uncheck| *Create External Build System*
  93. - Click Next
  94. - |xcode Select| *create groups*
  95. - Check off only your command line target in the *Add to targets* section
  96. - Click finish. Xcode will now index the files.
  97. - Grab a cup of coffee... Maybe make something to eat, too
  98. - You should have jump to definition, auto completion, and full syntax highlighting when it is done.
  99. Scheme Setup
  100. ^^^^^^^^^^^^
  101. Edit Build Scheme of External Build Target:
  102. - Open scheme editor of external build target
  103. - Expand the *Build* menu
  104. - Goto *Post Actions*
  105. - Add a new script |xcode run action|
  106. - Write a script that gives the binary a name that Xcode will recognize
  107. - e.g. ln -f "$SRCROOT"/bin/godot.osx.tools.64 "$SRCROOT"/bin/godot
  108. - Build the external build target
  109. Edit Run Scheme of External Build Target:
  110. - Open the scheme editor again
  111. - |xcode Click Run|
  112. - Set the *Executable* to the file you linked in your post build action script
  113. - Check *Debug executable* if it isn't already
  114. - You can go to *Arguments* tab and add an -e and a -path to a project to debug the editor
  115. not the project selection screen
  116. Test It:
  117. - set a breakpoint in platform/osx/godot_main_osx.mm
  118. - it should break at the point!
  119. .. |xcode external build| replace:: :download:`external build </img/xcode_1_create_external_build_project.png>`
  120. .. |xcode Info Tab| replace:: :download:`Info Tab </img/xcode_2_configure_scons.png>`
  121. .. |xcode File > New > Target...| replace:: :download:`File > New > Target... </img/xcode_3_add_new_target.png>`
  122. .. |xcode command line target| replace:: :download:`command line target </img/xcode_4_select_command_line_target.png>`
  123. .. |xcode Uncheck| replace:: :download:`Uncheck </img/xcode_5_after_add_godot_source_to_project.png>`
  124. .. |xcode Select| replace:: :download:`Select </img/xcode_6_after_add_godot_source_to_project_2.png>`
  125. .. |xcode run action| replace:: :download:`run action </img/xcode_7_setup_build_post_action.png>`
  126. .. |xcode Click Run| replace:: :download:`Click Run </img/xcode_8_setup_run_scheme.png>`
  127. Other editors (vim, emacs, Atom...)
  128. -----------------------------------
  129. TODO.