Skip to content

Commit 3e9e992

Browse files
committed
Update INSTALL.md instructions for tree reorg
1 parent 10d994d commit 3e9e992

File tree

1 file changed

+116
-78
lines changed

1 file changed

+116
-78
lines changed

INSTALL.md

Lines changed: 116 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2,72 +2,90 @@
22

33
Operating system specific install instructions are located in:
44

5-
* [doc/INSTALL-LINUX.md][INSTALL-LINUX]
6-
* [doc/INSTALL-MAC.md][INSTALL-MAC]
7-
* [doc/INSTALL-WINDOWS.md][INSTALL-WINDOWS]
5+
* [doc/INSTALL-LINUX.md][INSTALL-LINUX]
6+
* [doc/INSTALL-MAC.md][INSTALL-MAC]
7+
* [doc/INSTALL-WINDOWS.md][INSTALL-WINDOWS]
88

99
## Getting Started
1010

11-
The best way to get started with libopenshot, is to learn about our build system, obtain all the source code,
12-
install a development IDE and tools, and better understand our dependencies. So, please read through the
13-
following sections, and follow the instructions. And keep in mind, that your computer is likely different
14-
than the one used when writing these instructions. Your file paths and versions of applications might be
15-
slightly different, so keep an eye out for subtle file path differences in the commands you type.
11+
The best way to get started with libopenshot is to learn about our build system,
12+
obtain all the source code, install a development IDE and tools,
13+
and better understand our dependencies.
14+
So, please read through the following sections, and follow the instructions.
15+
And keep in mind, your computer is likely different than the one used when writing these instructions.
16+
Your file paths and versions of applications will be different,
17+
so you should treat the specifics used here as examples and adjust as necessary.
18+
Keep an eye out for subtle file path differences in the commands you type.
1619

1720
## Dependencies
1821

1922
The following libraries are required to build libopenshot.
2023
Instructions on how to install these dependencies vary for each operating system.
21-
Libraries and Executables have been labeled in the list below to help distinguish between them.
24+
Libraries and executables have been labeled in the list below to help distinguish between them.
2225

2326
#### FFmpeg (libavformat, libavcodec, libavutil, libavdevice, libavresample, libswscale)
2427

25-
* http://www.ffmpeg.org/ **(Library)**
26-
* This library is used to decode and encode video, audio, and image files. It is also used to obtain information about media files, such as frame rate, sample rate, aspect ratio, and other common attributes.
28+
* <http://www.ffmpeg.org/> **(Library)**
29+
* This library is used to decode and encode video, audio, and image files.
30+
It is also used to obtain information about media files,
31+
such as frame rate, sample rate, aspect ratio, and other common attributes.
2732

2833
#### ImageMagick++ (libMagick++, libMagickWand, libMagickCore)
29-
* http://www.imagemagick.org/script/magick++.php **(Library)**
30-
* This library is **optional**, and used to decode and encode images.
34+
* <http://www.imagemagick.org/script/magick++.php> **(Library)**
35+
* This library is **optional**, and used to decode and encode images.
3136

3237
#### OpenShot Audio Library (libopenshot-audio)
33-
* https://github.com/OpenShot/libopenshot-audio/ **(Library)**
34-
* This library is used to mix, resample, host plug-ins, and play audio. It is based on the JUCE project, which is an outstanding audio library used by many different applications
38+
* <https://github.com/OpenShot/libopenshot-audio/> **(Library)**
39+
* This library is used to mix, resample, host plug-ins, and play audio.
40+
It is based on the JUCE project,
41+
an outstanding audio library used by many different applications.
3542

3643
#### Qt 5 (libqt5)
37-
* http://www.qt.io/qt5/ **(Library)**
38-
* Qt5 is used to display video, store image data, composite images, apply image effects, and many other utility functions, such as file system manipulation, high resolution timers, etc...
44+
* <http://www.qt.io/qt5/> **(Library)**
45+
* Qt5 is used to display video, store image data, composite images,
46+
apply image effects, and many other utility functions,
47+
such as file system manipulation, high resolution timers, etc.
3948

4049
#### ZeroMQ (libzmq)
41-
* http://zeromq.org/ **(Library)**
42-
* This library is used to communicate between libopenshot and other applications (publisher / subscriber). Primarily used to send debug data from libopenshot.
50+
* <http://zeromq.org/> **(Library)**
51+
* This library is used to communicate between libopenshot and other applications (publisher / subscriber).
52+
Primarily used to send debug data from libopenshot.
4353

