Add include guards to CMake files used as includes.

BUG=aomedia:76

Change-Id: Ie34025f31a89f4991d03d5ecf03c6f6f5ab7b0a1
diff --git a/aom_dsp/aom_dsp.cmake b/aom_dsp/aom_dsp.cmake
index c42bd73..4729bad 100644
--- a/aom_dsp/aom_dsp.cmake
+++ b/aom_dsp/aom_dsp.cmake
@@ -8,6 +8,9 @@
 ## Media Patent License 1.0 was not distributed with this source code in the
 ## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 ##
+if (NOT AOM_AOM_DSP_AOM_DSP_CMAKE_)
+set(AOM_AOM_DSP_AOM_DSP_CMAKE_ 1)
+
 set(AOM_DSP_COMMON_SOURCES
     "${AOM_ROOT}/aom_dsp/aom_convolve.c"
     "${AOM_ROOT}/aom_dsp/aom_convolve.h"
@@ -518,3 +521,5 @@
   # $AOM_LIB_TARGETS.
   set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} PARENT_SCOPE)
 endfunction ()
+
+endif ()  # AOM_AOM_DSP_AOM_DSP_CMAKE_
diff --git a/aom_mem/aom_mem.cmake b/aom_mem/aom_mem.cmake
index 0375b09..6ea5ae0 100644
--- a/aom_mem/aom_mem.cmake
+++ b/aom_mem/aom_mem.cmake
@@ -8,6 +8,9 @@
 ## Media Patent License 1.0 was not distributed with this source code in the
 ## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 ##
+if (NOT AOM_AOM_MEM_AOM_MEM_CMAKE_)
+set(AOM_AOM_MEM_AOM_MEM_CMAKE_ 1)
+
 set(AOM_MEM_SOURCES
     "${AOM_ROOT}/aom_mem/aom_mem.c"
     "${AOM_ROOT}/aom_mem/aom_mem.h"
@@ -20,3 +23,5 @@
   set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_mem PARENT_SCOPE)
   target_sources(aom PUBLIC $<TARGET_OBJECTS:aom_mem>)
 endfunction ()
+
+endif ()  # AOM_AOM_MEM_AOM_MEM_CMAKE_
diff --git a/aom_ports/aom_ports.cmake b/aom_ports/aom_ports.cmake
index 3e8883d..00ec28c 100644
--- a/aom_ports/aom_ports.cmake
+++ b/aom_ports/aom_ports.cmake
@@ -8,6 +8,9 @@
 ## Media Patent License 1.0 was not distributed with this source code in the
 ## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 ##
