]> git.sesse.net Git - casparcg/blob - common/CMakeLists.txt
Remove most of boost::lexical_cast.
[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_DIRS})
99 include_directories(${RXCPP_INCLUDE_DIRS})
100 include_directories(${TBB_INCLUDE_DIRS})
101 include_directories(${GLEW_INCLUDE_DIRS})
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 target_link_libraries(common
111         "${ASMLIB_LIBRARIES}"
112         tbb
113         "${GLEW_LIBRARIES}"
114         "${OPENGL_gl_LIBRARY}"
115         "${FREETYPE_LIBRARIES}"
116         "${OPENAL_LIBRARY}"
117         "${SFML_LIBRARIES}"
118 )
119
120 if (MSVC)
121         target_link_libraries(common
122                 jpeg.lib
123                 sndfile.lib
124                 Winmm.lib
125                 Ws2_32.lib
126                 zlibstat.lib
127         )
128 else ()
129         target_link_libraries(common
130                 "${Boost_LIBRARIES}"
131                 X11
132                 jpeg
133                 sndfile
134                 udev
135                 Xrandr
136                 pthread
137         )
138 endif ()
139
140 if(NOT USE_SYSTEM_TBB)
141         if(MSVC)
142                 casparcg_add_runtime_dependency("${GLEW_BIN_DIR}/glew32.dll")
143                 casparcg_add_runtime_dependency("${TBB_BIN_DIR}/tbb.dll")
144                 casparcg_add_runtime_dependency("${TBB_BIN_DIR}/tbb_debug.dll")
145
146                 # Reenable when tbb gets official support for vc14
147                 # casparcg_add_runtime_dependency("${TBB_BIN_DIR}/tbbmalloc.dll")
148                 # casparcg_add_runtime_dependency("${TBB_BIN_DIR}/tbbmalloc_debug.dll")
149                 # casparcg_add_runtime_dependency("${TBB_BIN_DIR}/tbbmalloc_proxy.dll")
150                 # casparcg_add_runtime_dependency("${TBB_BIN_DIR}/tbbmalloc_proxy_debug.dll")
151         else()
152                 casparcg_add_runtime_dependency("${GLEW_BIN_DIR}/libGLEW.so.1.12")
153                 casparcg_add_runtime_dependency("${TBB_BIN_DIR}/libtbb.so.2")
154         endif()
155 endif()