]> git.sesse.net Git - casparcg/blob - common/CMakeLists.txt
6c5057ebe9faf0cb63ae3474923e4ecaaafb3c96
[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                 memcpy.h
79                 memset.h
80                 memshfl.h
81                 param.h
82                 polling_filesystem_monitor.h
83                 prec_timer.h
84                 ptree.h
85                 scope_exit.h
86                 semaphore.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(${ASMLIB_INCLUDE_PATH})
99 include_directories(${BOOST_INCLUDE_PATH})
100 include_directories(${RXCPP_INCLUDE_PATH})
101 include_directories(${TBB_INCLUDE_PATH})
102 include_directories(${GLEW_INCLUDE_PATH})
103
104 source_group(sources ./*)
105 source_group(sources\\gl gl/*)
106 source_group(sources\\diagnostics diagnostics/*)
107 source_group(sources\\compiler\\vs compiler/vs/*)
108 source_group(sources\\os\\windows os/windows/*)
109 source_group(sources\\os os/*)
110
111 if (MSVC)
112         target_link_libraries(common
113                 alibcof64.lib
114                 jpeg.lib
115                 sndfile.lib
116                 optimized sfml-system-2.lib
117                 optimized sfml-window-2.lib
118                 optimized sfml-graphics-2.lib
119                 debug sfml-system-d-2.lib
120                 debug sfml-window-d-2.lib
121                 debug sfml-graphics-d-2.lib
122                 Winmm.lib
123                 Ws2_32.lib
124                 optimized tbb.lib
125                 debug tbb_debug.lib
126                 OpenGL32.lib
127                 glew32.lib
128                 openal32.lib
129                 zlibstat.lib
130         )
131 else ()
132         target_link_libraries(common
133                 "${DEPENDENCIES_FOLDER}/asmlib/alibelf64.a"
134                 boost_system
135                 boost_thread
136                 boost_chrono
137                 boost_filesystem
138                 boost_log
139                 boost_locale
140                 boost_regex
141                 boost_date_time
142                 tbb
143                 tbbmalloc
144                 tbbmalloc_proxy
145                 sfml-graphics-s
146                 sfml-window-s
147                 sfml-system-s
148                 GLEW
149                 GL
150                 X11
151                 jpeg
152                 sndfile
153                 freetype
154                 udev
155                 Xrandr
156                 pthread
157         )
158 endif ()
159
160 if(MSVC)
161         casparcg_add_runtime_dependency("${GLEW_BIN_PATH}/glew32.dll")
162         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbb.dll")
163         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbb_debug.dll")
164
165         # Reenable when tbb gets official support for vc14
166         # casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc.dll")
167         # casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_debug.dll")
168         # casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_proxy.dll")
169         # casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_proxy_debug.dll")
170 else()
171         casparcg_add_runtime_dependency("${GLEW_BIN_PATH}/libGLEW.so.1.12")
172         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbb.so.2")
173         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbbmalloc_proxy.so.2")
174         casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbbmalloc.so.2")
175 endif()