4454
#### OpenMP (`-fopenmp`)
45-
* http://openmp.org/wp/ **(Compiler Flag)**
46-
* If your compiler supports this flag (GCC, Clang, and most other compilers), it provides libopenshot with easy methods of using parallel programming techniques to improve performance and take advantage of multi-core processors.
55+
* <http://openmp.org/wp/> **(Compiler Flag)**
56+
* If your compiler supports this flag (GCC, Clang, and most other compilers),
57+
it provides libopenshot with implementations of common parallel programming techniques
58+
used to improve performance and take advantage of multi-core processors.
4759

4860
#### CMake (`cmake`)
49-
* http://www.cmake.org/ **(Executable)**
50-
* This executable is used to automate the generation of Makefiles, check for dependencies, and is the backbone of libopenshot’s cross-platform build process.
61+
* <http://www.cmake.org/> **(Executable)**
62+
* This executable is used to automate the generation of Makefiles,
63+
check for dependencies, and is the backbone of libopenshot’s cross-platform build process.
5164

5265
#### SWIG (`swig`)
53-
* http://www.swig.org/ **(Executable)**
54-
* This executable is used to generate the Python and Ruby bindings for libopenshot. It is a simple and powerful wrapper for C++ libraries, and supports many languages.
66+
* <http://www.swig.org/> **(Executable)**
67+
* This executable is used to generate the Python and Ruby bindings for libopenshot.
68+
It is a powerful wrapper for C++ libraries, and supports many languages.
5569

5670
#### Python 3 (libpython)
57-
* http://www.python.org/ **(Executable and Library)**
58-
* This library is used by swig to create the Python (version 3+) bindings for libopenshot. This is also the official language used by OpenShot Video Editor (a graphical interface to libopenshot).
71+
* <http://www.python.org/> **(Executable and Library)**
72+
* This library is used by swig to create the Python (version 3+) bindings for libopenshot.
73+
This is also the official language used by OpenShot Video Editor (a graphical interface to libopenshot).
5974

6075
#### Doxygen (doxygen)
61-
* http://www.stack.nl/~dimitri/doxygen/ **(Executable)**
62-
* This executable is used to auto-generate the documentation used by libopenshot.
76+
* <http://www.stack.nl/~dimitri/doxygen/> **(Executable)**
77+
* This executable is used to auto-generate the documentation used by libopenshot.
6378

6479
#### UnitTest++ (libunittest++)
65-
* https://github.com/unittest-cpp/ **(Library)**
66-
* This library is used to execute unit tests for libopenshot. It contains many macros used to keep our unit testing code very clean and simple.
80+
* <https://github.com/unittest-cpp/> **(Library)**
81+
* This library is used to execute unit tests for libopenshot.
82+
It contains many macros used to keep our unit testing code clean and easy-to-follow.
6783

6884
## Obtaining Source Code
6985

