JosiahWI commented on code in PR #10158:
URL: https://github.com/apache/trafficserver/pull/10158#discussion_r1291547287


##########
cmake/AutoOptionHelpers.cmake:
##########
@@ -0,0 +1,104 @@
+#######################
+#
+#  Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+#  agreements.  See the NOTICE file distributed with this work for additional 
information regarding
+#  copyright ownership.  The ASF licenses this file to you under the Apache 
License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with the 
License.  You may obtain
+#  a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software 
distributed under the License
+#  is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+#  or implied. See the License for the specific language governing permissions 
and limitations under
+#  the License.
+#
+#######################
+
+set(GLOBAL_AUTO_OPTION_VARS "")
+
+function(_REGISTER_AUTO_OPTION _NAME _FEATURE_VAR _DESCRIPTION)
+  add_custom_target(${_NAME}_target)
+  set_target_properties(${_NAME}_target
+    PROPERTIES
+      AUTO_OPTION_FEATURE_VAR ${_FEATURE_VAR}
+  )
+
+  set(${_NAME} AUTO CACHE STRING ${_DESCRIPTION})
+  set_property(CACHE ${_NAME} PROPERTY STRINGS AUTO ON OFF)
+
+  set(LOCAL_AUTO_OPTION_VARS ${GLOBAL_AUTO_OPTION_VARS})
+  list(APPEND LOCAL_AUTO_OPTION_VARS "${_NAME}")
+  set(GLOBAL_AUTO_OPTION_VARS ${LOCAL_AUTO_OPTION_VARS} PARENT_SCOPE)
+endfunction()
+
+# Add a new auto feature that uses find_package.
+# Creates an option ENABLE_<PACKAGE_NAME>.
+macro(AUTO_FEATURE_PACKAGE _PACKAGE_NAME _FEATURE_VAR _DESCRIPTION)

Review Comment:
   This name is not great. I've come up with a much more usable interface 
that's also more flexible and more idiomatic. Argument parsing can be used to 
specify types of package dependencies using arguments such as `PACKAGES`, 
`SYMBOLS`, etc.
   
   Please don't merge yet.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to