gflags/gflags
CMakeLists.txt
:449
string (TOLOWER "${TYPE}" type)
string (TOLOWER "${TYPE}" type)
string(REGEX REPLACE "[^a-zA-Z0-9_][^a-zA-Z0-9_]*" "-" cachevar "${TYPE}-${FLAG}")
string(
REGEX MATCH
"itk_module[ \n]*(\\([ \n]*)([A-Za-z0-9]*)"
_module_name
${_module_file_content})
set(_module_name ${CMAKE_MATCH_2})
set(_${_module_name}_module_line ${_module_line})
list(APPEND _${group}_module_list ${_module_name})
endforeach()
endforeach()
#------------------------------------------------
# Set up Doxygen Group descriptions
set(group_list_dox)
foreach(group ${group_list})
set(group_list_dox
"${group_list_dox}
// -----------------------------------------------
// Group ${group}
/** \\defgroup Group-${group} Group ${group}
${${group}_documentation} */\n")
foreach(mod ${_${group}_module_list})
set(group_list_dox
"${group_list_dox}
/** \\defgroup ${mod} Module ${mod}
\\ingroup Group-${group} */\n")
endforeach()
endforeach()
set(_content ${group_list_dox})
configure_file("${ITK_SOURCE_DIR}/Utilities/Doxygen/Module.dox.in"
"${ITK_BINARY_DIR}/Utilities/Doxygen/Modules/ITK-AllGroups.dox")
#------------------------------------------------
# Turn on the ITK_BUILD option for each group
# Set a module name list for each group and exclude
# Modules that should be OFF
foreach(group ${group_list})
set(_${group}_on_module_list)
list(LENGTH _${group}_module_list _num_modules)
set(_current_module 0)
while(${_current_module} LESS ${_num_modules})
list(
GET
_${group}_module_list
${_current_module}
_module_name)
if(NOT ITK_MODULE_${_module_name}_EXCLUDE_FROM_DEFAULT)
list(APPEND _${group}_on_module_list ${_module_name})
endif()
math(EXPR _current_module "${_current_module} + 1")
endwhile()
endforeach()
if("$ENV{DASHBOARD_TEST_FROM_CTEST}" STREQUAL "")
# developer build
option(ITKGroup_Core "Request building core modules" ON)
endif()
foreach(group ${group_list})
option(ITKGroup_${group} "Request building ${group} modules" OFF)
if(ITKGroup_${group})
foreach(itk-module ${_${group}_on_module_list})
list(APPEND ITK_MODULE_${itk-module}_REQUEST_BY ITKGroup_${group})
endforeach()
endif()
# Hide group options if building all modules anyway.
if(ITK_BUILD_DEFAULT_MODULES)
set_property(CACHE ITKGroup_${group} PROPERTY TYPE INTERNAL)
else()
set_property(CACHE ITKGroup_${group} PROPERTY TYPE BOOL)
endif()
endforeach()
string(TOUPPER ${TYPE} UPPER_TYPE)
string(TOLOWER ${PDAL_CREATE_PLUGIN_TYPE} TYPE)
string (TOLOWER "${TYPE}" type)
string(REGEX REPLACE "^(.*)\\(.*" "\\1" macroname${m} ${macroarg})
string(REGEX REPLACE "^.*\\((.*)\\)$" "\\1" macrofields${m} ${macroarg})
split("${macrofields${m}}" "," macrofields)
tribits_eti_index_macro_fields("${etifields}" "${macrofields}" macroindex${m})
if(${PROJECT}_VERBOSE_CONFIGURE)
message(STATUS "Parsed macro ${macroname${m}}(${macrofields${m}}) into variable ${macrovar${m}} (index list ${macroindex${m}})")
endif()
endforeach()
# process the exclusions once
foreach(excl ${etiexcludelist})
tribits_eti_explode("${etifields}" "${excl}" e_excl)
if("${e_excl}" STREQUAL "TRIBITS_ETI_BAD_PARSE")
message(FATAL_ERROR "TRIBITS_GENERATE_ETI_MACROS: exclusion did not parse: ${excl}")
endif()
list(APPEND processed_excludes "${e_excl}")
endforeach()
list(LENGTH etifields numfields)
math(EXPR NFm1 "${numfields}-1")
foreach(inst ${etisetvar})
if (${PROJECT}_VERBOSE_CONFIGURE)
message(STATUS "Processing instantiation: ${inst}") # comment
endif()
tribits_eti_explode("${etifields}" "${inst}" tmp)
if("${tmp}" STREQUAL "TRIBITS_ETI_BAD_PARSE")
message(FATAL_ERROR "TRIBITS_GENERATE_ETI_MACROS: instantiation did not parse: ${inst}")
else()
set(inst "${tmp}")
endif()
# check whether it is on the exclude list
tribits_eti_check_exclusion("${processed_excludes}" "${inst}" excluded)
if(NOT excluded)
split("${inst}" "\\|" inst)
# append tuple to list
foreach(m RANGE 1 ${num_macros})
set(tuple "")
foreach(ind ${macroindex${m}})
list(GET inst ${ind} t)
if("${t}" STREQUAL "TYPE-MISSING")
set(tuple "SKIP-TUPLE")
break()
endif()
# mangle the types in the instantiation
tribits_eti_mangle_symbol_augment_macro(typedeflist t manglinglist)
list(APPEND tuple ${t})
endforeach()
if(NOT "${tuple}" STREQUAL "SKIP-TUPLE")
join(tuple "|" FALSE "${tuple}")
list(APPEND macrotuples${m} ${tuple})
endif()
endforeach()
endif()
endforeach()
# remove duplicates from lists
foreach(m RANGE 1 ${num_macros})
if(DEFINED macrotuples${m})
list(REMOVE_DUPLICATES macrotuples${m})
endif()
endforeach()
# build the macro strings
foreach(m RANGE 1 ${num_macros})
tribits_eti_build_macro_string("${macroname${m}}" "${macrotuples${m}}" mac)
set(${macrovar${m}} "${mac}" PARENT_SCOPE)
endforeach()
# build the typedef string
set(${manglinglistvar} ${manglinglist} PARENT_SCOPE)
set(${typedeflistvar} ${typedeflist} PARENT_SCOPE)
endfunction()
# generate the typedef macro
function(tribits_eti_generate_typedef_macro outputvar macroname typedeflist)
set(mac "#define ${macroname}() ")
foreach(td ${typedeflist})
set(mac "${mac} \\\n\t${td};")
endforeach()
set(${outputvar} "${mac}" PARENT_SCOPE)
endfunction()
string(REPLACE "/INCREMENTAL:YES" "" CMAKE_${TYPE}_LINKER_FLAGS_${BUILD} "${CMAKE_${TYPE}_LINKER_FLAGS_${BUILD}}")
string(REPLACE "/INCREMENTAL" "" CMAKE_${TYPE}_LINKER_FLAGS_${BUILD} "${CMAKE_${TYPE}_LINKER_FLAGS_${BUILD}}")
string(REGEX REPLACE "^(.*)\\(.*" "\\1" macroname${m} ${macroarg})
string(REGEX REPLACE "^.*\\((.*)\\)$" "\\1" macrofields${m} ${macroarg})
split("${macrofields${m}}" "," macrofields)
tribits_eti_index_macro_fields("${etifields}" "${macrofields}" macroindex${m})
if(${PROJECT}_VERBOSE_CONFIGURE)
message(STATUS "Parsed macro ${macroname${m}}(${macrofields${m}}) into variable ${macrovar${m}} (index list ${macroindex${m}})")
endif()
endforeach()
# process the exclusions once
foreach(excl ${etiexcludelist})
tribits_eti_explode("${etifields}" "${excl}" e_excl)
if("${e_excl}" STREQUAL "TRIBITS_ETI_BAD_PARSE")
message(FATAL_ERROR "TRIBITS_GENERATE_ETI_MACROS: exclusion did not parse: ${excl}")
endif()
list(APPEND processed_excludes "${e_excl}")
endforeach()
list(LENGTH etifields numfields)
math(EXPR NFm1 "${numfields}-1")
foreach(inst ${etisetvar})
if (${PROJECT}_VERBOSE_CONFIGURE)
message(STATUS "Processing instantiation: ${inst}") # comment
endif()
tribits_eti_explode("${etifields}" "${inst}" tmp)
if("${tmp}" STREQUAL "TRIBITS_ETI_BAD_PARSE")
message(FATAL_ERROR "TRIBITS_GENERATE_ETI_MACROS: instantiation did not parse: ${inst}")
else()
set(inst "${tmp}")
endif()
# check whether it is on the exclude list
tribits_eti_check_exclusion("${processed_excludes}" "${inst}" excluded)
if(NOT excluded)
split("${inst}" "\\|" inst)
# append tuple to list
foreach(m RANGE 1 ${num_macros})
set(tuple "")
foreach(ind ${macroindex${m}})
list(GET inst ${ind} t)
if("${t}" STREQUAL "TYPE-MISSING")
set(tuple "SKIP-TUPLE")
break()
endif()
# mangle the types in the instantiation
tribits_eti_mangle_symbol_augment_macro(typedeflist t manglinglist)
list(APPEND tuple ${t})
endforeach()
if(NOT "${tuple}" STREQUAL "SKIP-TUPLE")
join(tuple "|" FALSE "${tuple}")
list(APPEND macrotuples${m} ${tuple})
endif()
endforeach()
endif()
endforeach()
# remove duplicates from lists
foreach(m RANGE 1 ${num_macros})
if(DEFINED macrotuples${m})
list(REMOVE_DUPLICATES macrotuples${m})
endif()
endforeach()
# build the macro strings
foreach(m RANGE 1 ${num_macros})
tribits_eti_build_macro_string("${macroname${m}}" "${macrotuples${m}}" mac)
set(${macrovar${m}} "${mac}" PARENT_SCOPE)
endforeach()
# build the typedef string
set(${manglinglistvar} ${manglinglist} PARENT_SCOPE)
set(${typedeflistvar} ${typedeflist} PARENT_SCOPE)
endfunction()
# generate the typedef macro
function(tribits_eti_generate_typedef_macro outputvar macroname typedeflist)
set(mac "#define ${macroname}() ")
foreach(td ${typedeflist})
set(mac "${mac} \\\n\t${td};")
endforeach()
set(${outputvar} "${mac}" PARENT_SCOPE)
endfunction()
string (TOLOWER "${TYPE}" type)