summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-01-26 15:50:05 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-01-26 15:53:14 -0200
commitba9938b9506448bef752c3a6fe85041238f4916c (patch)
treef721bdb2f06b7fdc211e27b0fc1731ed01555304
parent85a095f0a88ef803e1eb98664b83116e2614c4ce (diff)
cmake: improve options summary with per-library values.
segment the options based on libraries, makes it easier to read.
-rw-r--r--cmake/helpers/EflMacros.cmake58
1 files changed, 43 insertions, 15 deletions
diff --git a/cmake/helpers/EflMacros.cmake b/cmake/helpers/EflMacros.cmake
index 41ad0dce61..7699db348c 100644
--- a/cmake/helpers/EflMacros.cmake
+++ b/cmake/helpers/EflMacros.cmake
@@ -124,7 +124,14 @@ function(EFL_OPTION _name _help _defval)
124 endif() 124 endif()
125 endif() 125 endif()
126 126
127 LIST_APPEND_GLOBAL(EFL_ALL_OPTIONS ${_name}) 127 if(EFL_LIB_CURRENT)
128 if(NOT DEFINED EFL_ALL_OPTIONS_${EFL_LIB_CURRENT})
129 LIST_APPEND_GLOBAL(EFL_ALL_OPTIONS EFL_ALL_OPTIONS_${EFL_LIB_CURRENT})
130 endif()
131 LIST_APPEND_GLOBAL(EFL_ALL_OPTIONS_${EFL_LIB_CURRENT} ${_name})
132 else()
133 LIST_APPEND_GLOBAL(EFL_ALL_OPTIONS ${_name})
134 endif()
128 135
129 SET_GLOBAL(EFL_OPTION_DEFAULT_${_name} "${_defval}" "Default value for ${_name}") 136 SET_GLOBAL(EFL_OPTION_DEFAULT_${_name} "${_defval}" "Default value for ${_name}")
130 SET_GLOBAL(EFL_OPTION_TYPE_${_name} "${_vartype}" "Type of ${_name}") 137 SET_GLOBAL(EFL_OPTION_TYPE_${_name} "${_vartype}" "Type of ${_name}")
@@ -183,29 +190,47 @@ function(EFL_OPTION_SET_MESSAGE _name _message)
183 SET_GLOBAL(EFL_OPTION_MESSAGE_${_name} "${_message}") 190 SET_GLOBAL(EFL_OPTION_MESSAGE_${_name} "${_message}")
184endfunction() 191endfunction()
185 192
193
194# _EFL_OPTIONS_SUMMARY_INTERNAL(Prefix Option)
195#
196# Internal function for EFL_OPTIONS_SUMMARY().
197function(_EFL_OPTIONS_SUMMARY_INTERNAL _prefix _o)
198 set(_v ${${_o}})
199 set(_d ${EFL_OPTION_DEFAULT_${_o}})
200 if(EFL_OPTION_DEPENDS_MISSING_${_o})
201 set(_i "requires: ${EFL_OPTION_DEPENDS_MISSING_${_o}}, was: ${EFL_OPTION_ORIGINAL_VALUE_${_o}}")
202 elseif("${_v}" STREQUAL "${_d}")
203 set(_i "default")
204 else()
205 set(_i "default: ${_d}")
206 endif()
207 if(EFL_OPTION_MESSAGE_${_o})
208 set(_m " [${EFL_OPTION_MESSAGE_${_o}}]")
209 else()
210 set(_m)
211 endif()
212 message(STATUS "${_prefix}${_o}=${_v} (${_i})${_m}")
213endfunction()
214
186# EFL_OPTIONS_SUMMARY() 215# EFL_OPTIONS_SUMMARY()
187# Shows the summary of options, their values and related messages. 216# Shows the summary of options, their values and related messages.
188function(EFL_OPTIONS_SUMMARY) 217function(EFL_OPTIONS_SUMMARY)
189 message(STATUS "EFL Options Summary:") 218 message(STATUS "EFL ${PROJECT_VERSION} Options Summary:")
190 message(STATUS " CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") 219 message(STATUS " CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
191 message(STATUS " CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") 220 message(STATUS " CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
192 foreach(_o ${EFL_ALL_OPTIONS}) 221 foreach(_o ${EFL_ALL_OPTIONS})
193 set(_v ${${_o}}) 222 if(_o MATCHES "^EFL_ALL_OPTIONS_")
194 set(_d ${EFL_OPTION_DEFAULT_${_o}}) 223 string(REGEX REPLACE "^EFL_ALL_OPTIONS_" "" _name "${_o}")
195 if(EFL_OPTION_DEPENDS_MISSING_${_o}) 224 message(STATUS "")
196 set(_i "requires: ${EFL_OPTION_DEPENDS_MISSING_${_o}}, was: ${EFL_OPTION_ORIGINAL_VALUE_${_o}}") 225 message(STATUS " ${_name} options:")
197 elseif("${_v}" STREQUAL "${_d}") 226 foreach(_so ${${_o}})
198 set(_i "default") 227 _EFL_OPTIONS_SUMMARY_INTERNAL(" " ${_so})
199 else() 228 endforeach()
200 set(_i "default: ${_d}")
201 endif()
202 if(EFL_OPTION_MESSAGE_${_o})
203 set(_m " [${EFL_OPTION_MESSAGE_${_o}}]")
204 else() 229 else()
205 set(_m) 230 _EFL_OPTIONS_SUMMARY_INTERNAL(" " ${_o})
206 endif() 231 endif()
207 message(STATUS " ${_o}=${_v} (${_i})${_m}")
208 endforeach() 232 endforeach()
233 message(STATUS "")
209 message(STATUS "EFL Libraries:") 234 message(STATUS "EFL Libraries:")
210 foreach(_o ${EFL_ALL_LIBS}) 235 foreach(_o ${EFL_ALL_LIBS})
211 message(STATUS " ${_o}${_mods}") 236 message(STATUS " ${_o}${_mods}")
@@ -221,6 +246,7 @@ function(EFL_OPTIONS_SUMMARY)
221 endforeach() 246 endforeach()
222 247
223 if(EFL_PKG_CONFIG_MISSING_OPTIONAL) 248 if(EFL_PKG_CONFIG_MISSING_OPTIONAL)
249 message(STATUS "")
224 message(STATUS "The following pkg-config optional modules are missing:") 250 message(STATUS "The following pkg-config optional modules are missing:")
225 foreach(_m ${EFL_PKG_CONFIG_MISSING_OPTIONAL}) 251 foreach(_m ${EFL_PKG_CONFIG_MISSING_OPTIONAL})
226 message(STATUS " ${_m}") 252 message(STATUS " ${_m}")
@@ -835,6 +861,8 @@ function(EFL_LIB _target)
835 set(EFL_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/tests/${_target}) 861 set(EFL_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/tests/${_target})
836 set(EFL_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/tests/${_target}) 862 set(EFL_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/tests/${_target})
837 863
864 unset(EFL_ALL_OPTIONS_${EFL_LIB_CURRENT} CACHE)
865
838 set(DESCRIPTION) 866 set(DESCRIPTION)
839 set(PKG_CONFIG_REQUIRES) 867 set(PKG_CONFIG_REQUIRES)
840 set(PKG_CONFIG_REQUIRES_PRIVATE) 868 set(PKG_CONFIG_REQUIRES_PRIVATE)