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 [2019/02/22 14:15]
daschuer
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 rather than gcc (recommended) add the below: <​code>​+    * To build with clang (recommended) ​rather than gcc add the below: <​code>​
 CC        | clang  ​ CC        | clang  ​
 CXX       | clang++ CXX       | clang++
Line 114: Line 137:
   * 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 Properties +  * 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 build folder ​and choose Properties + 
-  * Check 'Exclude resource from build', Apply and Close + 
-  * Repeat for the cache folder  ​+For CMake Builds (experimental)  
 + 
 +  * 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 164: 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 200: 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 239: 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.1550862946.txt.gz · Last modified: 2019/02/22 14:15 by daschuer