Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
In case of problems
You can always ask for help at forum.
Automatic compilation (recommended)
- You will need all the dependencies as described at what you need, below.
- Then you need to download source code, as described at downloading source code
- Your source code after unpacking should look like described at source code layout
- This script may ask you few questions (like how many CPU cores would you like to use for compilation), so answer them.
- After questions are answered, compilation will start and will take couple of minutes, maybe more, depending on computer performance.
That's it. You can copy
/Users/user/sqlitestudio/output/SQLiteStudio/SQLiteStudio.app directory to wherever you like and then delete whole
/Users/user/sqlitestudio. You don't need it anymore. You can run
SQLiteStudio.app from Finder.
Manual compilation - short description
- Get a Qt library
- Download SQLiteStudio sources and plugins, see downloading source code.
- Setup source directories like described here: source code layout(Setting_up_directory_hierarchy_for_compilation "wikilink")
- Create and go to directory where you want the output files to be created and call:
- Then call:
- Repeat 2 previous steps for Plugins directory.
- Go back to the first directory you created 3 steps earlier and call:
- Binaries can be found in
../output/SQLiteStudio. Enjoy ;)
Manual compilation - more detailed description
What you need
- XCode command line tools.
- Qt 5.3 or later (required Qt modules: core, gui, widgets, script, network, xml, svg, uitools, printsupport)
SQLite 3 - MacOSX usually does not come with the most recent version. Please compile the most recent version from its homepage, then put
libdirectory (the one described here). Then put
includedirectory that is next to the
- SQLite 2 - this is an optional dependency, required to (of course) support SQLite 2 databases. Here is a source code, compile it and put the
libsqlite.afile into the
libdirectory (the one described here). Then put
includedirectory, that is next to
tcl - dependency for ScriptingTcl plugin (optional - you can disable compiling ScriptingTcl by editing the
Plugins.profile). You get Tcl by default with the system (with xcode SDK you also get required headers), or you can install the ActiveTcl distribution.
Downloading source code
Downloading source code tar.gz package (recommended)
The source code can be downloaded from the official download page: http://sqlitestudio.pl/?act=download
Downloading from GitHub
Alternatively you can download a current development source code from GitHub.
- Main source code (the application) and standard plugins:
git clone https://github.com/pawelsalawa/sqlitestudio.git sqlitestudio
Remember, that this is unstable code, being developed per daily basis.
Source code layout
MacOS X the directory structure is almost the same as for Linux, except we also use the
include directories for some extra dependencies (like under Windows):
$ tree -L 2 . ├── include │ ├── sqlite.h │ └── sqlite3.h ├── lib │ ├── libsqlite.a │ └── libsqlite3.dylib └── sqlitestudio ├── Plugins └── SQLiteStudio3
During compilation the "output" directory will be created, just next to SQLiteStudio3 and Plugins. It will contain compilation objects in "build" subdirectory and the final executables in "SQLiteStudio" subdirectory.
You need to prepare "build directory" for output files:
cd /Users/user/projects/sqlitestudio mkdir output cd output mkdir build cd build
Project is based on Qt framework, so each project (main, plugins) will basically require 2 steps (don't execute them like this yet, keep reading, we will execute them later, but with some arguments):
Note, that if you have multiple Qt versions installed on your system, you will need to make sure which
qmake your running. Test it:
If it's not the one you want to build with, then you need to type full path to the qmake you want, for example:
External libraries, depencencies
Some plugins might depend on some external libraries. If dependency headers and libraries are in unusual directories, you will have to provide those directories in a standard manner for
qmake, for example:
qmake "INCLUDEPATH += /my/custom/path/include" "LIBS += -L/my/custom/path/lib"
Don't execute it yet. This is just an example of additional parameters for
qmake that you might need later on.
We will apply what we learned from above:
$ pwd /Users/user/projects/sqlitestudio/output/build $ qmake ../../SQLiteStudio3 $ make
That's it! Compilation will start. Compilation process will produce 2 kinds of output files - temporary build files (makefiles, c++ object files, etc) in
/Users/user/projects/sqlitestudio/output/build and output executables and libraries in
Note, that the path
../../SQLiteStudio3 can be different for you if you decided to use different directories hierarchy. Important thing is to make this path point to the directory where
SQLiteStudio3.pro file is.
Files in the secondary directory are the subject of interest. You have a working application binary there.
Bundle and dmg file
This will create MacOS bundle that can be run on any other Mac:
$ make bundle
This will create the same bundle and additionally will create a dmg file, so it can be distributed for others to install:
$ make dmg
The OSX bundle also contains the CLI application, but to run it one has to type the full path to the binary in the terminal:
$ pwd /Users/user/projects/sqlitestudio/output/build $ mkdir Plugins $ cd Plugins
and then we go:
$ qmake ../../../Plugins $ make
That's all. Plugin binary will be placed in
Excluding some of plugins
If you don't want to compile some plugin (for example DbSqlite2, because you don't have its required dependency), then just edit
Plugins.pro file and remove it from the list.
External (unofficial) plugins
For each plugin you will need to add one build directory more, so it has it's own:
$ pwd /Users/user/projects/sqlitestudio/output/build $ mkdir MyPlugin $ cd MyPlugin
and then we go:
$ qmake ../../../MyPlugin $ make
You have to repeat the same steps for each plugin directory.
Optional compilation settings
Additional paths for headers and libraries
You might want to provide paths for headers and libraries that the project depends on (for SQLite library for example). Here's how you do it:
qmake ../../SQLiteStudio3 "INCLUDEPATH += /path/to/includes/dir"
qmake ../../SQLiteStudio3 "LIBS += /path/to/libraries/dir"
Compile-time directories definition
You can pass additional flags either to
qmake if you want to define some compile-time values of the application. Here are flags and what do they mean:
|PLUGINS_DIR=/path/to/plugins||Additional directory to look up for plugins.|
|ICONS_DIR=/path/to/icons||Additional directory to look up for icons.|
|FORMS_DIR=/path/to/forms||Additional directory to look up for *.ui files (forms used by plugins).|
Example of how to do it:
qmake "DEFINES += PLUGINS_DIR=/usr/lib/sqlitestudio" "DEFINES += ICONS_DIR=/usr/share/sqlitestudio/icons" \ "DEFINES += FORMS_DIR=/usr/share/sqlitestudio/forms"
If you have multi-core CPU, you can speed up compilation by passing "-j " option to make, where is number of cores you want to use, for example:
make -j 4
Since version 3.0.6 automatic updates are compiled always when the portable distribution is being compiled (and only then). Otherwise automatic updates are disabled.
Prior to version 3.0.6 automatic updates were enabled by default and could be disabled by flag
NO_AUTO_UPDATES passed to qmake:
qmake "DEFINES += NO_AUTO_UPDATES"
I get errors from compilator/linker
Answer: Things to check out:
- Make sure you have required version of Qt (see dependencies at the begining of this document).
- Make sure that you used
qmakefrom the correct Qt installation.
- If the error is about sqlite symbol, see if you have sqlite header and library available to the compiler and if the sqlite is in required version (see dependencies at the begining of this document).