]> git.sesse.net Git - casparcg/blob - BUILDING
Fix a few Clang warnings.
[casparcg] / BUILDING
1 ============================\r
2 Building the CasparCG Server\r
3 ============================\r
4 \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
8 \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
12 \r
13 Windows\r
14 =======\r
15 \r
16 This section is based on a Windows 7 Professional installation. Other versions\r
17 of Windows might also work.\r
18 \r
19 Prerequisites:\r
20 \r
21 1. Install Visual Studio 2015.\r
22 \r
23 2. Install CMake (http://www.cmake.org/download/).\r
24 \r
25 3. Install 7Zip (www.7-zip.org/download.html).\r
26 \r
27 Building a distribution\r
28 -----------------------\r
29 \r
30 1. Go to the build-scripts folder.\r
31 \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
35 \r
36 3. The distribution .zip file can be found under build/\r
37 \r
38 Development using Visual Studio\r
39 -------------------------------\r
40 \r
41 1. Unpack dependencies64/large_files_win32.7z\r
42 \r
43 2. Create an empty directory called build in the source code root.\r
44 \r
45 3. From the build directory type:\r
46 \r
47    cmake -G "Visual Studio 14 2015" -A x64 ..\r
48 \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
52    startup project.\r
53 \r
54 Linux\r
55 =====\r
56 \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
59 \r
60 Prerequisites:\r
61 \r
62 1. Install GCC, make and cmake etc:\r
63 \r
64    sudo apt-get install build-essential cmake\r
65 \r
66 2. Install development packages for libraries which are not bundled:\r
67 \r
68    sudo apt-get install libxrandr-dev libjpeg-dev libsndfile1-dev libudev-dev libglu1-mesa-dev\r
69 \r
70 Building a distribution\r
71 -----------------------\r
72 \r
73 1. Enter the build-scripts folder.\r
74 \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
78 \r
79 3. The distribution .tar.gz file can be found under build/\r
80 \r
81 Building manually from command line\r
82 -----------------------------------\r
83 \r
84 1. Start with unpacking dependencies64/large_files_linux.tar.xz:\r
85 \r
86    cd dependencies64\r
87    tar xvJf large_files_linux.tar.xz\r
88 \r
89 2. Create an empty directory called build in the source code root.\r
90 \r
91 3. From the build directory type:\r
92 \r
93    cmake -G "Unix Makefiles" -A x64 -DCMAKE_BUILD_TYPE=RelWithDebInfo ..\r
94 \r
95    ...for a release build or:\r
96 \r
97    cmake -G "Unix Makefiles" -A x64 -DCMAKE_BUILD_TYPE=Debug ..\r
98 \r
99    ...for a debug build.\r
100 \r
101 4. A Makefile will have been generated allowing us to build using make:\r
102 \r
103    make -j12\r
104 \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
108 \r
109 Development using Qt Creator\r
110 ----------------------------\r
111 \r
112 1. Start with unpacking dependencies64/large_files_linux.tar.xz:\r
113 \r
114    cd dependencies64\r
115    tar xvJf large_files_linux.tar.xz\r
116 \r
117 2. Install Qt Creator:\r
118 \r
119    sudo apt-get install qt-creator\r
120 \r
121 3. Start Qt Creator and open CMake project CMakeLists.txt from the source code\r
122    root.\r
123 \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
126 \r
127 5. Under the build settings enter the following as "CMake arguments" for the\r
128    "Release" build configuration:\r
129 \r
130    -DCMAKE_BUILD_TYPE=RelWithDebInfo\r
131 \r
132    ...and for the "Debug" build configuration set it to:\r
133 \r
134    -DCMAKE_BUILD_TYPE=Debug\r
135 \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
140 \r
141 7. Under "Run Settings" check the "Run in Terminal" checkbox.\r