+if (NOT AOM_AOM_PORTS_AOM_PORTS_CMAKE_)
+set(AOM_AOM_PORTS_AOM_PORTS_CMAKE_ 1)
+
 set(AOM_PORTS_INCLUDES
     "${AOM_ROOT}/aom_ports/aom_once.h"
     "${AOM_ROOT}/aom_ports/aom_timer.h"
@@ -64,3 +67,5 @@
     endif ()
   endif ()
 endfunction ()
+
+endif ()  # AOM_AOM_PORTS_AOM_PORTS_CMAKE_
diff --git a/aom_scale/aom_scale.cmake b/aom_scale/aom_scale.cmake
index a6aa31a..e1e3f6c 100644
--- a/aom_scale/aom_scale.cmake
+++ b/aom_scale/aom_scale.cmake
@@ -8,6 +8,9 @@
 ## Media Patent License 1.0 was not distributed with this source code in the
 ## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 ##
+if (NOT AOM_AOM_SCALE_AOM_SCALE_CMAKE_)
+set(AOM_AOM_SCALE_AOM_SCALE_CMAKE_ 1)
+
 set(AOM_SCALE_SOURCES
     "${AOM_ROOT}/aom_scale/aom_scale.h"
     "${AOM_ROOT}/aom_scale/generic/aom_scale.c"
@@ -32,3 +35,5 @@
 
   set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_scale PARENT_SCOPE)
 endfunction ()
+
+endif ()  # AOM_AOM_SCALE_AOM_SCALE_CMAKE_
diff --git a/aom_util/aom_util.cmake b/aom_util/aom_util.cmake
index 484d9d9..68f525335f 100644
--- a/aom_util/aom_util.cmake
+++ b/aom_util/aom_util.cmake
@@ -8,6 +8,9 @@
 ## Media Patent License 1.0 was not distributed with this source code in the
 ## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 ##
+if (NOT AOM_AOM_UTIL_AOM_UTIL_CMAKE_)
+set(AOM_AOM_UTIL_AOM_UTIL_CMAKE_ 1)
+
 set(AOM_UTIL_SOURCES
     "${AOM_ROOT}/aom_util/aom_thread.c"
     "${AOM_ROOT}/aom_util/aom_thread.h"
@@ -27,3 +30,5 @@
   set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_util PARENT_SCOPE)
   target_sources(aom PUBLIC $<TARGET_OBJECTS:aom_util>)
 endfunction ()
+
+endif ()  # AOM_AOM_UTIL_AOM_UTIL_CMAKE_
diff --git a/av1/av1.cmake b/av1/av1.cmake
index c206c57..56412c9 100644
--- a/av1/av1.cmake
+++ b/av1/av1.cmake
@@ -8,6 +8,9 @@
 ## Media Patent License 1.0 was not distributed with this source code in the
 ## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 ##
+if (NOT AOM_AV1_AV1_CMAKE_)
+set(AOM_AV1_AV1_CMAKE_ 1)
+
 set(AOM_AV1_COMMON_SOURCES
     "${AOM_ROOT}/av1/av1_iface_common.h"
     "${AOM_ROOT}/av1/common/alloccommon.c"
@@ -558,3 +561,5 @@
 
 function (setup_av1_test_targets)
 endfunction ()
+
+endif ()  # AOM_AV1_AV1_CMAKE_
diff --git a/build/cmake/aom_configure.cmake b/build/cmake/aom_configure.cmake
index f731d8d..e8daf53 100644
--- a/build/cmake/aom_configure.cmake
+++ b/build/cmake/aom_configure.cmake
@@ -8,6 +8,9 @@
 ## Media Patent License 1.0 was not distributed with this source code in the
 ## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 ##
+if (NOT AOM_BUILD_CMAKE_AOM_CONFIGURE_CMAKE_)
+set(AOM_BUILD_CMAKE_AOM_CONFIGURE_CMAKE_ 1)
+
 include(FindGit)
 include(FindPerl)
 include(FindThreads)
@@ -367,3 +370,5 @@
   endif ()
   file(APPEND "${pkgconfig_file}" "Cflags: -I${prefix}/include\n")
 endif ()
+
+endif ()  # AOM_BUILD_CMAKE_AOM_CONFIGURE_CMAKE_
diff --git a/build/cmake/compiler_flags.cmake b/build/cmake/compiler_flags.cmake
index beb217a..c9fc69b 100644
--- a/build/cmake/compiler_flags.cmake
+++ b/build/cmake/compiler_flags.cmake
@@ -8,6 +8,9 @@
 ## Media Patent License 1.0 was not distributed with this source code in the
 ## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 ##
+if (NOT AOM_BUILD_CMAKE_COMPILER_FLAGS_CMAKE_)
+set(AOM_BUILD_CMAKE_COMPILER_FLAGS_CMAKE_ 1)
+
 include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
 
@@ -216,3 +219,5 @@
         "" FORCE)
   endif ()
 endfunction ()
+
+endif ()  # AOM_BUILD_CMAKE_COMPILER_FLAGS_CMAKE_
diff --git a/build/cmake/compiler_tests.cmake b/build/cmake/compiler_tests.cmake
index e763597..89f0bc1 100644
--- a/build/cmake/compiler_tests.cmake
+++ b/build/cmake/compiler_tests.cmake
@@ -8,6 +8,9 @@
 ## Media Patent License 1.0 was not distributed with this source code in the
 ## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 ##
+if (NOT AOM_BUILD_CMAKE_COMPILER_TESTS_CMAKE_)
+set(AOM_BUILD_CMAKE_COMPILER_TESTS_CMAKE_ 1)
+
 include(CheckCSourceCompiles)
 include(CheckCXXSourceCompiles)
 
@@ -131,3 +134,5 @@
     set(${result} "__inline" PARENT_SCOPE)
   endif ()
 endfunction ()
+
+endif ()  # AOM_BUILD_CMAKE_COMPILER_TESTS_CMAKE_
diff --git a/build/cmake/msvc_runtime.cmake b/build/cmake/msvc_runtime.cmake
index 0327217..3da5f7d 100644
--- a/build/cmake/msvc_runtime.cmake
+++ b/build/cmake/msvc_runtime.cmake
@@ -8,6 +8,8 @@
 ## Media Patent License 1.0 was not distributed with this source code in the
 ## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 ##
+if (NOT AOM_BUILD_CMAKE_MSVC_RUNTIME_CMAKE_)
+set(AOM_BUILD_CMAKE_MSVC_RUNTIME_CMAKE_ 1)
 
 if (MSVC)
   # CMake defaults to producing code linked to the DLL MSVC runtime. That will
@@ -24,3 +26,5 @@
     endforeach (flag_var)
   endif ()
 endif ()
+
+endif ()  # AOM_BUILD_CMAKE_MSVC_RUNTIME_CMAKE_
diff --git a/test/test.cmake b/test/test.cmake
index 4172c8b..d72a784 100644
--- a/test/test.cmake
+++ b/test/test.cmake
@@ -8,6 +8,9 @@
 ## Media Patent License 1.0 was not distributed with this source code in the
 ## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 ##
+if (NOT AOM_TEST_TEST_CMAKE_)
+set(AOM_TEST_TEST_CMAKE_ 1)
+
 include(ProcessorCount)
 
 include("${AOM_ROOT}/test/test_data_util.cmake")
@@ -389,3 +392,5 @@
                           EXCLUDE_FROM_DEFAULT_BUILD TRUE)
   endif ()
 endfunction ()
+
+endif ()  # AOM_TEST_TEST_CMAKE_