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