Tom Finegan | fc6f236 | 2016-10-24 10:39:41 -0700 | [diff] [blame] | 1 | ## |
| 2 | ## Copyright (c) 2016, Alliance for Open Media. All rights reserved |
| 3 | ## |
| 4 | ## This source code is subject to the terms of the BSD 2 Clause License and |
| 5 | ## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
| 6 | ## was not distributed with this source code in the LICENSE file, you can |
| 7 | ## obtain it at www.aomedia.org/license/software. If the Alliance for Open |
| 8 | ## Media Patent License 1.0 was not distributed with this source code in the |
| 9 | ## PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
| 10 | ## |
Tom Finegan | 03e8021 | 2017-03-02 18:32:52 -0800 | [diff] [blame] | 11 | cmake_minimum_required(VERSION 3.5) |
Tom Finegan | fc1aac5 | 2017-05-03 11:24:37 -0700 | [diff] [blame] | 12 | |
| 13 | if (NOT EMSCRIPTEN) |
James Zern | a14f2bb | 2017-07-06 19:51:57 -0700 | [diff] [blame] | 14 | if (NOT CMAKE_BUILD_TYPE) |
James Zern | db0cc5b | 2017-08-30 19:40:54 -0700 | [diff] [blame] | 15 | set(CMAKE_BUILD_TYPE "Release" CACHE |
James Zern | a14f2bb | 2017-07-06 19:51:57 -0700 | [diff] [blame] | 16 | "Build type: Debug, Release, RelWithDebInfo or MinSizeRel" STRING FORCE) |
Tom Finegan | fc1aac5 | 2017-05-03 11:24:37 -0700 | [diff] [blame] | 17 | endif () |
| 18 | endif () |
| 19 | |
Tom Finegan | a0ff456 | 2017-05-23 08:27:47 -0700 | [diff] [blame] | 20 | option(ENABLE_CCACHE "Enable ccache support." OFF) |
| 21 | option(ENABLE_DISTCC "Enable distcc support." OFF) |
Tom Finegan | 0d066ce | 2017-05-30 11:07:05 -0700 | [diff] [blame] | 22 | option(ENABLE_DOCS "Enable documentation generation (doxygen required)." ON) |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 23 | option(ENABLE_EXAMPLES "Enables build of example code." ON) |
Tom Finegan | f67fd8a | 2017-08-10 14:57:11 -0700 | [diff] [blame] | 24 | option(ENABLE_GOMA "Enable goma support." OFF) |
Tom Finegan | 375ee84 | 2017-06-02 10:34:02 -0700 | [diff] [blame] | 25 | option(ENABLE_IDE_TEST_HOSTING |
| 26 | "Enables running tests within IDEs like Visual Studio and Xcode." OFF) |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 27 | option(ENABLE_NASM "Use nasm instead of yasm for x86 assembly." OFF) |
| 28 | option(ENABLE_TOOLS "Enable applications in tools sub directory." ON) |
| 29 | option(ENABLE_WERROR "Converts warnings to errors at compile time." OFF) |
Tom Finegan | a0ff456 | 2017-05-23 08:27:47 -0700 | [diff] [blame] | 30 | |
Tom Finegan | e3bae4a | 2017-10-12 09:06:31 -0700 | [diff] [blame] | 31 | # ARM assembly/intrinsics flags. |
| 32 | option(ENABLE_NEON "Enables NEON optimizations on ARM targets." ON) |
| 33 | option(ENABLE_NEON_ASM "Enables NEON ASM optimizations on ARM targets." ON) |
| 34 | |
| 35 | # MIPS assembly/intrinsics flags. |
| 36 | option(ENABLE_DSPR2 "Enables DSPR2 optimizations on MIPS targets." OFF) |
| 37 | option(ENABLE_MSA "Enables MSA optimizations on MIPS targets." OFF) |
| 38 | |
Luca Barbato | ba908f1 | 2018-03-22 15:41:50 +0100 | [diff] [blame] | 39 | # VSX intrinsics flags. |
| 40 | option(ENABLE_VSX "Enables VSX optimizations on PowerPC targets." ON) |
| 41 | |
Tom Finegan | e3bae4a | 2017-10-12 09:06:31 -0700 | [diff] [blame] | 42 | # x86/x86_64 assembly/intrinsics flags. |
| 43 | option(ENABLE_MMX "Enables MMX optimizations on x86/x86_64 targets." ON) |
| 44 | option(ENABLE_SSE "Enables SSE optimizations on x86/x86_64 targets." ON) |
| 45 | option(ENABLE_SSE2 "Enables SSE2 optimizations on x86/x86_64 targets." ON) |
| 46 | option(ENABLE_SSE3 "Enables SSE3 optimizations on x86/x86_64 targets." ON) |
| 47 | option(ENABLE_SSSE3 "Enables SSSE3 optimizations on x86/x86_64 targets." ON) |
| 48 | option(ENABLE_SSE4_1 "Enables SSE4_1 optimizations on x86/x86_64 targets." ON) |
PENGBIN | ffda377 | 2018-02-26 17:36:37 +0800 | [diff] [blame] | 49 | option(ENABLE_SSE4_2 "Enables SSE4_2 optimizations on x86/x86_64 targets." ON) |
Tom Finegan | e3bae4a | 2017-10-12 09:06:31 -0700 | [diff] [blame] | 50 | option(ENABLE_AVX "Enables AVX optimizations on x86/x86_64 targets." ON) |
| 51 | option(ENABLE_AVX2 "Enables AVX2 optimizations on x86/x86_64 targets." ON) |
| 52 | |
Tom Finegan | 84f2d79 | 2017-06-15 23:06:44 -0700 | [diff] [blame] | 53 | # $BUILD_SHARED_LIBS is a CMake built-in-- it's listed here for visibility. |
| 54 | option(BUILD_SHARED_LIBS "CMake should generate a shared library build." OFF) |
| 55 | |
Tom Finegan | fc6f236 | 2016-10-24 10:39:41 -0700 | [diff] [blame] | 56 | project(AOM C CXX) |
| 57 | |
| 58 | set(AOM_ROOT "${CMAKE_CURRENT_SOURCE_DIR}") |
Tom Finegan | 973d4d5 | 2016-10-26 11:42:42 -0700 | [diff] [blame] | 59 | set(AOM_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}") |
Robert-André Mauchin | ede351b | 2018-03-07 18:09:18 +0100 | [diff] [blame] | 60 | set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH |
| 61 | "Installation path of includes") |
| 62 | set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH |
| 63 | "Installation path of libraries") |
Tom Finegan | 6e9d0c1 | 2016-10-27 11:57:06 -0700 | [diff] [blame] | 64 | |
Tom Finegan | f77394f | 2017-04-26 11:47:59 -0700 | [diff] [blame] | 65 | if ("${AOM_ROOT}" STREQUAL "${AOM_CONFIG_DIR}") |
| 66 | message(FATAL_ERROR |
| 67 | "Building from within the aom source tree is not supported.\n" |
Tom Finegan | bf7cd0d | 2018-01-19 12:05:19 -0800 | [diff] [blame] | 68 | "Hint: Run these commands\n" |
| 69 | "$ rm -rf CMakeCache.txt CMakeFiles\n" |
| 70 | "$ mkdir -p ../aom_build\n" |
| 71 | "$ cd ../aom_build\n" |
| 72 | "And re-run CMake from the aom_build directory.") |
Tom Finegan | f77394f | 2017-04-26 11:47:59 -0700 | [diff] [blame] | 73 | endif () |
| 74 | |
Tom Finegan | 973d4d5 | 2016-10-26 11:42:42 -0700 | [diff] [blame] | 75 | include("${AOM_ROOT}/build/cmake/aom_configure.cmake") |
Tom Finegan | 85ac13e | 2017-02-22 15:09:20 -0800 | [diff] [blame] | 76 | include("${AOM_ROOT}/aom_dsp/aom_dsp.cmake") |
Tom Finegan | dd6d057 | 2017-03-01 19:01:23 -0800 | [diff] [blame] | 77 | include("${AOM_ROOT}/aom_mem/aom_mem.cmake") |
Tom Finegan | 507e2e1 | 2017-03-01 19:58:19 -0800 | [diff] [blame] | 78 | include("${AOM_ROOT}/aom_ports/aom_ports.cmake") |
Tom Finegan | f0d1444 | 2017-03-01 20:42:51 -0800 | [diff] [blame] | 79 | include("${AOM_ROOT}/aom_scale/aom_scale.cmake") |
Tom Finegan | b7d0254 | 2017-03-01 21:14:28 -0800 | [diff] [blame] | 80 | include("${AOM_ROOT}/aom_util/aom_util.cmake") |
Tom Finegan | 44916e7 | 2017-02-27 14:12:31 -0800 | [diff] [blame] | 81 | include("${AOM_ROOT}/av1/av1.cmake") |
Tom Finegan | 4db04d3 | 2017-02-23 14:37:27 -0800 | [diff] [blame] | 82 | include("${AOM_ROOT}/test/test.cmake") |
Tom Finegan | 8cc239b | 2017-08-07 12:28:12 -0700 | [diff] [blame] | 83 | include("${AOM_ROOT}/build/cmake/sanitizers.cmake") |
Tom Finegan | 84f2d79 | 2017-06-15 23:06:44 -0700 | [diff] [blame] | 84 | include("${AOM_ROOT}/build/cmake/util.cmake") |
Tom Finegan | 85ac13e | 2017-02-22 15:09:20 -0800 | [diff] [blame] | 85 | |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 86 | list(APPEND AOM_RTCD_SOURCES |
Tom Finegan | a0c21f0 | 2017-02-01 11:11:09 -0800 | [diff] [blame] | 87 | "${AOM_CONFIG_DIR}/aom_dsp_rtcd.h" |
| 88 | "${AOM_CONFIG_DIR}/aom_scale_rtcd.h" |
| 89 | "${AOM_CONFIG_DIR}/av1_rtcd.h" |
| 90 | "${AOM_ROOT}/aom_dsp/aom_dsp_rtcd_defs.pl" |
| 91 | "${AOM_ROOT}/aom_dsp/aom_dsp_rtcd.c" |
| 92 | "${AOM_ROOT}/aom_scale/aom_scale_rtcd.pl" |
| 93 | "${AOM_ROOT}/aom_scale/aom_scale_rtcd.c" |
| 94 | "${AOM_ROOT}/av1/common/av1_rtcd_defs.pl" |
| 95 | "${AOM_ROOT}/av1/common/av1_rtcd.c" |
| 96 | "${AOM_ROOT}/build/make/rtcd.pl") |
| 97 | |
Tom Finegan | 957fe82 | 2016-11-09 10:37:27 -0800 | [diff] [blame] | 98 | # TODO(tomfinegan): Use libwebm's cmake support directly. |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 99 | list(APPEND AOM_LIBWEBM_SOURCES |
Tom Finegan | 957fe82 | 2016-11-09 10:37:27 -0800 | [diff] [blame] | 100 | "${AOM_ROOT}/third_party/libwebm/common/hdr_util.cc" |
| 101 | "${AOM_ROOT}/third_party/libwebm/common/hdr_util.h" |
| 102 | "${AOM_ROOT}/third_party/libwebm/common/webmids.h" |
| 103 | "${AOM_ROOT}/third_party/libwebm/mkvmuxer/mkvmuxer.cc" |
| 104 | "${AOM_ROOT}/third_party/libwebm/mkvmuxer/mkvmuxer.h" |
| 105 | "${AOM_ROOT}/third_party/libwebm/mkvmuxer/mkvmuxertypes.h" |
| 106 | "${AOM_ROOT}/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc" |
| 107 | "${AOM_ROOT}/third_party/libwebm/mkvmuxer/mkvmuxerutil.h" |
| 108 | "${AOM_ROOT}/third_party/libwebm/mkvmuxer/mkvwriter.cc" |
| 109 | "${AOM_ROOT}/third_party/libwebm/mkvmuxer/mkvwriter.h" |
| 110 | "${AOM_ROOT}/third_party/libwebm/mkvparser/mkvparser.cc" |
| 111 | "${AOM_ROOT}/third_party/libwebm/mkvparser/mkvparser.h" |
| 112 | "${AOM_ROOT}/third_party/libwebm/mkvparser/mkvreader.cc" |
| 113 | "${AOM_ROOT}/third_party/libwebm/mkvparser/mkvreader.h") |
| 114 | |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 115 | list(APPEND AOM_LIBYUV_SOURCES |
Tom Finegan | 9cd9700 | 2016-11-09 10:37:44 -0800 | [diff] [blame] | 116 | "${AOM_ROOT}/third_party/libyuv/include/libyuv/basic_types.h" |
| 117 | "${AOM_ROOT}/third_party/libyuv/include/libyuv/convert.h" |
| 118 | "${AOM_ROOT}/third_party/libyuv/include/libyuv/convert_argb.h" |
| 119 | "${AOM_ROOT}/third_party/libyuv/include/libyuv/convert_from.h" |
| 120 | "${AOM_ROOT}/third_party/libyuv/include/libyuv/cpu_id.h" |
| 121 | "${AOM_ROOT}/third_party/libyuv/include/libyuv/planar_functions.h" |
| 122 | "${AOM_ROOT}/third_party/libyuv/include/libyuv/rotate.h" |
| 123 | "${AOM_ROOT}/third_party/libyuv/include/libyuv/row.h" |
| 124 | "${AOM_ROOT}/third_party/libyuv/include/libyuv/scale.h" |
| 125 | "${AOM_ROOT}/third_party/libyuv/include/libyuv/scale_row.h" |
| 126 | "${AOM_ROOT}/third_party/libyuv/source/cpu_id.cc" |
| 127 | "${AOM_ROOT}/third_party/libyuv/source/planar_functions.cc" |
| 128 | "${AOM_ROOT}/third_party/libyuv/source/row_any.cc" |
| 129 | "${AOM_ROOT}/third_party/libyuv/source/row_common.cc" |
| 130 | "${AOM_ROOT}/third_party/libyuv/source/row_gcc.cc" |
| 131 | "${AOM_ROOT}/third_party/libyuv/source/row_mips.cc" |
| 132 | "${AOM_ROOT}/third_party/libyuv/source/row_neon.cc" |
| 133 | "${AOM_ROOT}/third_party/libyuv/source/row_neon64.cc" |
| 134 | "${AOM_ROOT}/third_party/libyuv/source/row_win.cc" |
| 135 | "${AOM_ROOT}/third_party/libyuv/source/scale.cc" |
| 136 | "${AOM_ROOT}/third_party/libyuv/source/scale_any.cc" |
| 137 | "${AOM_ROOT}/third_party/libyuv/source/scale_common.cc" |
| 138 | "${AOM_ROOT}/third_party/libyuv/source/scale_gcc.cc" |
| 139 | "${AOM_ROOT}/third_party/libyuv/source/scale_mips.cc" |
| 140 | "${AOM_ROOT}/third_party/libyuv/source/scale_neon.cc" |
| 141 | "${AOM_ROOT}/third_party/libyuv/source/scale_neon64.cc" |
| 142 | "${AOM_ROOT}/third_party/libyuv/source/scale_win.cc") |
| 143 | |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 144 | list(APPEND AOM_SOURCES |
Tom Finegan | 973d4d5 | 2016-10-26 11:42:42 -0700 | [diff] [blame] | 145 | "${AOM_CONFIG_DIR}/aom_config.c" |
| 146 | "${AOM_CONFIG_DIR}/aom_config.h" |
Tom Finegan | fc6f236 | 2016-10-24 10:39:41 -0700 | [diff] [blame] | 147 | "${AOM_ROOT}/aom/aom.h" |
| 148 | "${AOM_ROOT}/aom/aom_codec.h" |
| 149 | "${AOM_ROOT}/aom/aom_decoder.h" |
| 150 | "${AOM_ROOT}/aom/aom_encoder.h" |
| 151 | "${AOM_ROOT}/aom/aom_frame_buffer.h" |
| 152 | "${AOM_ROOT}/aom/aom_image.h" |
| 153 | "${AOM_ROOT}/aom/aom_integer.h" |
| 154 | "${AOM_ROOT}/aom/aomcx.h" |
| 155 | "${AOM_ROOT}/aom/aomdx.h" |
| 156 | "${AOM_ROOT}/aom/internal/aom_codec_internal.h" |
| 157 | "${AOM_ROOT}/aom/src/aom_codec.c" |
| 158 | "${AOM_ROOT}/aom/src/aom_decoder.c" |
| 159 | "${AOM_ROOT}/aom/src/aom_encoder.c" |
Tom Finegan | 10fea49 | 2018-01-08 18:07:46 -0800 | [diff] [blame] | 160 | "${AOM_ROOT}/aom/src/aom_image.c" |
| 161 | "${AOM_ROOT}/aom/src/aom_integer.c") |
Tom Finegan | fc6f236 | 2016-10-24 10:39:41 -0700 | [diff] [blame] | 162 | |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 163 | list(APPEND AOM_COMMON_APP_UTIL_SOURCES |
Tom Finegan | a89fe0e | 2017-01-19 14:38:28 -0800 | [diff] [blame] | 164 | "${AOM_ROOT}/args.c" |
| 165 | "${AOM_ROOT}/args.h" |
Tom Finegan | 03f6ca7 | 2016-11-10 13:02:48 -0800 | [diff] [blame] | 166 | "${AOM_ROOT}/md5_utils.c" |
| 167 | "${AOM_ROOT}/md5_utils.h" |
| 168 | "${AOM_ROOT}/tools_common.c" |
| 169 | "${AOM_ROOT}/tools_common.h" |
Tom Finegan | ba02c24 | 2017-05-16 15:01:54 -0700 | [diff] [blame] | 170 | "${AOM_ROOT}/video_common.h" |
| 171 | "${AOM_ROOT}/y4menc.c" |
| 172 | "${AOM_ROOT}/y4menc.h") |
Tom Finegan | 03f6ca7 | 2016-11-10 13:02:48 -0800 | [diff] [blame] | 173 | |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 174 | list(APPEND AOM_DECODER_APP_UTIL_SOURCES |
Tom Finegan | 03f6ca7 | 2016-11-10 13:02:48 -0800 | [diff] [blame] | 175 | "${AOM_ROOT}/ivfdec.c" |
| 176 | "${AOM_ROOT}/ivfdec.h" |
Tom Finegan | 61b71ab | 2018-03-22 15:58:38 -0700 | [diff] [blame] | 177 | "${AOM_ROOT}/obudec.c" |
| 178 | "${AOM_ROOT}/obudec.h" |
Tom Finegan | 03f6ca7 | 2016-11-10 13:02:48 -0800 | [diff] [blame] | 179 | "${AOM_ROOT}/video_reader.c" |
Tom Finegan | ba02c24 | 2017-05-16 15:01:54 -0700 | [diff] [blame] | 180 | "${AOM_ROOT}/video_reader.h") |
Tom Finegan | 03f6ca7 | 2016-11-10 13:02:48 -0800 | [diff] [blame] | 181 | |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 182 | list(APPEND AOM_ENCODER_APP_UTIL_SOURCES |
Tom Finegan | 03f6ca7 | 2016-11-10 13:02:48 -0800 | [diff] [blame] | 183 | "${AOM_ROOT}/ivfenc.c" |
| 184 | "${AOM_ROOT}/ivfenc.h" |
| 185 | "${AOM_ROOT}/video_writer.c" |
Tom Finegan | a89fe0e | 2017-01-19 14:38:28 -0800 | [diff] [blame] | 186 | "${AOM_ROOT}/video_writer.h" |
| 187 | "${AOM_ROOT}/warnings.c" |
| 188 | "${AOM_ROOT}/warnings.h" |
| 189 | "${AOM_ROOT}/y4minput.c" |
Urvang Joshi | 09c293e | 2017-04-20 17:56:27 -0700 | [diff] [blame] | 190 | "${AOM_ROOT}/y4minput.h" |
| 191 | "${AOM_ROOT}/examples/encoder_util.h" |
| 192 | "${AOM_ROOT}/examples/encoder_util.c") |
Tom Finegan | a89fe0e | 2017-01-19 14:38:28 -0800 | [diff] [blame] | 193 | |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 194 | list(APPEND AOM_ENCODER_STATS_SOURCES |
Tom Finegan | a89fe0e | 2017-01-19 14:38:28 -0800 | [diff] [blame] | 195 | "${AOM_ROOT}/aomstats.c" |
| 196 | "${AOM_ROOT}/aomstats.h" |
| 197 | "${AOM_ROOT}/rate_hist.c" |
| 198 | "${AOM_ROOT}/rate_hist.h") |
| 199 | |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 200 | list(APPEND AOM_PKG_CONFIG_SOURCES "${AOM_CONFIG_DIR}/aom.pc") |
Tom Finegan | 872e585 | 2017-08-29 15:15:58 -0700 | [diff] [blame] | 201 | |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 202 | list(APPEND AOM_VERSION_SOURCES "${AOM_CONFIG_DIR}/aom_version.h") |
Tom Finegan | 872e585 | 2017-08-29 15:15:58 -0700 | [diff] [blame] | 203 | |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 204 | list(APPEND AOM_WEBM_DECODER_SOURCES |
Tom Finegan | a89fe0e | 2017-01-19 14:38:28 -0800 | [diff] [blame] | 205 | "${AOM_ROOT}/webmdec.cc" |
| 206 | "${AOM_ROOT}/webmdec.h") |
| 207 | |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 208 | list(APPEND AOM_WEBM_ENCODER_SOURCES |
Tom Finegan | a89fe0e | 2017-01-19 14:38:28 -0800 | [diff] [blame] | 209 | "${AOM_ROOT}/webmenc.cc" |
| 210 | "${AOM_ROOT}/webmenc.h") |
| 211 | |
| 212 | include_directories(${AOM_ROOT} ${AOM_CONFIG_DIR}) |
Tom Finegan | 03f6ca7 | 2016-11-10 13:02:48 -0800 | [diff] [blame] | 213 | |
Tom Finegan | fc6f236 | 2016-10-24 10:39:41 -0700 | [diff] [blame] | 214 | # Targets |
Tom Finegan | 872e585 | 2017-08-29 15:15:58 -0700 | [diff] [blame] | 215 | add_library(aom_version ${AOM_VERSION_SOURCES}) |
| 216 | add_dummy_source_file_to_target(aom_version c) |
| 217 | add_custom_command( |
| 218 | OUTPUT "${AOM_CONFIG_DIR}/aom_version.h" |
| 219 | COMMAND ${CMAKE_COMMAND} |
| 220 | ARGS -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} |
| 221 | -DAOM_ROOT=${AOM_ROOT} |
| 222 | -DGIT_EXECUTABLE=${GIT_EXECUTABLE} |
| 223 | -DPERL_EXECUTABLE=${PERL_EXECUTABLE} |
| 224 | -P "${AOM_ROOT}/build/cmake/version.cmake" |
| 225 | COMMENT "Writing aom_version.h" |
| 226 | VERBATIM) |
| 227 | |
| 228 | add_custom_target(aom_version_check |
| 229 | COMMAND ${CMAKE_COMMAND} |
| 230 | -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} |
| 231 | -DAOM_ROOT=${AOM_ROOT} |
| 232 | -DGIT_EXECUTABLE=${GIT_EXECUTABLE} |
| 233 | -DPERL_EXECUTABLE=${PERL_EXECUTABLE} |
| 234 | -P "${AOM_ROOT}/build/cmake/version.cmake" |
| 235 | COMMENT "Updating version info if necessary." |
| 236 | VERBATIM) |
| 237 | add_dependencies(aom_version aom_version_check) |
| 238 | |
| 239 | if (NOT MSVC) |
| 240 | add_library(aom_pc ${AOM_PKG_CONFIG_SOURCES}) |
| 241 | add_dummy_source_file_to_target(aom_pc c) |
| 242 | add_custom_command( |
| 243 | OUTPUT "${AOM_CONFIG_DIR}/aom.pc" |
| 244 | COMMAND ${CMAKE_COMMAND} |
| 245 | ARGS -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} |
| 246 | -DAOM_ROOT=${AOM_ROOT} |
Tom Finegan | 40b2a97 | 2017-09-25 09:45:27 -0700 | [diff] [blame] | 247 | -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} |
Tom Finegan | 872e585 | 2017-08-29 15:15:58 -0700 | [diff] [blame] | 248 | -DCMAKE_PROJECT_NAME=${CMAKE_PROJECT_NAME} |
| 249 | -DCONFIG_MULTITHREAD=${CONFIG_MULTITHREAD} |
| 250 | -DHAVE_PTHREAD_H=${HAVE_PTHREAD_H} |
| 251 | -P "${AOM_ROOT}/build/cmake/pkg_config.cmake" |
| 252 | COMMENT "Writing aom.pc" |
| 253 | VERBATIM) |
Tom Finegan | 00b4df7 | 2017-09-01 11:30:34 -0700 | [diff] [blame] | 254 | add_dependencies(aom_pc aom_version) |
Tom Finegan | 872e585 | 2017-08-29 15:15:58 -0700 | [diff] [blame] | 255 | endif () |
Tom Finegan | 872e585 | 2017-08-29 15:15:58 -0700 | [diff] [blame] | 256 | |
Tom Finegan | f0d1444 | 2017-03-01 20:42:51 -0800 | [diff] [blame] | 257 | # TODO(tomfinegan): Move rtcd target setup where it belongs for each rtcd |
| 258 | # source. |
Tom Finegan | a0c21f0 | 2017-02-01 11:11:09 -0800 | [diff] [blame] | 259 | add_rtcd_build_step("${AOM_ROOT}/aom_dsp/aom_dsp_rtcd_defs.pl" |
| 260 | "${AOM_CONFIG_DIR}/aom_dsp_rtcd.h" |
| 261 | "${AOM_ROOT}/aom_dsp/aom_dsp_rtcd.c" |
| 262 | "aom_dsp_rtcd") |
| 263 | add_rtcd_build_step("${AOM_ROOT}/aom_scale/aom_scale_rtcd.pl" |
| 264 | "${AOM_CONFIG_DIR}/aom_scale_rtcd.h" |
| 265 | "${AOM_ROOT}/aom_scale/aom_scale_rtcd.c" |
| 266 | "aom_scale_rtcd") |
| 267 | add_rtcd_build_step("${AOM_ROOT}/av1/common/av1_rtcd_defs.pl" |
| 268 | "${AOM_CONFIG_DIR}/av1_rtcd.h" |
| 269 | "${AOM_ROOT}/av1/common/av1_rtcd.c" |
| 270 | "av1_rtcd") |
Tom Finegan | 85ac13e | 2017-02-22 15:09:20 -0800 | [diff] [blame] | 271 | |
Tom Finegan | a0c21f0 | 2017-02-01 11:11:09 -0800 | [diff] [blame] | 272 | add_library(aom_rtcd OBJECT ${AOM_RTCD_SOURCES}) |
Tom Finegan | 872e585 | 2017-08-29 15:15:58 -0700 | [diff] [blame] | 273 | add_dependencies(aom_rtcd aom_version) |
| 274 | |
Tom Finegan | a7ed143 | 2017-02-08 10:34:40 -0800 | [diff] [blame] | 275 | add_library(aom_encoder_stats OBJECT ${AOM_ENCODER_STATS_SOURCES}) |
Tom Finegan | b7d0254 | 2017-03-01 21:14:28 -0800 | [diff] [blame] | 276 | add_library(aom ${AOM_SOURCES} $<TARGET_OBJECTS:aom_rtcd>) |
Tom Finegan | 03f6ca7 | 2016-11-10 13:02:48 -0800 | [diff] [blame] | 277 | |
Tom Finegan | 3e8986b | 2017-09-29 17:08:31 -0700 | [diff] [blame] | 278 | if (NOT MSVC AND NOT APPLE) |
| 279 | target_link_libraries(aom ${AOM_LIB_LINK_TYPE} m) |
| 280 | endif () |
| 281 | |
Tom Finegan | a0c21f0 | 2017-02-01 11:11:09 -0800 | [diff] [blame] | 282 | # List of object and static library targets. |
Tom Finegan | b7d0254 | 2017-03-01 21:14:28 -0800 | [diff] [blame] | 283 | set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_rtcd aom_encoder_stats aom_mem |
| 284 | aom_scale aom) |
Tom Finegan | a0c21f0 | 2017-02-01 11:11:09 -0800 | [diff] [blame] | 285 | |
Tom Finegan | 507e2e1 | 2017-03-01 19:58:19 -0800 | [diff] [blame] | 286 | # Setup dependencies. |
Tom Finegan | 85ac13e | 2017-02-22 15:09:20 -0800 | [diff] [blame] | 287 | setup_aom_dsp_targets() |
Tom Finegan | dd6d057 | 2017-03-01 19:01:23 -0800 | [diff] [blame] | 288 | setup_aom_mem_targets() |
Tom Finegan | 507e2e1 | 2017-03-01 19:58:19 -0800 | [diff] [blame] | 289 | setup_aom_ports_targets() |
Tom Finegan | b7d0254 | 2017-03-01 21:14:28 -0800 | [diff] [blame] | 290 | setup_aom_util_targets() |
Tom Finegan | f0d1444 | 2017-03-01 20:42:51 -0800 | [diff] [blame] | 291 | setup_aom_scale_targets() |
Tom Finegan | 44916e7 | 2017-02-27 14:12:31 -0800 | [diff] [blame] | 292 | setup_av1_targets() |
Tom Finegan | 85ac13e | 2017-02-22 15:09:20 -0800 | [diff] [blame] | 293 | |
Tom Finegan | a0c21f0 | 2017-02-01 11:11:09 -0800 | [diff] [blame] | 294 | # Make all library targets depend on aom_rtcd to make sure it builds first. |
| 295 | foreach (aom_lib ${AOM_LIB_TARGETS}) |
| 296 | if (NOT "${aom_lib}" STREQUAL "aom_rtcd") |
| 297 | add_dependencies(${aom_lib} aom_rtcd) |
| 298 | endif () |
| 299 | endforeach () |
Tom Finegan | ba02c24 | 2017-05-16 15:01:54 -0700 | [diff] [blame] | 300 | |
Tom Finegan | ff86395 | 2017-12-22 11:41:14 -0800 | [diff] [blame] | 301 | # Generate C/C++ stub files containing the function usage_exit(). Users of the |
Tom Finegan | e91bb45 | 2017-09-29 11:40:24 -0700 | [diff] [blame] | 302 | # aom_common_app_util library must define this function. This is a convenience |
| 303 | # to allow omission of the function from applications that might want to use |
Tom Finegan | ff86395 | 2017-12-22 11:41:14 -0800 | [diff] [blame] | 304 | # other pieces of the util support without defining usage_exit(). |
Tom Finegan | e91bb45 | 2017-09-29 11:40:24 -0700 | [diff] [blame] | 305 | file(WRITE "${AOM_CONFIG_DIR}/usage_exit.c" "void usage_exit(void) {}") |
Tom Finegan | ff86395 | 2017-12-22 11:41:14 -0800 | [diff] [blame] | 306 | file(WRITE "${AOM_CONFIG_DIR}/usage_exit.cc" |
| 307 | "extern \"C\" void usage_exit(void) {}") |
Tom Finegan | 03f6ca7 | 2016-11-10 13:02:48 -0800 | [diff] [blame] | 308 | |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 309 | # |
| 310 | # Application and application support targets. |
| 311 | # |
| 312 | if (CONFIG_UNIT_TESTS OR ENABLE_EXAMPLES OR ENABLE_TOOLS) |
| 313 | add_library(aom_common_app_util OBJECT ${AOM_COMMON_APP_UTIL_SOURCES}) |
| 314 | if (CONFIG_AV1_DECODER) |
| 315 | add_library(aom_decoder_app_util OBJECT ${AOM_DECODER_APP_UTIL_SOURCES}) |
James Zern | 4138740 | 2018-03-03 13:53:17 -0800 | [diff] [blame] | 316 | # obudec depends on internal headers that require *rtcd.h |
Tom Finegan | 61b71ab | 2018-03-22 15:58:38 -0700 | [diff] [blame] | 317 | add_dependencies(aom_decoder_app_util aom_rtcd) |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 318 | endif () |
| 319 | if (CONFIG_AV1_ENCODER) |
| 320 | add_library(aom_encoder_app_util OBJECT ${AOM_ENCODER_APP_UTIL_SOURCES}) |
| 321 | endif () |
| 322 | endif () |
| 323 | |
| 324 | if (CONFIG_AV1_DECODER AND ENABLE_EXAMPLES) |
Tom Finegan | ba02c24 | 2017-05-16 15:01:54 -0700 | [diff] [blame] | 325 | add_executable(aomdec |
Tom Finegan | 84f2d79 | 2017-06-15 23:06:44 -0700 | [diff] [blame] | 326 | "${AOM_ROOT}/aomdec.c" |
| 327 | $<TARGET_OBJECTS:aom_common_app_util> |
| 328 | $<TARGET_OBJECTS:aom_decoder_app_util>) |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 329 | add_executable(decode_to_md5 |
| 330 | "${AOM_ROOT}/examples/decode_to_md5.c" |
| 331 | $<TARGET_OBJECTS:aom_common_app_util> |
| 332 | $<TARGET_OBJECTS:aom_decoder_app_util>) |
| 333 | add_executable(decode_with_drops |
| 334 | "${AOM_ROOT}/examples/decode_with_drops.c" |
| 335 | $<TARGET_OBJECTS:aom_common_app_util> |
| 336 | $<TARGET_OBJECTS:aom_decoder_app_util>) |
| 337 | add_executable(simple_decoder |
| 338 | "${AOM_ROOT}/examples/simple_decoder.c" |
| 339 | $<TARGET_OBJECTS:aom_common_app_util> |
| 340 | $<TARGET_OBJECTS:aom_decoder_app_util>) |
Yaowu Xu | 7f313c0 | 2018-03-28 12:50:16 -0700 | [diff] [blame] | 341 | add_executable(scalable_decoder |
| 342 | "${AOM_ROOT}/examples/scalable_decoder.c" |
| 343 | $<TARGET_OBJECTS:aom_common_app_util> |
| 344 | $<TARGET_OBJECTS:aom_decoder_app_util>) |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 345 | |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 346 | if (CONFIG_ANALYZER) |
| 347 | add_executable(analyzer |
| 348 | "${AOM_ROOT}/examples/analyzer.cc" |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 349 | $<TARGET_OBJECTS:aom_common_app_util> |
| 350 | $<TARGET_OBJECTS:aom_decoder_app_util>) |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 351 | target_link_libraries(analyzer |
| 352 | ${AOM_LIB_LINK_TYPE} ${wxWidgets_LIBRARIES}) |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 353 | list(APPEND AOM_APP_TARGETS analyzer) |
| 354 | list(APPEND AOM_DECODER_EXAMPLE_TARGETS analyzer) |
Tom Finegan | ba02c24 | 2017-05-16 15:01:54 -0700 | [diff] [blame] | 355 | endif () |
| 356 | |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 357 | if (CONFIG_INSPECTION) |
| 358 | add_executable(inspect |
| 359 | "${AOM_ROOT}/examples/inspect.c" |
| 360 | $<TARGET_OBJECTS:aom_common_app_util> |
| 361 | $<TARGET_OBJECTS:aom_decoder_app_util>) |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 362 | list(APPEND AOM_DECODER_EXAMPLE_TARGETS inspect) |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 363 | |
| 364 | if (EMSCRIPTEN) |
| 365 | add_preproc_definition(_POSIX_SOURCE) |
Thomas Daede | 32fc407 | 2018-01-12 04:04:24 -0800 | [diff] [blame] | 366 | append_link_flag_to_target("inspect" "-s TOTAL_MEMORY=402653184") |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 367 | append_link_flag_to_target("inspect" "-s MODULARIZE=1") |
| 368 | append_link_flag_to_target("inspect" |
| 369 | "-s EXPORT_NAME=\"\'DecoderModule\'\"") |
| 370 | append_link_flag_to_target("inspect" "--memory-init-file 0") |
| 371 | |
| 372 | if ("${CMAKE_BUILD_TYPE}" STREQUAL "") |
| 373 | # Default to -O3 when no build type specified. |
| 374 | append_compiler_flag("-O3") |
| 375 | endif () |
| 376 | |
| 377 | em_link_post_js(inspect "${AOM_ROOT}/tools/inspect-post.js") |
| 378 | endif () |
| 379 | endif () |
| 380 | |
| 381 | # Maintain a list of decoder example targets. |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 382 | list(APPEND AOM_DECODER_EXAMPLE_TARGETS |
| 383 | aomdec decode_to_md5 decode_with_drops scalable_decoder simple_decoder) |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 384 | |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 385 | # Add decoder examples to the app targets list. |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 386 | list(APPEND AOM_APP_TARGETS ${AOM_DECODER_EXAMPLE_TARGETS}) |
Michael Bebenita | f4f27fe | 2017-03-02 17:40:44 -0800 | [diff] [blame] | 387 | endif () |
| 388 | |
Tom Finegan | ba02c24 | 2017-05-16 15:01:54 -0700 | [diff] [blame] | 389 | if (CONFIG_AV1_ENCODER) |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 390 | if (ENABLE_EXAMPLES) |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 391 | add_executable(aomenc |
| 392 | "${AOM_ROOT}/aomenc.c" |
| 393 | $<TARGET_OBJECTS:aom_common_app_util> |
| 394 | $<TARGET_OBJECTS:aom_encoder_app_util> |
| 395 | $<TARGET_OBJECTS:aom_encoder_stats>) |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 396 | add_executable(lossless_encoder |
| 397 | "${AOM_ROOT}/examples/lossless_encoder.c" |
Tom Finegan | e91bb45 | 2017-09-29 11:40:24 -0700 | [diff] [blame] | 398 | $<TARGET_OBJECTS:aom_common_app_util> |
| 399 | $<TARGET_OBJECTS:aom_encoder_app_util>) |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 400 | add_executable(set_maps |
| 401 | "${AOM_ROOT}/examples/set_maps.c" |
| 402 | $<TARGET_OBJECTS:aom_common_app_util> |
| 403 | $<TARGET_OBJECTS:aom_encoder_app_util>) |
| 404 | add_executable(simple_encoder |
| 405 | "${AOM_ROOT}/examples/simple_encoder.c" |
| 406 | $<TARGET_OBJECTS:aom_common_app_util> |
| 407 | $<TARGET_OBJECTS:aom_encoder_app_util>) |
| 408 | add_executable(twopass_encoder |
| 409 | "${AOM_ROOT}/examples/twopass_encoder.c" |
| 410 | $<TARGET_OBJECTS:aom_common_app_util> |
| 411 | $<TARGET_OBJECTS:aom_encoder_app_util>) |
Yaowu Xu | c7119a7 | 2018-03-29 09:59:37 -0700 | [diff] [blame] | 412 | add_executable(noise_model |
| 413 | "${AOM_ROOT}/examples/noise_model.c" |
| 414 | $<TARGET_OBJECTS:aom_common_app_util> |
| 415 | $<TARGET_OBJECTS:aom_encoder_app_util>) |
| 416 | add_executable(scalable_encoder |
| 417 | "${AOM_ROOT}/examples/scalable_encoder.c" |
| 418 | $<TARGET_OBJECTS:aom_common_app_util> |
| 419 | $<TARGET_OBJECTS:aom_encoder_app_util>) |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 420 | |
| 421 | # Maintain a list of encoder example targets. |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 422 | list(APPEND AOM_ENCODER_EXAMPLE_TARGETS |
| 423 | aomenc lossless_encoder noise_model set_maps simple_encoder |
| 424 | scalable_encoder twopass_encoder) |
Tom Finegan | e91bb45 | 2017-09-29 11:40:24 -0700 | [diff] [blame] | 425 | endif () |
| 426 | |
Tom Finegan | bac9907 | 2017-10-11 09:16:54 -0700 | [diff] [blame] | 427 | if (ENABLE_TOOLS) |
| 428 | if (CONFIG_ENTROPY_STATS AND NOT BUILD_SHARED_LIBS) |
| 429 | # TODO(tomfinegan): Sort out why a simple link command with |
| 430 | # aom_entropy_optimizer.c won't work on macos, but dragging in all the |
| 431 | # helper machinery allows the link to succeed. |
| 432 | add_executable(aom_entropy_optimizer |
| 433 | "${AOM_CONFIG_DIR}/usage_exit.c" |
| 434 | "${AOM_ROOT}/tools/aom_entropy_optimizer.c" |
| 435 | $<TARGET_OBJECTS:aom_common_app_util> |
| 436 | $<TARGET_OBJECTS:aom_encoder_app_util>) |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 437 | |
Tom Finegan | bac9907 | 2017-10-11 09:16:54 -0700 | [diff] [blame] | 438 | # Maintain a list of encoder tool targets. |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 439 | list(APPEND AOM_ENCODER_TOOL_TARGETS aom_entropy_optimizer) |
Tom Finegan | bac9907 | 2017-10-11 09:16:54 -0700 | [diff] [blame] | 440 | endif () |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 441 | endif () |
Tom Finegan | bac9907 | 2017-10-11 09:16:54 -0700 | [diff] [blame] | 442 | |
| 443 | # Add encoder examples and tools to the targets list. |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 444 | list(APPEND AOM_APP_TARGETS |
| 445 | ${AOM_ENCODER_EXAMPLE_TARGETS} ${AOM_ENCODER_TOOL_TARGETS}) |
Tom Finegan | ba02c24 | 2017-05-16 15:01:54 -0700 | [diff] [blame] | 446 | endif () |
| 447 | |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 448 | if (ENABLE_EXAMPLES) |
| 449 | # Maintain a separate variable listing only the examples to facilitate |
| 450 | # installation of example programs into an examples sub directory of |
| 451 | # $AOM_DIST_DIR/bin when building the dist target. |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 452 | list(APPEND AOM_EXAMPLE_TARGETS |
| 453 | ${AOM_DECODER_EXAMPLE_TARGETS} ${AOM_ENCODER_EXAMPLE_TARGETS}) |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 454 | endif () |
Tom Finegan | 7897567 | 2017-05-30 08:55:54 -0700 | [diff] [blame] | 455 | |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 456 | if (ENABLE_TOOLS) |
Yaowu Xu | d29ea97 | 2018-02-22 09:50:58 -0800 | [diff] [blame] | 457 | if (CONFIG_AV1_DECODER) |
Tom Finegan | ff86395 | 2017-12-22 11:41:14 -0800 | [diff] [blame] | 458 | require_cxx_flag_nomsvc("-std=c++11" NO) |
Tom Finegan | c019233 | 2017-12-02 09:31:45 -0800 | [diff] [blame] | 459 | add_executable(dump_obu |
Tom Finegan | ff86395 | 2017-12-22 11:41:14 -0800 | [diff] [blame] | 460 | "${AOM_CONFIG_DIR}/usage_exit.cc" |
Tom Finegan | c019233 | 2017-12-02 09:31:45 -0800 | [diff] [blame] | 461 | "${AOM_ROOT}/tools/dump_obu.cc" |
| 462 | "${AOM_ROOT}/tools/obu_parser.cc" |
| 463 | "${AOM_ROOT}/tools/obu_parser.h" |
| 464 | $<TARGET_OBJECTS:aom_common_app_util> |
| 465 | $<TARGET_OBJECTS:aom_decoder_app_util>) |
Tom Finegan | ff86395 | 2017-12-22 11:41:14 -0800 | [diff] [blame] | 466 | |
Tom Finegan | c019233 | 2017-12-02 09:31:45 -0800 | [diff] [blame] | 467 | list(APPEND AOM_TOOL_TARGETS dump_obu) |
| 468 | list(APPEND AOM_APP_TARGETS dump_obu) |
Tom Finegan | c019233 | 2017-12-02 09:31:45 -0800 | [diff] [blame] | 469 | |
Tom Finegan | ff86395 | 2017-12-22 11:41:14 -0800 | [diff] [blame] | 470 | if (NOT MSVC) |
| 471 | target_compile_options(dump_obu PUBLIC -std=c++11) |
| 472 | # TODO(tomfinegan): This can go once the GCC pragma in libwebm is updated |
| 473 | # to silence the auto_ptr warnings for GCC >= v4. |
| 474 | target_compile_options(dump_obu PUBLIC -Wno-deprecated-declarations) |
| 475 | endif () |
| 476 | |
| 477 | # Maintain a separate variable listing only the examples to facilitate |
| 478 | # installation of example programs into an tools sub directory of |
| 479 | # $AOM_DIST_DIR/bin when building the dist target. |
| 480 | list(APPEND AOM_TOOL_TARGETS |
| 481 | ${AOM_DECODER_TOOL_TARGETS} ${AOM_ENCODER_TOOL_TARGETS}) |
| 482 | endif () |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 483 | endif () |
Tom Finegan | e91bb45 | 2017-09-29 11:40:24 -0700 | [diff] [blame] | 484 | |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 485 | if (ENABLE_EXAMPLES AND CONFIG_AV1_DECODER AND CONFIG_AV1_ENCODER) |
Tom Finegan | ba02c24 | 2017-05-16 15:01:54 -0700 | [diff] [blame] | 486 | add_executable(aom_cx_set_ref |
| 487 | "${AOM_ROOT}/examples/aom_cx_set_ref.c" |
| 488 | $<TARGET_OBJECTS:aom_common_app_util> |
| 489 | $<TARGET_OBJECTS:aom_encoder_app_util>) |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 490 | list(APPEND AOM_EXAMPLE_TARGETS aom_cx_set_ref) |
| 491 | list(APPEND AOM_APP_TARGETS aom_cx_set_ref) |
Tom Finegan | ba02c24 | 2017-05-16 15:01:54 -0700 | [diff] [blame] | 492 | endif () |
Tom Finegan | 8127980 | 2017-02-01 11:27:05 -0800 | [diff] [blame] | 493 | |
| 494 | foreach (aom_app ${AOM_APP_TARGETS}) |
Tom Finegan | d46b4d3 | 2017-05-09 09:14:03 -0700 | [diff] [blame] | 495 | target_link_libraries(${aom_app} ${AOM_LIB_LINK_TYPE} aom) |
Tom Finegan | 8127980 | 2017-02-01 11:27:05 -0800 | [diff] [blame] | 496 | endforeach () |
Tom Finegan | fc6f236 | 2016-10-24 10:39:41 -0700 | [diff] [blame] | 497 | |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 498 | if (CONFIG_UNIT_TESTS OR ENABLE_EXAMPLES OR ENABLE_TOOLS) |
| 499 | if (CONFIG_LIBYUV) |
| 500 | add_library(yuv OBJECT ${AOM_LIBYUV_SOURCES}) |
| 501 | if (NOT MSVC) |
| 502 | target_compile_options(yuv PRIVATE -Wno-unused-parameter) |
| 503 | endif () |
| 504 | include_directories("${AOM_ROOT}/third_party/libyuv/include") |
Tom Finegan | 9cd9700 | 2016-11-09 10:37:44 -0800 | [diff] [blame] | 505 | |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 506 | # Add to existing targets. |
| 507 | foreach (aom_app ${AOM_APP_TARGETS}) |
| 508 | target_sources(${aom_app} PRIVATE $<TARGET_OBJECTS:yuv>) |
| 509 | set_property(TARGET ${aom_app} PROPERTY LINKER_LANGUAGE CXX) |
| 510 | endforeach () |
Tom Finegan | 87fdc28 | 2017-02-10 10:30:28 -0800 | [diff] [blame] | 511 | endif () |
Tom Finegan | 957fe82 | 2016-11-09 10:37:27 -0800 | [diff] [blame] | 512 | |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 513 | if (CONFIG_WEBM_IO) |
| 514 | add_library(webm OBJECT ${AOM_LIBWEBM_SOURCES}) |
| 515 | include_directories("${AOM_ROOT}/third_party/libwebm") |
| 516 | target_compile_definitions(webm PRIVATE __STDC_CONSTANT_MACROS) |
| 517 | target_compile_definitions(webm PRIVATE __STDC_LIMIT_MACROS) |
Tom Finegan | ba02c24 | 2017-05-16 15:01:54 -0700 | [diff] [blame] | 518 | |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 519 | if (NOT MSVC) |
| 520 | target_compile_options(webm PRIVATE -Wno-shadow) |
| 521 | endif () |
Tom Finegan | 8127980 | 2017-02-01 11:27:05 -0800 | [diff] [blame] | 522 | |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 523 | # Add to existing targets. |
| 524 | if (CONFIG_AV1_DECODER) |
| 525 | target_sources(aom_decoder_app_util PRIVATE ${AOM_WEBM_DECODER_SOURCES}) |
| 526 | endif () |
| 527 | |
| 528 | if (CONFIG_AV1_ENCODER) |
| 529 | target_sources(aom_encoder_app_util PRIVATE ${AOM_WEBM_ENCODER_SOURCES}) |
| 530 | endif () |
| 531 | |
| 532 | foreach (aom_app ${AOM_APP_TARGETS}) |
| 533 | target_sources(${aom_app} PRIVATE $<TARGET_OBJECTS:webm>) |
| 534 | set_property(TARGET ${aom_app} PROPERTY LINKER_LANGUAGE CXX) |
| 535 | endforeach () |
| 536 | endif () |
Tom Finegan | 957fe82 | 2016-11-09 10:37:27 -0800 | [diff] [blame] | 537 | endif () |
Tom Finegan | 7ba9ba8 | 2017-01-23 14:04:28 -0800 | [diff] [blame] | 538 | |
| 539 | if (CONFIG_UNIT_TESTS) |
Tom Finegan | 4db04d3 | 2017-02-23 14:37:27 -0800 | [diff] [blame] | 540 | # Create test_libaom target and the targets it depends on. |
| 541 | setup_aom_test_targets() |
Tom Finegan | 7ba9ba8 | 2017-01-23 14:04:28 -0800 | [diff] [blame] | 542 | endif () |
Tom Finegan | 9412ec3 | 2017-02-01 11:41:43 -0800 | [diff] [blame] | 543 | |
Tom Finegan | 606f646 | 2017-03-06 11:18:29 -0800 | [diff] [blame] | 544 | if (HAVE_PTHREAD_H AND CONFIG_MULTITHREAD) |
| 545 | find_package(Threads) |
| 546 | foreach (app_target ${AOM_APP_TARGETS}) |
Tom Finegan | d46b4d3 | 2017-05-09 09:14:03 -0700 | [diff] [blame] | 547 | target_link_libraries(${app_target} ${AOM_LIB_LINK_TYPE} Threads::Threads) |
Tom Finegan | 606f646 | 2017-03-06 11:18:29 -0800 | [diff] [blame] | 548 | endforeach () |
| 549 | endif () |
| 550 | |
Tom Finegan | 9412ec3 | 2017-02-01 11:41:43 -0800 | [diff] [blame] | 551 | if (XCODE) |
Tom Finegan | db37c75 | 2017-11-30 17:02:27 -0800 | [diff] [blame] | 552 | # TODO(tomfinegan): Make sure target has no C++ files before doing this as |
| 553 | # it's not necessary in that case. |
Tom Finegan | 9412ec3 | 2017-02-01 11:41:43 -0800 | [diff] [blame] | 554 | if (CONFIG_LIBYUV OR CONFIG_WEBM_IO) |
| 555 | # The Xcode generator does not obey LINKER_LANGUAGE. Because of the issue |
| 556 | # what looks like a C++ file needs to be in any target that Xcode will link |
| 557 | # when the target contains a C++ dependency. |
| 558 | # Without this Xcode will try to link with the C linker, which always ends |
| 559 | # badly when a dependency actually includes C++. |
| 560 | # Note: LINKER_LANGUAGE is explicitly set to C++ for all targets touched |
| 561 | # here, it really is the Xcode generator's fault, or just a deficiency in |
| 562 | # Xcode itself. |
Tom Finegan | 9412ec3 | 2017-02-01 11:41:43 -0800 | [diff] [blame] | 563 | foreach (aom_app ${AOM_APP_TARGETS}) |
Tom Finegan | 84f2d79 | 2017-06-15 23:06:44 -0700 | [diff] [blame] | 564 | add_dummy_source_file_to_target("${aom_app}" "cc") |
Tom Finegan | 9412ec3 | 2017-02-01 11:41:43 -0800 | [diff] [blame] | 565 | endforeach () |
| 566 | endif () |
| 567 | endif () |
Tom Finegan | 0a4ef08 | 2017-03-31 11:07:34 -0700 | [diff] [blame] | 568 | |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 569 | if (ENABLE_EXAMPLES AND "${CMAKE_GENERATOR}" MATCHES "Makefiles$") |
Johann | e07a675 | 2018-01-10 12:47:44 -0800 | [diff] [blame] | 570 | # For historical purposes place the example binaries in the example directory. |
Tom Finegan | 7897567 | 2017-05-30 08:55:54 -0700 | [diff] [blame] | 571 | file(MAKE_DIRECTORY "${AOM_CONFIG_DIR}/examples") |
Tom Finegan | 938172c | 2017-10-07 13:58:34 -0700 | [diff] [blame] | 572 | |
| 573 | foreach (target ${AOM_EXAMPLE_TARGETS}) |
| 574 | if (NOT "${target}" MATCHES "aomdec\|aomenc") |
| 575 | set_target_properties(${target} PROPERTIES |
| 576 | RUNTIME_OUTPUT_DIRECTORY |
| 577 | "${AOM_CONFIG_DIR}/examples") |
| 578 | endif () |
| 579 | endforeach () |
Tom Finegan | e91bb45 | 2017-09-29 11:40:24 -0700 | [diff] [blame] | 580 | |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 581 | if (ENABLE_TOOLS AND AOM_TOOL_TARGETS) |
Tom Finegan | e91bb45 | 2017-09-29 11:40:24 -0700 | [diff] [blame] | 582 | # The same expectation is true for tool targets. |
| 583 | file(MAKE_DIRECTORY "${AOM_CONFIG_DIR}/tools") |
| 584 | set_target_properties(${AOM_TOOL_TARGETS} PROPERTIES |
| 585 | RUNTIME_OUTPUT_DIRECTORY "${AOM_CONFIG_DIR}/tools") |
| 586 | endif () |
Tom Finegan | 7897567 | 2017-05-30 08:55:54 -0700 | [diff] [blame] | 587 | endif () |
| 588 | |
Tom Finegan | 84f2d79 | 2017-06-15 23:06:44 -0700 | [diff] [blame] | 589 | if (BUILD_SHARED_LIBS) |
| 590 | include("${AOM_ROOT}/build/cmake/exports.cmake") |
| 591 | setup_exports_target() |
Tom Finegan | 4a3a9c0 | 2017-07-14 08:34:20 -0700 | [diff] [blame] | 592 | set_target_properties(aom PROPERTIES SOVERSION 0) |
Tom Finegan | 84f2d79 | 2017-06-15 23:06:44 -0700 | [diff] [blame] | 593 | endif () |
| 594 | |
Tom Finegan | c859398 | 2017-09-05 11:01:09 -0700 | [diff] [blame] | 595 | # Handle user supplied compile and link flags last to ensure they're obeyed. |
| 596 | set_user_flags() |
| 597 | |
Tom Finegan | 0d066ce | 2017-05-30 11:07:05 -0700 | [diff] [blame] | 598 | # Aomedia documentation rule. |
| 599 | if (ENABLE_DOCS) |
| 600 | include(FindDoxygen) |
| 601 | if (DOXYGEN_FOUND) |
| 602 | include("${AOM_ROOT}/docs.cmake") |
| 603 | setup_documentation_targets() |
| 604 | else () |
| 605 | message("--- Cannot find doxygen, ENABLE_DOCS turned off.") |
| 606 | set(ENABLE_DOCS OFF) |
| 607 | endif () |
| 608 | endif () |
| 609 | |
Tom Finegan | 0a4ef08 | 2017-03-31 11:07:34 -0700 | [diff] [blame] | 610 | # Aomedia install rule. |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 611 | list(APPEND AOM_INSTALL_INCS |
| 612 | "${AOM_ROOT}/aom/aom.h" |
| 613 | "${AOM_ROOT}/aom/aom_codec.h" |
| 614 | "${AOM_ROOT}/aom/aom_frame_buffer.h" |
| 615 | "${AOM_ROOT}/aom/aom_image.h" |
| 616 | "${AOM_ROOT}/aom/aom_integer.h" |
| 617 | "${AOM_ROOT}/aom/aom.h") |
Tom Finegan | ba02c24 | 2017-05-16 15:01:54 -0700 | [diff] [blame] | 618 | |
| 619 | if (CONFIG_AV1_DECODER) |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 620 | if (ENABLE_EXAMPLES) |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 621 | list(APPEND AOM_INSTALL_BINS aomdec) |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 622 | endif () |
| 623 | |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 624 | list(APPEND AOM_INSTALL_INCS |
Tom Finegan | ba02c24 | 2017-05-16 15:01:54 -0700 | [diff] [blame] | 625 | "${AOM_ROOT}/aom/aom_decoder.h" |
| 626 | "${AOM_ROOT}/aom/aomdx.h") |
| 627 | endif () |
| 628 | |
| 629 | if (CONFIG_AV1_ENCODER) |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 630 | if (ENABLE_EXAMPLES) |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 631 | list(APPEND AOM_INSTALL_BINS aomenc) |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 632 | endif () |
| 633 | |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 634 | list(APPEND AOM_INSTALL_INCS |
| 635 | "${AOM_ROOT}/aom/aomcx.h" |
| 636 | "${AOM_ROOT}/aom/aom_encoder.h") |
Tom Finegan | ba02c24 | 2017-05-16 15:01:54 -0700 | [diff] [blame] | 637 | endif () |
| 638 | |
Tom Finegan | 0a4ef08 | 2017-03-31 11:07:34 -0700 | [diff] [blame] | 639 | set(AOM_INSTALL_LIBS aom) |
| 640 | |
| 641 | install(FILES ${AOM_INSTALL_INCS} |
Robert-André Mauchin | ede351b | 2018-03-07 18:09:18 +0100 | [diff] [blame] | 642 | DESTINATION "${INCLUDE_INSTALL_DIR}/aom") |
Tom Finegan | 782cdc1 | 2017-05-12 10:08:53 -0700 | [diff] [blame] | 643 | install(FILES "${AOM_CONFIG_DIR}/aom.pc" |
Robert-André Mauchin | ede351b | 2018-03-07 18:09:18 +0100 | [diff] [blame] | 644 | DESTINATION "${LIB_INSTALL_DIR}/pkgconfig") |
| 645 | install(TARGETS ${AOM_INSTALL_LIBS} DESTINATION "${LIB_INSTALL_DIR}") |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 646 | |
| 647 | if (ENABLE_EXAMPLES) |
| 648 | install(TARGETS ${AOM_INSTALL_BINS} DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") |
| 649 | endif () |
Tom Finegan | 0d066ce | 2017-05-30 11:07:05 -0700 | [diff] [blame] | 650 | |
Tom Finegan | 7897567 | 2017-05-30 08:55:54 -0700 | [diff] [blame] | 651 | # Aomedia dist rule. |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 652 | if (CONFIG_AV1_DECODER AND ENABLE_EXAMPLES) |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 653 | list(APPEND AOM_DIST_APPS $<TARGET_FILE:aomdec>) |
Tom Finegan | 7897567 | 2017-05-30 08:55:54 -0700 | [diff] [blame] | 654 | endif () |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 655 | if (CONFIG_AV1_ENCODER AND ENABLE_EXAMPLES) |
Tom Finegan | 393b79b | 2018-05-02 10:49:56 -0700 | [diff] [blame^] | 656 | list(APPEND AOM_DIST_APPS $<TARGET_FILE:aomenc>) |
Tom Finegan | 7897567 | 2017-05-30 08:55:54 -0700 | [diff] [blame] | 657 | endif () |
| 658 | |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 659 | if (ENABLE_EXAMPLES) |
| 660 | foreach (example ${AOM_EXAMPLE_TARGETS}) |
| 661 | list(APPEND AOM_DIST_EXAMPLES $<TARGET_FILE:${example}>) |
| 662 | endforeach () |
| 663 | endif () |
Tom Finegan | 7897567 | 2017-05-30 08:55:54 -0700 | [diff] [blame] | 664 | |
Tom Finegan | 9befd17 | 2017-09-29 15:19:19 -0700 | [diff] [blame] | 665 | if (ENABLE_TOOLS) |
| 666 | foreach (tool ${AOM_TOOL_TARGETS}) |
| 667 | list(APPEND AOM_DIST_TOOLS $<TARGET_FILE:${tool}>) |
| 668 | endforeach () |
| 669 | endif () |
Tom Finegan | e91bb45 | 2017-09-29 11:40:24 -0700 | [diff] [blame] | 670 | |
Tom Finegan | 7897567 | 2017-05-30 08:55:54 -0700 | [diff] [blame] | 671 | if (NOT AOM_DIST_DIR) |
| 672 | set(AOM_DIST_DIR "${AOM_CONFIG_DIR}/dist") |
| 673 | endif () |
| 674 | |
| 675 | add_custom_target(dist |
| 676 | COMMAND ${CMAKE_COMMAND} |
| 677 | -DAOM_ROOT=${AOM_ROOT} |
| 678 | -DAOM_CONFIG_DIR=${AOM_CONFIG_DIR} |
| 679 | -DAOM_DIST_DIR=${AOM_DIST_DIR} |
| 680 | -DAOM_DIST_APPS="${AOM_DIST_APPS}" |
| 681 | -DAOM_DIST_EXAMPLES="${AOM_DIST_EXAMPLES}" |
Tom Finegan | e91bb45 | 2017-09-29 11:40:24 -0700 | [diff] [blame] | 682 | -DAOM_DIST_TOOLS="${AOM_DIST_TOOLS}" |
Tom Finegan | 7897567 | 2017-05-30 08:55:54 -0700 | [diff] [blame] | 683 | -DAOM_DIST_INCLUDES="${AOM_INSTALL_INCS}" |
| 684 | -DAOM_DIST_LIBS=$<TARGET_FILE:aom> |
| 685 | -DENABLE_DOCS=${ENABLE_DOCS} |
| 686 | -P "${AOM_ROOT}/build/cmake/dist.cmake" |
| 687 | DEPENDS ${AOM_INSTALL_BINS} ${AOM_INSTALL_LIBS} |
Tom Finegan | 9cc0cfe | 2017-10-03 16:19:43 -0700 | [diff] [blame] | 688 | ${AOM_INSTALL_INCS} ${AOM_EXAMPLE_TARGETS} |
| 689 | ${AOM_TOOL_TARGETS}) |
Tom Finegan | 7897567 | 2017-05-30 08:55:54 -0700 | [diff] [blame] | 690 | |
Tom Finegan | 0d066ce | 2017-05-30 11:07:05 -0700 | [diff] [blame] | 691 | if (ENABLE_DOCS) |
Tom Finegan | 7897567 | 2017-05-30 08:55:54 -0700 | [diff] [blame] | 692 | add_dependencies(dist docs) |
Tom Finegan | 0d066ce | 2017-05-30 11:07:05 -0700 | [diff] [blame] | 693 | endif () |
Tom Finegan | c34abc8 | 2017-10-13 12:04:59 -0700 | [diff] [blame] | 694 | |
| 695 | # Collect all variables containing libaom source files. |
| 696 | get_cmake_property(all_cmake_vars VARIABLES) |
| 697 | foreach (var ${all_cmake_vars}) |
| 698 | if ("${var}" MATCHES "SOURCES$\|_INTRIN_\|_ASM_" AND NOT |
| 699 | "${var}" MATCHES "_APP_\|DOXYGEN\|LIBWEBM\|LIBYUV\|_PKG_\|TEST") |
| 700 | list(APPEND aom_source_vars ${var}) |
| 701 | endif () |
| 702 | endforeach () |
| 703 | |
| 704 | # Libaom_srcs.txt generation. |
| 705 | set(libaom_srcs_txt_file "${AOM_CONFIG_DIR}/libaom_srcs.txt") |
| 706 | file(WRITE "${libaom_srcs_txt_file}" "# This file is generated. DO NOT EDIT.\n") |
| 707 | |
| 708 | # Static source file list first. |
| 709 | foreach (aom_source_var ${aom_source_vars}) |
| 710 | foreach (file ${${aom_source_var}}) |
| 711 | if (NOT "${file}" MATCHES "${AOM_CONFIG_DIR}") |
| 712 | string(REPLACE "${AOM_ROOT}/" "" file "${file}") |
| 713 | file(APPEND "${libaom_srcs_txt_file}" "${file}\n") |
| 714 | endif () |
| 715 | endforeach () |
| 716 | endforeach () |
| 717 | |
| 718 | file(APPEND "${libaom_srcs_txt_file}" |
| 719 | "# Files below this line are generated by the libaom build system.\n") |
| 720 | foreach (aom_source_var ${aom_source_vars}) |
| 721 | foreach (file ${${aom_source_var}}) |
| 722 | if ("${file}" MATCHES "${AOM_CONFIG_DIR}") |
| 723 | string(REPLACE "${AOM_CONFIG_DIR}/" "" file "${file}") |
| 724 | file(APPEND "${libaom_srcs_txt_file}" "${file}\n") |
| 725 | endif () |
| 726 | endforeach () |
| 727 | endforeach () |
| 728 | |
| 729 | # Libaom_srcs.gni generation. |
| 730 | set(libaom_srcs_gni_file "${AOM_CONFIG_DIR}/libaom_srcs.gni") |
| 731 | file(WRITE "${libaom_srcs_gni_file}" "# This file is generated. DO NOT EDIT.\n") |
| 732 | |
| 733 | foreach (aom_source_var ${aom_source_vars}) |
| 734 | if ("${${aom_source_var}}" MATCHES "${AOM_ROOT}") |
| 735 | string(TOLOWER ${aom_source_var} aom_source_var_lowercase) |
| 736 | file(APPEND "${libaom_srcs_gni_file}" "\n${aom_source_var_lowercase} = [\n") |
| 737 | endif () |
| 738 | |
| 739 | foreach (file ${${aom_source_var}}) |
| 740 | if (NOT "${file}" MATCHES "${AOM_CONFIG_DIR}") |
Johann | 2ef3da2 | 2018-04-05 13:33:55 -0700 | [diff] [blame] | 741 | string(REPLACE "${AOM_ROOT}" "//third_party/libaom/source/libaom" |
| 742 | file "${file}") |
Tom Finegan | c34abc8 | 2017-10-13 12:04:59 -0700 | [diff] [blame] | 743 | file(APPEND "${libaom_srcs_gni_file}" " \"${file}\",\n") |
| 744 | endif () |
| 745 | endforeach () |
| 746 | |
| 747 | if ("${${aom_source_var}}" MATCHES "${AOM_ROOT}") |
| 748 | file(APPEND "${libaom_srcs_gni_file}" "]\n") |
| 749 | endif () |
| 750 | endforeach () |
| 751 | |
| 752 | file(APPEND "${libaom_srcs_gni_file}" |
| 753 | "\n# Files below this line are generated by the libaom build system.\n") |
| 754 | |
| 755 | foreach (aom_source_var ${aom_source_vars}) |
| 756 | if ("${${aom_source_var}}" MATCHES "${AOM_CONFIG_DIR}") |
| 757 | string(TOLOWER ${aom_source_var} aom_source_var_lowercase) |
| 758 | file(APPEND "${libaom_srcs_gni_file}" |
| 759 | "\n${aom_source_var_lowercase}_gen = [\n") |
| 760 | endif () |
| 761 | foreach (file ${${aom_source_var}}) |
| 762 | if (NOT "${file}" MATCHES "${AOM_ROOT}") |
Johann | 2ef3da2 | 2018-04-05 13:33:55 -0700 | [diff] [blame] | 763 | string(REPLACE "${AOM_CONFIG_DIR}" "//third_party/libaom/source/libaom" |
| 764 | file "${file}") |
Tom Finegan | c34abc8 | 2017-10-13 12:04:59 -0700 | [diff] [blame] | 765 | file(APPEND "${libaom_srcs_gni_file}" " \"${file}\",\n") |
| 766 | endif () |
| 767 | endforeach () |
| 768 | |
| 769 | if ("${${aom_source_var}}" MATCHES "${AOM_CONFIG_DIR}") |
| 770 | file(APPEND "${libaom_srcs_gni_file}" "]\n") |
| 771 | endif () |
| 772 | endforeach () |