70-
The first step in installing libopenshot is to obtain the most recent source code. The source code is available on [GitHub](https://github.com/OpenShot/libopenshot). Use the following command to obtain the latest libopenshot source code.
86+
The first step in installing libopenshot is to obtain the most recent source code.
87+
The source code is available on [GitHub](https://github.com/OpenShot/libopenshot).
88+
Use the following command to obtain the latest libopenshot source code.
7189

7290
```
7391
git clone https://github.com/OpenShot/libopenshot.git
@@ -79,27 +97,36 @@ git clone https://github.com/OpenShot/libopenshot-audio.git
7997
The source code is divided up into the following folders.
8098

8199
#### `build/`
82-
This folder needs to be manually created, and is used by cmake to store the temporary build files, such as makefiles, as well as the final binaries (library and test executables).
100+
This folder needs to be manually created,
101+
and is used by cmake to store the build system control files and generated output
102+
(such as compiled object files and the result of template-file processing)
103+
as well as the final results of the build (library, tool, and test program binaries).
83104

84105
#### `cmake/`
85106
This folder contains custom modules not included by default in cmake.
86-
CMake find modules are used to discover dependency libraries on the system, and to incorporate their headers and object files.
107+
CMake find modules are used to discover dependency libraries on the system,
108+
and to incorporate their headers and object files.
87109
CMake code modules are used to implement build features such as test coverage scanning.
88110

89111
#### `doc/`
90112
This folder contains documentation and related files.
91113
This includes logos and images required by the doxygen-generated API documentation.
92114

93-
#### `include/`
94-
This folder contains all headers (*.h) used by libopenshot.
95-
96115
#### `src/`
97-
This folder contains all source code (*.cpp) used by libopenshot.
116+
This folder contains all source code (`*.cpp`) and headers (`*.h`) for libopenshot.
117+
118+
#### `bindings/`
119+
This folder contains language bindings for the libopenshot API.
120+
Current supported languages are Python and Ruby.
121+
122+
#### `examples/`
123+
This folder contains various pieces of example code written in C++, Ruby, or Python.
124+
It also holds the media files (data files) used in examples and unit tests.
98125

99126
#### `tests/`
100127
This folder contains all unit test code.
101128
Each test file (`<class>_Tests.cpp`) contains the tests for the named class.
102-
We use UnitTest++ macros to keep the test code simple and manageable.
129+
We use UnitTest++ macros to keep the test code uncomplicated and manageable.
103130

104131
#### `thirdparty/`
105132
This folder contains code not written by the OpenShot team.
@@ -113,79 +140,90 @@ locates header files and libraries, and generates a build system in various form
113140
We use CMake's Makefile generators to compile libopenshot and libopenshot-audio.
114141

115142
CMake uses an out-of-source build concept.
116-
This means that the build system, all temporary files, and all generated products are kept separate from the source code.
143+
This means that the build system,
144+
along with all temporary/intermediate files and generated products output during the build,
145+
is kept strictly separate from the source code.
117146
This includes Makefiles, object files, and even the final binaries.
118-
While it is possible to build in-tree, we highly recommend you use a `/build/` sub-folder to compile each library.
119-
This prevents the build process from cluttering up the source
120-
code.
121-
These instructions have only been tested with the GNU compiler suite (including MSYS2/MinGW for Windows), and the Clang compiler (including AppleClang on MacOS).
147+
The source code files and directories are never modified by the build system,
148+
which makes it convenient and safe to re-run, reconfigure, or discard builds as needed.
149+
While it is possible to build in-tree,
150+
we highly recommend you use a `/build/` sub-folder to compile each library.
151+
152+
These instructions have only been tested with the following compiler stacks:
153+
* The GNU compiler suite (including MSYS2/MinGW for Windows)
154+
* The Clang compiler (including AppleClang on MacOS)
155+
Other compilers, including MSVC, are entirely unsupported.
156+
It may be possible to build libopenshot using other compiler stacks,
157+
but most likely not without modifications to the build system which you would have to make yourself.
122158

123159
## CMake Flags (Optional)
124-
There are many different build flags that can be passed to cmake to adjust how libopenshot is compiled. Some of these flags might be required when compiling on certain OSes, just depending on how your build environment is setup.
160+
There are many different build flags that can be passed to cmake to adjust how libopenshot is compiled.
161+
Some of these flags might be required when compiling on certain OSes,
162+
depending on how your build environment is setup.
125163

126164
To add a build flag, follow this general syntax:
127165

128166
```sh
129-
$ cmake -DMAGICKCORE_HDRI_ENABLE=1 -DENABLE_TESTS=1 ..
167+
$ cmake -B build -S . -DMAGICKCORE_HDRI_ENABLE=1 -DENABLE_TESTS=1 ...
130168
```
131169

132170
Following are some of the flags you might need to set when generating your build system.
133171

134172
##### Optional behavior:
135-
* `-DENABLE_TESTS=0` (default: `ON`)
136-
* `-DENABLE_COVERAGE=1` (default: `OFF`)
137-
* `-DENABLE_DOCS=0` (default: `ON` if doxygen found)
173+
* `-DENABLE_TESTS=0` (default: `ON`)
174+
* `-DENABLE_COVERAGE=1` (default: `OFF`)
175+
* `-DENABLE_DOCS=0` (default: `ON` if doxygen found)
176+
* `-DENABLE_RUBY=0` (default: `ON` if SWIG and Ruby detected)
177+
* `-DENABLE_PYTHON=0` (default: `ON` if SWIG and Python detected)
138178

139179
##### Compiler configuration:
140-
* `-DCMAKE_BUILD_TYPE=Release`, `-DCMAKE_BUILD_TYPE=Debug` (default: `Debug` if unset)
141-
* `-DCMAKE_CXX_FLAGS="-Wall -Wextra"` (default: CMake builtin defaults for build type)
142-
* `-DCMAKE_CXX_COMPILER=/path/to/g++`, `-DCMAKE_CXX_COMPILER=/path/to/clang++`
143-
* `-DCMAKE_C_COMPILER=/path/to/gcc`, `-DCMAKE_CXX_COMPILER=/path/to/clang` (used by CMake for OS probes)
180+
* `-DCMAKE_BUILD_TYPE=Release`, `-DCMAKE_BUILD_TYPE=Debug` (default: `Release` if unset)
181+
* `-DCMAKE_CXX_FLAGS="-Wall -Wextra"` (default: CMake builtin defaults for build type)
182+
* `-DCMAKE_CXX_COMPILER=/path/to/g++`, `-DCMAKE_CXX_COMPILER=/path/to/clang++`
183+
* `-DCMAKE_C_COMPILER=/path/to/gcc`, `-DCMAKE_CXX_COMPILER=/path/to/clang` (used by CMake for OS probes)
144184

145185
##### Dependency configuration:
146-
* `-DCMAKE_PREFIX_PATH=/extra/path/to/search/for/libraries/`
147-
* `-DUSE_SYSTEM_JSONCPP=0` (default: auto if discovered)
148-
* `-DImageMagick_FOUND=0` (default: auto if discovered)
186+
* `-DCMAKE_PREFIX_PATH=/extra/path/to/search/for/libraries/`
187+
* `-DUSE_SYSTEM_JSONCPP=0` (default: auto if discovered)
188+
* `-DENABLE_MAGICK=0` (default: auto if discovered)
149189

150190
##### To compile bindings for a specific Python installation:
151-
* `-DPYTHON_INCLUDE_DIR=/location/of/python/includes/`
152-
* `-DPYTHON_LIBRARY=/location/of/libpython*.so`
153-
* `-DPYTHON_FRAMEWORKS=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/` (MacOS only)
191+
* `-DPYTHON_INCLUDE_DIR=/location/of/python/includes/`
192+
* `-DPYTHON_LIBRARY=/location/of/libpython*.so`
193+
* `-DPYTHON_FRAMEWORKS=/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/` (MacOS only)
154194

155195
##### Only used when building with ImageMagick enabled:
156-
* `-DMAGICKCORE_HDRI_ENABLE=1` (default `0`)
157-
* `-DMAGICKCORE_QUANTUM_DEPTH=8` (default `16`)
196+
* `-DMAGICKCORE_HDRI_ENABLE=1` (default `0`)
197+
* `-DMAGICKCORE_QUANTUM_DEPTH=8` (default `16`)
158198

159199
## Linux Build Instructions (libopenshot-audio)
160-
To compile libopenshot-audio, we need to go through a few additional steps to manually build and install it. Launch a terminal and enter:
200+
To compile libopenshot-audio, we need to build it from source code and install the results.
201+
Launch a terminal and enter:
161202

162-
```
203+
```sh
163204
cd [libopenshot-audio repo folder]
164-
mkdir build
165-
cd build
166-
cmake ../
167-
make
168-
make install
169-
./src/openshot-audio-test-sound (This should play a test sound)
205+
cmake -B build -S .
206+
cmake --build build
207+
./build/src/openshot-audio-test-sound (This should play a test sound)
208+
cmake --install build
170209
```
171210

172211
## Linux Build Instructions (libopenshot)
173212
Run the following commands to compile libopenshot:
174213

175-
```
214+
```sh
176215
cd [libopenshot repo directory]
177-
mkdir -p build
178-
cd build
179-
cmake ../
180-
make
181-
make install
216+
cmake -B build -S .
217+
cmake --build build
218+
cmake --build build --target test
219+
cmake --install build
182220
```
183221

184222
For more detailed instructions, please see:
185223

186-
* [doc/INSTALL-LINUX.md][INSTALL-LINUX]
187-
* [doc/INSTALL-MAC.md][INSTALL-MAC]
188-
* [doc/INSTALL-WINDOWS.md][INSTALL-WINDOWS]
224+
* [doc/INSTALL-LINUX.md][INSTALL-LINUX]
225+
* [doc/INSTALL-MAC.md][INSTALL-MAC]
226+
* [doc/INSTALL-WINDOWS.md][INSTALL-WINDOWS]
189227

190228
[INSTALL-LINUX]: https://github.com/OpenShot/libopenshot/blob/develop/doc/INSTALL-LINUX.md
191229
[INSTALL-MAC]: https://github.com/OpenShot/libopenshot/blob/develop/doc/INSTALL-MAC.md

0 commit comments

Comments
 (0)