]> git.sesse.net Git - casparcg/blob - common/CMakeLists.txt
* Removed unused file
[casparcg] / common / CMakeLists.txt
1 cmake_minimum_required (VERSION 2.6)
2 project (common)
3
4 set(SOURCES
5                 diagnostics/graph.cpp
6                 diagnostics/graph_to_log_sink.cpp
7
8                 gl/gl_check.cpp
9
10                 base64.cpp
11                 env.cpp
12                 log.cpp
13                 polling_filesystem_monitor.cpp
14                 stdafx.cpp
15                 thread_info.cpp
16                 tweener.cpp
17                 utf.cpp
18 )
19 if (MSVC)
20         set(OS_SPECIFIC_SOURCES
21                         compiler/vs/disable_silly_warnings.h
22                         compiler/vs/StackWalker.cpp
23                         compiler/vs/StackWalker.h
24
25                         os/windows/current_version.h
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                 diagnostics/graph_to_log_sink.h
49
50                 gl/gl_check.h
51
52                 os/filesystem.h
53                 os/general_protection_fault.h
54                 os/page_locked_allocator.h
55                 os/threading.h
56                 os/stack_trace.h
57                 os/system_info.h
58
59                 array.h
60                 assert.h
61                 base64.h
62                 blocking_bounded_queue_adapter.h
63                 blocking_priority_queue.h
64                 cache_aligned_vector.h
65                 endian.h
66                 enum_class.h
67                 env.h
68                 except.h
69                 executor.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                 param.h
80                 polling_filesystem_monitor.h
81                 prec_timer.h
82                 scope_exit.h
83                 semaphore.h
84                 stdafx.h
85                 thread_info.h
86                 timer.h
87                 tweener.h
88                 utf.h
89 )
90
91 add_library(common ${SOURCES} ${HEADERS} ${OS_SPECIFIC_SOURCES})
92 add_precompiled_header(common stdafx.h FORCEINCLUDE)
93
94 include_directories(..)
95 include_directories(${BOOST_INCLUDE_PATH})
96 include_directories(${RXCPP_INCLUDE_PATH})
97 include_directories(${TBB_INCLUDE_PATH})
98 include_directories(${GLEW_INCLUDE_PATH})
99
100 source_group(sources ./*)
101 source_group(sources\\gl gl/*)
102 source_group(sources\\diagnostics diagnostics/*)
103 source_group(sources\\compiler\\vs compiler/vs/*)
104 source_group(sources\\os\\windows os/windows/*)
105 source_group(sources\\os os/*)
106
107 if (MSVC)
108         target_link_libraries(common
109                 alibcof64.lib
110                 jpeg.lib
111                 sndfile.lib
112                 optimized sfml-system-2.lib
113                 optimized sfml-window-2.lib
114                 optimized sfml-graphics-2.lib
115                 debug sfml-system-d-2.lib
116                 debug sfml-window-d-2.lib
117                 debug sfml-graphics-d-2.lib
118                 Winmm.lib
119                 Ws2_32.lib
120                 optimized tbb.lib
121                 debug tbb_debug.lib
122                 OpenGL32.lib
123                 glew32.lib
124                 openal32.lib
125                 zlibstat.lib
126         )
127 else ()
128         target_link_libraries(common
129                 "${DEPENDENCIES_FOLDER}/asmlib/alibelf64.a"
130                 boost_system
131                 boost_thread
132                 boost_chrono
133                 boost_filesystem
134                 boost_log
135                 boost_locale
136                 boost_regex
137                 boost_date_time
138                 tbb
139                 tbbmalloc
140                 tbbmalloc_proxy
141                 sfml-graphics-s
142                 sfml-window-s
143                 sfml-system-s
144                 GLEW
145                 GL
146                 X11
147                 jpeg
148                 sndfile
149                 freetype
150                 udev
151                 Xrandr
152                 pthread
153         )
154 endif ()
155
156 if(MSVC)
157         casparcg_add_runtime_dependency("${GLEW_BIN_PATH}/glew32.dll")
158         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbb.dll")
159         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbb_debug.dll")
160
161         # Reenable when tbb gets official support for vc14
162         # casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc.dll")
163         # casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_debug.dll")
164         # casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_proxy.dll")
165         # casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_proxy_debug.dll")
166 else()
167         casparcg_add_runtime_dependency("${GLEW_BIN_PATH}/libGLEW.so.1.12")
168         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbb.so.2")
169         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbbmalloc_proxy.so.2")
170         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbbmalloc.so.2")
171 endif()