User Tools

Site Tools


eclipse

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
eclipse [2018/10/13 07:42]
beenisss Add CDT Build Output Parser configuration and update manual include/symbol adds
eclipse [2020/01/14 17:26] (current)
daschuer [Step-by-Step Setup]
Line 21: Line 21:
 Now have to setup the Mixxx source and manage to compile it via the command line, as outlined here: [[compiling_on_linux]] or [[compiling_on_os_x]] or [[compiling_on_windows]] Now have to setup the Mixxx source and manage to compile it via the command line, as outlined here: [[compiling_on_linux]] or [[compiling_on_os_x]] or [[compiling_on_windows]]
 This may take up to 60 min on the fist time.  This may take up to 60 min on the fist time. 
 +
 +**Using Scons:​** ​
  
 <code bash> <code bash>
 scons -j4 # replace 4 with the number of CPU cores that can be utilized ​ scons -j4 # replace 4 with the number of CPU cores that can be utilized ​
 +</​code>​
 +**
 +Using CMake (experimental):​** ​
 +
 +To save during comiling time after switching branches make sure ccache is installed. ​
 +
 +
 +<code bash>
 +mkdir build/​Debug ​
 +cd build/Debug
 +cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:​BOOL=ON ../.. 
 +cmake --build . -j4 # replace 4 with the number of CPU cores that can be utilized
 </​code>​ </​code>​
  
-Test your build: ​+** 
 +Test your build:** 
  
 <code bash> <code bash>
 ./mixxx ./mixxx
 +./​mixxx_test
 </​code>​ </​code>​
  
Line 48: Line 64:
   * eclipse   * eclipse
   * eclipse-cdt   * eclipse-cdt
-  * eclipse-pydev 
  
  
Line 66: Line 81:
  
 For Eclipse 2018-09 For Eclipse 2018-09
 +
 +General:
  
   * Start Eclipse.   * Start Eclipse.
Line 77: Line 94:
   * Expand C/C++ -> Build -> console   * Expand C/C++ -> Build -> console
   * Limit console output = 10000   * Limit console output = 10000
-  * ---+  * Verify Project Explorer is visible. If not go to Window ​-> Show View -> Project Explorer 
 +  * In the Project tree, right-click on the build folder and choose Properties 
 +  * Check '​Exclude resource from build',​ Apply and Close 
 +  * Repeat for the cache folder  
 + 
 +For Scons builds: 
   * File -> New -> Makefile Project with Existing Code.   * File -> New -> Makefile Project with Existing Code.
   * Set Project Name to ''​mixxx''​.   * Set Project Name to ''​mixxx''​.
Line 84: Line 107:
   * Select Toolchain for indexer setting = ''​Linux GCC''​ (this would be for a Linux host, substitute your OS as applicable).   * Select Toolchain for indexer setting = ''​Linux GCC''​ (this would be for a Linux host, substitute your OS as applicable).
   * Finish.   * Finish.
-  * Right click on the new project in Project Explorer -> Properties -> C/C++ Build (if Project Explorer is not visible, go to Window -> Show View -> Project Explorer).+  * Right click on the new project in Project Explorer -> Properties -> C/C++ Build 
   * Uncheck "Use default build command"​.   * Uncheck "Use default build command"​.
   * Build command ​   * Build command ​
Line 102: Line 125:
     * Replace ''​%VERSION%''​ with the folder name for your version of Qt.     * Replace ''​%VERSION%''​ with the folder name for your version of Qt.
     * You may also have to manually add to the system PATH setting to include, for example, /​usr/​local/​bin and /​usr/​local/​include. Do this the same way as the above. Separate individual paths with colons.     * You may also have to manually add to the system PATH setting to include, for example, /​usr/​local/​bin and /​usr/​local/​include. Do this the same way as the above. Separate individual paths with colons.
 +    * To build with clang (recommended) rather than gcc add the below: <​code>​
 +CC        | clang  ​
 +CXX       | clang++
 +</​code>​
   * Expand "C/C++ General"​ -> "​Preprocessor Include Paths, Macros etc."   * Expand "C/C++ General"​ -> "​Preprocessor Include Paths, Macros etc."
   * Select Providers Tab -> CDT GCC Build Output Parser   * Select Providers Tab -> CDT GCC Build Output Parser
-  * Under '​Container to keep discovered entries (you may need to expand the window for this to be visible) select '​Project (use when settings are the same for all files in the project)':​+  ​* Set Compiler command pattern to ''​(g?​cc)|([gc]\+\+)|(clang)|([clang]\+\+)''​ 
 +  ​* Under '​Container to keep discovered entries' ​(you may need to expand the window for this to be visible) select '​Project (use when settings are the same for all files in the project)':​
 {{:​outputparser.png?​direct&​400|}} {{:​outputparser.png?​direct&​400|}}
   * Select "​Providers Tab" -> "CDT GCC Built-In Compiler settings" ​   * Select "​Providers Tab" -> "CDT GCC Built-In Compiler settings" ​
   * Uncheck "Use global providers ..."   * Uncheck "Use global providers ..."
   * Edit the command to <​code>​${COMMAND} ${FLAGS} -std=c++11 -E -P -v -dD "​${INPUTS}"</​code> ​   * Edit the command to <​code>​${COMMAND} ${FLAGS} -std=c++11 -E -P -v -dD "​${INPUTS}"</​code> ​
