]> git.sesse.net Git - casparcg/blob - shell/CMakeLists.txt
Use fast_memcpy in more places
[casparcg] / shell / CMakeLists.txt
1 cmake_minimum_required (VERSION 2.6)
2 project (shell)
3
4 join_list("${CASPARCG_MODULE_INCLUDE_STATEMENTS}" "\n" CASPARCG_MODULE_INCLUDE_STATEMENTS)
5 join_list("${CASPARCG_MODULE_INIT_STATEMENTS}" "\n" CASPARCG_MODULE_INIT_STATEMENTS)
6 join_list("${CASPARCG_MODULE_UNINIT_STATEMENTS}" "\n" CASPARCG_MODULE_UNINIT_STATEMENTS)
7 join_list("${CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS}" "\n" CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS)
8 configure_file("${PROJECT_SOURCE_DIR}/included_modules.tmpl" "${PROJECT_SOURCE_DIR}/included_modules.h")
9
10 if (MSVC)
11         set(OS_SPECIFIC_SOURCES
12                         resource.h
13                         shell.rc
14                         windows_specific.cpp
15         )
16 elseif (CMAKE_COMPILER_IS_GNUCXX)
17         set(OS_SPECIFIC_SOURCES
18                         linux_specific.cpp
19         )
20 endif ()
21 set(SOURCES
22                 casparcg.config
23                 included_modules.tmpl
24                 main.cpp
25                 server.cpp
26                 stdafx.cpp
27 )
28 set(HEADERS
29                 default_audio_config.h
30                 included_modules.h
31                 platform_specific.h
32                 server.h
33                 stdafx.h
34 )
35
36 add_executable(casparcg ${SOURCES} ${HEADERS} ${OS_SPECIFIC_SOURCES})
37 add_precompiled_header(casparcg stdafx.h FORCEINCLUDE)
38
39 add_executable(generate_docs generate_docs.cpp included_modules.h)
40 target_link_libraries(generate_docs
41                 protocol
42                 accelerator
43
44                 "${CASPARCG_MODULE_PROJECTS}"
45
46                 reroute
47 )
48
49
50 include_directories(..)
51 include_directories(${BOOST_INCLUDE_PATH})
52 include_directories(${RXCPP_INCLUDE_PATH})
53 include_directories(${TBB_INCLUDE_PATH})
54
55 source_group(sources ./*)
56
57 if (MSVC)
58         target_link_libraries(casparcg
59                 zlibstat.lib
60         )
61 endif ()
62
63 target_link_libraries(casparcg
64                 accelerator
65                 common
66                 core
67                 protocol
68
69                 "${CASPARCG_MODULE_PROJECTS}"
70
71                 reroute
72 )
73
74 add_custom_target(casparcg_copy_dependencies ALL)
75
76 casparcg_add_runtime_dependency("${LIBERATION_FONTS_BIN_PATH}/LiberationSans-Regular.ttf")
77 casparcg_add_runtime_dependency("${CMAKE_CURRENT_SOURCE_DIR}/casparcg.config")
78
79 set(OUTPUT_FOLDER "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
80 add_custom_command(TARGET casparcg_copy_dependencies POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory \"${OUTPUT_FOLDER}\")
81
82 foreach(FILE_TO_COPY ${CASPARCG_RUNTIME_DEPENDENCIES})
83         if(IS_DIRECTORY ${FILE_TO_COPY})
84                 get_filename_component(FOLDER_NAME "${FILE_TO_COPY}" NAME)
85                 add_custom_command(TARGET casparcg_copy_dependencies POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory \"${FILE_TO_COPY}\" \"${OUTPUT_FOLDER}/${FOLDER_NAME}\")
86                 add_custom_command(TARGET casparcg_copy_dependencies POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory \"${FILE_TO_COPY}\" \"${CMAKE_CURRENT_BINARY_DIR}/${FOLDER_NAME}\")
87         else()
88                 add_custom_command(TARGET casparcg_copy_dependencies POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy \"${FILE_TO_COPY}\" \"${OUTPUT_FOLDER}/\")
89                 add_custom_command(TARGET casparcg_copy_dependencies POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy \"${FILE_TO_COPY}\" \"${CMAKE_CURRENT_BINARY_DIR}/\")
90         endif()
91 endforeach(FILE_TO_COPY)