]> git.sesse.net Git - casparcg/blob - common/CMakeLists.txt
- Removed need of non-deterministic sleeps during server shutdown.
[casparcg] / common / CMakeLists.txt
1 cmake_minimum_required (VERSION 2.6)
2 project (common)
3
4 set(SOURCES
5                 diagnostics/graph.cpp
6
7                 gl/gl_check.cpp
8
9                 base64.cpp
10                 env.cpp
11                 log.cpp
12                 polling_filesystem_monitor.cpp
13                 stdafx.cpp
14                 thread_info.cpp
15                 tweener.cpp
16                 utf.cpp
17 )
18 if (MSVC)
19         set(OS_SPECIFIC_SOURCES
20                         compiler/vs/disable_silly_warnings.h
21                         compiler/vs/StackWalker.cpp
22                         compiler/vs/StackWalker.h
23
24                         os/windows/current_version.h
25                         os/windows/filesystem.cpp
26                         os/windows/page_locked_allocator.cpp
27                         os/windows/prec_timer.cpp
28                         os/windows/threading.cpp
29                         os/windows/stack_trace.cpp
30                         os/windows/system_info.cpp
31                         os/windows/win32_exception.cpp
32                         os/windows/win32_exception.h
33                         os/windows/windows.h
34         )
35 elseif (CMAKE_COMPILER_IS_GNUCXX)
36         set(OS_SPECIFIC_SOURCES
37                         os/linux/filesystem.cpp
38                         os/linux/prec_timer.cpp
39                         os/linux/signal_handlers.cpp
40                         os/linux/threading.cpp
41                         os/linux/stack_trace.cpp
42                         os/linux/system_info.cpp
43         )
44 endif ()
45 set(HEADERS
46                 diagnostics/graph.h
47
48                 gl/gl_check.h
49
50                 os/filesystem.h
51                 os/general_protection_fault.h
52                 os/page_locked_allocator.h
53                 os/threading.h
54                 os/stack_trace.h
55                 os/system_info.h
56
57                 array.h
58                 assert.h
59                 base64.h
60                 blocking_bounded_queue_adapter.h
61                 blocking_priority_queue.h
62                 cache_aligned_vector.h
63                 endian.h
64                 enum_class.h
65                 env.h
66                 except.h
67                 executor.h
68                 filesystem_monitor.h
69                 forward.h
70                 future.h
71                 future_fwd.h
72                 linq.h
73                 lock.h
74                 log.h
75                 memory.h
76                 memshfl.h
77                 param.h
78                 polling_filesystem_monitor.h
79                 prec_timer.h
80                 reactive.h
81                 scope_exit.h
82                 semaphore.h
83                 stdafx.h
84                 thread_info.h
85                 timer.h
86                 tweener.h
87                 utf.h
88 )
89
90 add_library(common ${SOURCES} ${HEADERS} ${OS_SPECIFIC_SOURCES})
91 add_precompiled_header(common stdafx.h FORCEINCLUDE)
92
93 include_directories(..)
94 include_directories(${BOOST_INCLUDE_PATH})
95 include_directories(${RXCPP_INCLUDE_PATH})
96 include_directories(${TBB_INCLUDE_PATH})
97 include_directories(${GLEW_INCLUDE_PATH})
98
99 source_group(sources ./*)
100 source_group(sources\\gl gl/*)
101 source_group(sources\\diagnostics diagnostics/*)
102 source_group(sources\\compiler\\vs compiler/vs/*)
103 source_group(sources\\os\\windows os/windows/*)
104 source_group(sources\\os os/*)
105
106 if (MSVC)
107         target_link_libraries(common
108                 alibcof64.lib
109                 jpeg.lib
110                 sndfile.lib
111                 optimized sfml-system-2.lib
112                 optimized sfml-window-2.lib
113                 optimized sfml-graphics-2.lib
114                 debug sfml-system-d-2.lib
115                 debug sfml-window-d-2.lib
116                 debug sfml-graphics-d-2.lib
117                 Winmm.lib
118                 Ws2_32.lib
119                 optimized tbb.lib
120                 debug tbb_debug.lib
121                 OpenGL32.lib
122                 glew32.lib
123                 openal32.lib
124                 zlibstat.lib
125         )
126 else ()
127         target_link_libraries(common
128                 "${DEPENDENCIES_FOLDER}/asmlib/alibelf64.a"
129                 boost_system
130                 boost_thread
131                 boost_chrono
132                 boost_filesystem
133                 boost_log
134                 boost_locale
135                 boost_regex
136                 boost_date_time
137                 tbb
138                 tbbmalloc
139                 tbbmalloc_proxy
140                 sfml-graphics-s
141                 sfml-window-s
142                 sfml-system-s
143                 GLEW
144                 GL
145                 X11
146                 jpeg
147                 sndfile
148                 freetype
149                 udev
150                 Xrandr
151                 pthread
152         )
153 endif ()
154
155 if(MSVC)
156         casparcg_add_runtime_dependency("${GLEW_BIN_PATH}/glew32.dll")
157         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbb.dll")
158         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbb_debug.dll")
159         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc.dll")
160         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_debug.dll")
161         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_proxy.dll")
162         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_proxy_debug.dll")
163 else()
164         casparcg_add_runtime_dependency("${GLEW_BIN_PATH}/libGLEW.so.1.12")
165         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbb.so.2")
166         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbbmalloc_proxy.so.2")
167         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbbmalloc.so.2")
168 endif()