Move rtcd target setup function to aom_optimization.cmake.

Addresses a TODO. Also clean up some minor formatting nits.

Change-Id: Iced790a214cfdd703eef21f2a9976f8a07517897
diff --git a/build/cmake/aom_configure.cmake b/build/cmake/aom_configure.cmake
index 9ca89c5..04c112b 100644
--- a/build/cmake/aom_configure.cmake
+++ b/build/cmake/aom_configure.cmake
@@ -376,26 +376,6 @@
     OUTPUT_FILE ${AOM_RTCD_HEADER_FILE})
 endforeach()
 
-# TODO(tomfinegan): Move this to aom_optimization.cmake.
-function (add_rtcd_build_step config output source symbol)
-  add_custom_command(
-    OUTPUT ${output}
-    COMMAND ${PERL_EXECUTABLE}
-    ARGS "${AOM_ROOT}/build/make/rtcd.pl"
-      --arch=${AOM_TARGET_CPU}
-      --sym=${symbol}
-      ${AOM_RTCD_FLAGS}
-      --config=${AOM_CONFIG_DIR}/${AOM_TARGET_CPU}_rtcd_config.rtcd
-      ${config}
-      > ${output}
-    DEPENDS ${config}
-    COMMENT "Generating ${output}"
-    WORKING_DIRECTORY ${AOM_CONFIG_DIR}
-    VERBATIM)
-  set_property(SOURCE ${source} PROPERTY OBJECT_DEPENDS ${output})
-  set_property(SOURCE ${output} PROPERTY GENERATED)
-endfunction ()
-
 # Generate aom_version.h.
 execute_process(
   COMMAND ${CMAKE_COMMAND}
diff --git a/build/cmake/aom_optimization.cmake b/build/cmake/aom_optimization.cmake
index 456798c..c58c399 100644
--- a/build/cmake/aom_optimization.cmake
+++ b/build/cmake/aom_optimization.cmake
@@ -238,4 +238,27 @@
   endif ()
 endfunction ()
 
+# Adds build command for generation of rtcd C source files using
+# build/make/rtcd.pl. $config is the input perl file, $output is the output C
+# include file, $source is the C source file, and $symbol is used for the symbol
+# argument passed to rtcd.pl.
+function (add_rtcd_build_step config output source symbol)
+  add_custom_command(
+    OUTPUT ${output}
+    COMMAND ${PERL_EXECUTABLE}
+    ARGS "${AOM_ROOT}/build/make/rtcd.pl"
+      --arch=${AOM_TARGET_CPU}
+      --sym=${symbol}
+      ${AOM_RTCD_FLAGS}
+      --config=${AOM_CONFIG_DIR}/${AOM_TARGET_CPU}_rtcd_config.rtcd
+      ${config}
+      > ${output}
+    DEPENDS ${config}
+    COMMENT "Generating ${output}"
+    WORKING_DIRECTORY ${AOM_CONFIG_DIR}
+    VERBATIM)
+  set_property(SOURCE ${source} PROPERTY OBJECT_DEPENDS ${output})
+  set_property(SOURCE ${output} PROPERTY GENERATED)
+endfunction ()
+
 endif ()  # AOM_BUILD_CMAKE_AOM_OPTIMIZATION_CMAKE_
diff --git a/build/cmake/pkg_config.cmake b/build/cmake/pkg_config.cmake
index e350811..aee375f 100644
--- a/build/cmake/pkg_config.cmake
+++ b/build/cmake/pkg_config.cmake
@@ -11,8 +11,8 @@
 cmake_minimum_required(VERSION 3.5)
 
 set(REQUIRED_ARGS
-  "AOM_ROOT" "AOM_CONFIG_DIR" "CMAKE_INSTALL_PREFIX" "CMAKE_PROJECT_NAME"
-  "CONFIG_MULTITHREAD" "HAVE_PTHREAD_H")
+    "AOM_ROOT" "AOM_CONFIG_DIR" "CMAKE_INSTALL_PREFIX" "CMAKE_PROJECT_NAME"
+    "CONFIG_MULTITHREAD" "HAVE_PTHREAD_H")
 
 foreach (arg ${REQUIRED_ARGS})
   if ("${${arg}}" STREQUAL "")
@@ -55,4 +55,3 @@
   file(APPEND "${pkgconfig_file}" "Libs.private: -lm\n")
 endif ()
 file(APPEND "${pkgconfig_file}" "Cflags: -I${prefix}/include\n")
-