-  * Close preferences +  * Note: The indexer should work after a full rebuild that allows Eclipse to parse all compiler arguments. 
-  * In the Project tree, right-click on the  + 
-  Open it again for the *_build folder + 
-  * Exclude the "*_build" folder ​from build (in this case from indexer) ​ +For CMake Builds (experimental)  
-  * Repeat ​the steps to exclude the "cache" ​folder  ​+ 
 +  * Install cmake4eclipse via the Eclipse Marketplace  
 +    * Help -> Eclipse Marketplace... 
 +    search ​for cmake4eclipse and press Install.  
 +    * Follow ​the install Wizzard and restart Eclipse 
 +  ​File -> New -> Project... -> C++ Project (!**Not** File -> New -> C/C++ Project) ​ 
 +  * Set Project Name to ''​mixxx''​ 
 +  ​Uncheck ​"Use default location"​ 
 +  * Browse to your Mixxx source ​folder ​e.g. ''​~/​eclipse-workspace/​mixxx''​. 
 +  * Project Type: CMake driven -> Empty Project 
 +  * click Finish  
 +  * Right click on the new project in Project Explorer -> Properties -> C/C++ Build 
 +  * Switch ​to Behavior tab. 
 +  * Check "Enable parallel builds"​ and select "Use optimal jobs"
  
 Now Mixxx should build within Eclipse with "Build Project"​ (Hammer icon). ​ Now Mixxx should build within Eclipse with "Build Project"​ (Hammer icon). ​
-The indexer should work after a full rebuild that allows Eclipse to parse all compiler arguments. 
   * Right click on the new project in Project Explorer -> Clean Project   * Right click on the new project in Project Explorer -> Clean Project
   * Right click on the new project in Project Explorer -> Build Project   * Right click on the new project in Project Explorer -> Build Project
Line 138: Line 178:
   * For stepping through the Qt source, you need to place it in your workspace folder <code bash>   * For stepping through the Qt source, you need to place it in your workspace folder <code bash>
 cd eclipse-workspace cd eclipse-workspace
-apt-get source ​libqt5core5+apt-get source ​qtbase5-dev
 ln -s qtbase-opensource-src-5.2.1+dfsg qt5 # adjust version ​ ln -s qtbase-opensource-src-5.2.1+dfsg qt5 # adjust version ​
 +sudo apt-get install qtbase5-dbg
 </​code>​ </​code>​
   * Non-Mac users should use GDB for debugging in Eclipse ([[https://​www.gnu.org/​software/​gdb/​|GDB]]).   * Non-Mac users should use GDB for debugging in Eclipse ([[https://​www.gnu.org/​software/​gdb/​|GDB]]).
Line 159: Line 200:
 import sys import sys
  
-sys.path.insert(0,​ '/​home/<​user_name>/​workspace'​)+sys.path.insert(0,​ '/​home/<​user_name>/​eclipse-workspace'​)
 from qt import register_qt_printers from qt import register_qt_printers
 register_qt_printers (None) register_qt_printers (None)
Line 195: Line 236:
 by checking "Show built-in values"​ by checking "Show built-in values"​
  
-If the discovering fails, you may add the required info manually: ​+This process does not always work perfectly. ​If the discovering fails, you can help things along by adding ​the required info manually: ​
  
 === Linux === === Linux ===
Line 234: Line 275:
  
   * Right click on the project -> Properties -> C/C++ General -> Paths and Symbols   * Right click on the project -> Properties -> C/C++ General -> Paths and Symbols
-  * Under the '​Includes' and '​Symbols' tabs, choose GNU C++ and add:+  * Under the '​Includes'​ tabs, choose GNU C++ and add:
     * /​usr/​local/​include     * /​usr/​local/​include
-    * /​usr/​local/​Cellar/​qt/​5.10.1/include +    * ${QTDIR}/include 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtCharts +    * ${QTDIR}/​include/​QtCharts 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtConcurrent +    * ${QTDIR}/​include/​QtConcurrent 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtCore +    * ${QTDIR}/​include/​QtCore 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtGui +    * ${QTDIR}/​include/​QtGui 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtNetwork +    * ${QTDIR}/​include/​QtNetwork 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtOpenGL +    * ${QTDIR}/​include/​QtOpenGL 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtScript +    * ${QTDIR}/​include/​QtScript 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtScriptTools +    * ${QTDIR}/​include/​QtScriptTools 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtSql +    * ${QTDIR}/​include/​QtSql 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtSvg +    * ${QTDIR}/​include/​QtSvg 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtTest +    * ${QTDIR}/​include/​QtTest 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtWidgets +    * ${QTDIR}/​include/​QtWidgets 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtXml+    * ${QTDIR}/​include/​QtXml
  
-  * (replace ​/usr/​local/​Cellar/​qt/​5.10.1 above with your QtDir)+Note that the use of ${QTDIR} depends on you having set this variable under Project Properties > C/C++ Build > Environment
  
 After changing these settings, the index needs to be rebuilt. Eclipse will usually detect that changes have been made and will rebuild the index on clicking Apply and Close. To do it manually: After changing these settings, the index needs to be rebuilt. Eclipse will usually detect that changes have been made and will rebuild the index on clicking Apply and Close. To do it manually:
eclipse.1539430945.txt.gz · Last modified: 2018/10/13 07:42 by beenisss