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