1 ============================
\r
2 Building the CasparCG Server
\r
3 ============================
\r
5 The CasparCG Server source code uses the CMake build system in order to easily
\r
6 generate build systems for multiple platforms. CMake is basically a build
\r
7 system for generating build systems.
\r
9 On Windows we can use CMake to generate a .sln file and .vcproj files. On
\r
10 Linux CMake can generate make files or ninja files. Qt Creator has support for
\r
11 loading CMakeLists.txt files directly.
\r
16 This section is based on a Windows 7 Professional installation. Other versions
\r
17 of Windows might also work.
\r
21 1. Install Visual Studio 2015.
\r
23 2. Install CMake (http://www.cmake.org/download/).
\r
25 3. Install 7Zip (www.7-zip.org/download.html).
\r
27 Building a distribution
\r
28 -----------------------
\r
30 1. Go to the build-scripts folder.
\r
32 2. If you have installed Visual Studio and 7Zip in the default locations, just
\r
33 run set-variables-and-build-windows.bat, otherwise either edit it to suit
\r
34 your needs or set the envirnoment variables and the run build-windows.bat
\r
36 3. The distribution .zip file can be found under build/
\r
38 Development using Visual Studio
\r
39 -------------------------------
\r
41 1. Unpack dependencies64/large_files_win32.7z
\r
43 2. Create an empty directory called build in the source code root.
\r
45 3. From the build directory type:
\r
47 cmake -G "Visual Studio 14 2015" -A x64 ..
\r
49 4. CasparCG Server.sln has now been generated and can be opened in Visual
\r
50 Studio 2015 and built as usual from inside the IDE. Debug and
\r
51 ReleaseWithDebInfo are the most useful configurations. Set "casparcg" as
\r
57 All instructions are based on a clean install of the x86_64 version of Ubuntu
\r
58 Desktop 14.04.3 LTS. Other distributions might work as well.
\r
62 1. Install GCC, make and cmake etc:
\r
64 sudo apt-get install build-essential cmake
\r
66 2. Install development packages for libraries which are not bundled:
\r
68 sudo apt-get install libxrandr-dev libjpeg-dev libsndfile1-dev libudev-dev libglu1-mesa-dev
\r
70 Building a distribution
\r
71 -----------------------
\r
73 1. Enter the build-scripts folder.
\r
75 2. Run ./set-variables-and-build-linux.sh (or edit it before running to change
\r
76 default settings). You can also set the environment variables manually and
\r
77 run ./build-linux.sh instead.
\r
79 3. The distribution .tar.gz file can be found under build/
\r
81 Building manually from command line
\r
82 -----------------------------------
\r
84 1. Start with unpacking dependencies64/large_files_linux.tar.xz:
\r
87 tar xvJf large_files_linux.tar.xz
\r
89 2. Create an empty directory called build in the source code root.
\r
91 3. From the build directory type:
\r
93 cmake -G "Unix Makefiles" -A x64 -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
\r
95 ...for a release build or:
\r
97 cmake -G "Unix Makefiles" -A x64 -DCMAKE_BUILD_TYPE=Debug ..
\r
99 ...for a debug build.
\r
101 4. A Makefile will have been generated allowing us to build using make:
\r
105 12 is the maximum number of parallel processes to compile via, and can be
\r
106 changed to a more suitable number for the machine doing the compilation
\r
107 (generally the number of hardware threads).
\r
109 Development using Qt Creator
\r
110 ----------------------------
\r
112 1. Start with unpacking dependencies64/large_files_linux.tar.xz:
\r
115 tar xvJf large_files_linux.tar.xz
\r
117 2. Install Qt Creator:
\r
119 sudo apt-get install qt-creator
\r
121 3. Start Qt Creator and open CMake project CMakeLists.txt from the source code
\r
124 4. Select where you want the shadow build to be performed. build/ directly
\r
125 under the source code root is recommended.
\r
127 5. Under the build settings enter the following as "CMake arguments" for the
\r
128 "Release" build configuration:
\r
130 -DCMAKE_BUILD_TYPE=RelWithDebInfo
\r
132 ...and for the "Debug" build configuration set it to:
\r
134 -DCMAKE_BUILD_TYPE=Debug
\r
136 6. For both "Release" and "Debug" build configurations expand the
\r
137 Build Steps - Details section and add -j12 to the "Additional arguments"
\r
138 (or any other number than 12 depending on the number of hardware threads
\r
139 in the computer). This will enable parallel building.
\r
141 7. Under "Run Settings" check the "Run in Terminal" checkbox.
\r