cmake: Fix aom_pc warning.

- Create the dummy source and add it to the aom_pc target
  to avoid an empty library warning.
- Fix create_dummy_source_file(), which was broken when
  used by callers except add_dummy_source_file_to_target().
  add_dummy_source_file_to_target() worked due to macro
  expansion: The local variable in the macro was the same
  name as the one in the function calling, allowing the
  macro to work without the missing step of assigning the
  dummy source file name to the output variable.

BUG=aomedia:2195

Change-Id: I2a27c9dd521f669b805f046d2538e08ee0f4e2ab
diff --git a/build/cmake/aom_install.cmake b/build/cmake/aom_install.cmake
index ae56753..47206d8 100644
--- a/build/cmake/aom_install.cmake
+++ b/build/cmake/aom_install.cmake
@@ -32,8 +32,8 @@
     set(AOM_PKG_CONFIG_FILE "${AOM_CONFIG_DIR}/aom.pc")
 
     # Create a dummy library target for creating aom.pc.
+    create_dummy_source_file(aom_pc c AOM_PKG_CONFIG_SOURCES)
     add_library(aom_pc ${AOM_PKG_CONFIG_SOURCES})
-    add_dummy_source_file_to_target(aom_pc c)
 
     # Setup a rule to generate aom.pc.
     add_custom_command(OUTPUT "${AOM_PKG_CONFIG_FILE}"
diff --git a/build/cmake/util.cmake b/build/cmake/util.cmake
index b70ec40..5337941 100644
--- a/build/cmake/util.cmake
+++ b/build/cmake/util.cmake
@@ -16,10 +16,10 @@
 # Directory where generated sources will be written.
 set(AOM_GEN_SRC_DIR "${AOM_CONFIG_DIR}/gen_src")
 
-# Creates dummy source file in $AOM_CONFIG_DIR named $basename.$extension and
-# returns the full path to the dummy source file via the $out_file_path
-# parameter.
-macro(create_dummy_source_file basename extension out_file_path)
+# Creates dummy source file in $AOM_GEN_SRC_DIR named $basename.$extension and
+# returns the full path to the dummy source file via appending it to the list
+# variable referred to by $out_file_list_var parameter.
+macro(create_dummy_source_file basename extension out_file_list_var)
   set(dummy_source_file "${AOM_GEN_SRC_DIR}/${basename}_dummy.${extension}")
   file(
     WRITE
@@ -27,13 +27,15 @@
       "// ${target_name} needs a ${extension} file to force link language, \n"
       "// or to silence a harmless CMake warning: Ignore me.\n"
       "void ${target_name}_dummy_function(void) {}\n")
+  list(APPEND "${out_file_list_var}" "${dummy_source_file}")
 endmacro()
 
 # Convenience function for adding a dummy source file to $target_name using
 # $extension as the file extension. Wraps create_dummy_source_file().
 function(add_dummy_source_file_to_target target_name extension)
-  create_dummy_source_file("${target_name}" "${extension}" "dummy_source_file")
-  target_sources(${target_name} PRIVATE ${dummy_source_file})
+  create_dummy_source_file("${target_name}" "${extension}"
+                           "dummy_source_file_list")
+  target_sources(${target_name} PRIVATE ${dummy_source_file_list})
 endfunction()
 
 # Sets the value of the variable referenced by $feature to $value, and reports