Skip to content

Commit

Permalink
Unified endforeach
Browse files Browse the repository at this point in the history
  • Loading branch information
Heiko Thiel committed Nov 30, 2018
1 parent faa7360 commit 1cc592f
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 59 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ if(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONFIG} "${PCL_OUTPUT_BIN_DIR}")
# ---[ Windows requires DLLs (shared libraries) to be installed in the same directory as executables
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONFIG} "${PCL_OUTPUT_BIN_DIR}")
endforeach(config)
endforeach()
else()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PCL_OUTPUT_LIB_DIR}")
endif()
Expand Down Expand Up @@ -441,7 +441,7 @@ topological_sort(PCL_MODULES_NAMES PCL_ _DEPENDS)
sort_relative(PCL_MODULES_NAMES_UNSORTED PCL_MODULES_NAMES PCL_MODULES_DIRS)
foreach(subdir ${PCL_MODULES_DIRS})
add_subdirectory("${PCL_SOURCE_DIR}/${subdir}")
endforeach(subdir)
endforeach()

### ---[ Documentation
add_subdirectory(doc)
Expand Down
16 changes: 8 additions & 8 deletions PCLConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ macro(pcl_remove_duplicate_libraries _unfiltered_libraries _filtered_libraries)
list(APPEND _other_libraries ${library})
endif()
endif()
endforeach(library)
endforeach()
endmacro()

### ---[ 3rd party libraries
Expand Down Expand Up @@ -372,9 +372,9 @@ macro(compute_dependencies TO_FIND_COMPONENTS)
list(INSERT ${TO_FIND_COMPONENTS} 0 ${dependency})
endif()
endif()
endforeach(dependency)
endforeach()
endif()
endforeach(component)
endforeach()
endmacro()

### ---[ Find PCL
Expand Down Expand Up @@ -485,11 +485,11 @@ endif()
foreach(component ${PCL_TO_FIND_COMPONENTS})
foreach(opt ${pcl_${component}_opt_dep})
find_external_library(${component} ${opt} OPTIONAL)
endforeach(opt)
endforeach()
foreach(ext ${pcl_${component}_ext_dep})
find_external_library(${component} ${ext} REQUIRED)
endforeach(ext)
endforeach(component)
endforeach()
endforeach()

foreach(component ${PCL_TO_FIND_COMPONENTS})
set(pcl_component pcl_${component})
Expand Down Expand Up @@ -590,7 +590,7 @@ foreach(component ${PCL_TO_FIND_COMPONENTS})
list(APPEND PCL_${COMPONENT}_LINK_LIBRARIES "${PCL_${INT_DEP}_LIBRARIES}")
endif()
endif()
endforeach(int_dep)
endforeach()
if(_is_header_only EQUAL -1)
add_library(${pcl_component} @PCL_LIB_TYPE@ IMPORTED)
if(PCL_${COMPONENT}_LIBRARY_DEBUG)
Expand Down Expand Up @@ -634,7 +634,7 @@ foreach(component ${PCL_TO_FIND_COMPONENTS})
set(PCL_${COMPONENT}_LIBRARIES ${pcl_component})
endif()
endif()
endforeach(component)
endforeach()

if(NOT "${PCL_INCLUDE_DIRS}" STREQUAL "")
list(REMOVE_DUPLICATES PCL_INCLUDE_DIRS)
Expand Down
2 changes: 1 addition & 1 deletion apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ if(build)
sort_relative(PCL_APPS_MODULES_NAMES_UNSORTED PCL_APPS_MODULES_NAMES PCL_APPS_MODULES_DIRS)
foreach(subdir ${PCL_APPS_MODULES_DIRS})
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/${subdir}")
endforeach(subdir)
endforeach()

if(QHULL_FOUND)
set(incs
Expand Down
8 changes: 4 additions & 4 deletions cmake/CMakeParseArguments.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
# first set all result variables to empty/FALSE
foreach(arg_name ${_singleArgNames} ${_multiArgNames})
set(${prefix}_${arg_name})
endforeach(arg_name)
endforeach()

foreach(option ${_optionNames})
set(${prefix}_${option} FALSE)
endforeach(option)
endforeach()

set(${prefix}_UNPARSED_ARGUMENTS)

Expand Down Expand Up @@ -127,12 +127,12 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
endif()
endif()

endforeach(currentArg)
endforeach()

# propagate the result variables to the caller:
foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
endforeach(arg_name)
endforeach()
set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)

endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs)
4 changes: 2 additions & 2 deletions cmake/dep_graph.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ function(MAKE_DEP_GRAPH)
GET_IN_MAP(_deps PCL_SUBSYS_DEPS ${_ss})
foreach(_dep ${_deps})
file(APPEND ${_dot_file} " \"${_ss}\" -> \"${_dep}\";\n")
endforeach(_dep)
endforeach()
endif()
endforeach(_ss)
endforeach()

#file(APPEND ${_dot_file}
# " \"test\" [style=\"filled\" fillcolor=\"#A3A27C\" shape=\"box\"];\n ")
Expand Down
2 changes: 1 addition & 1 deletion cmake/pcl_all_in_one_installer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if(BUILD_all_in_one_installer)
PATTERN "*/Uninstall.exe" EXCLUDE
)
list(APPEND PCL_3RDPARTY_COMPONENTS ${dep})
endforeach(dep)
endforeach()

if(WITH_OPENNI)
if(CMAKE_CL_64)
Expand Down
6 changes: 3 additions & 3 deletions cmake/pcl_cpack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ macro(PCL_MAKE_CPACK_INPUT)
string(TOUPPER ${dep} DEP)
set(PCL_CPACK_COMPONENTS "${PCL_CPACK_COMPONENTS}\nset(CPACK_COMPONENT_${DEP}_GROUP \"ThirdParty\")")
set(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL} ${dep}")
endforeach(dep)
endforeach()
endif()

set(PCL_CPACK_COMPONENTS "${PCL_CPACK_COMPONENTS}\nset(CPACK_COMPONENTS_ALL${CPACK_COMPONENTS_ALL})\n")
Expand All @@ -123,7 +123,7 @@ macro(PCL_CPACK_MAKE_COMPS_OPTS _var _current)
set(_comps_list "${_comps_list} pcl_${_ss}")
PCL_CPACK_ADD_COMP_INFO(${_var} ${_ss})
endif()
endforeach(_ss)
endforeach()
set(CPACK_COMPONENTS_ALL ${_comps_list})
endmacro()

Expand All @@ -139,7 +139,7 @@ macro(PCL_CPACK_ADD_COMP_INFO _var _ss)
GET_IN_MAP(_deps PCL_SUBSYS_DEPS ${_ss})
foreach(_dep ${_deps})
set(_deps_str "${_deps_str} pcl_${_dep}")
endforeach(_dep)
endforeach()
set(${_var}
"${${_var}}set(CPACK_COMPONENT_PCL_${_comp_name}_DEPENDS ${_deps_str})\n")
set(${_var}
Expand Down
12 changes: 6 additions & 6 deletions cmake/pcl_pclconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ foreach(_ss ${PCL_SUBSYSTEMS_MODULES})
set(PCLCONFIG_INTERNAL_DEPENDENCIES "${PCLCONFIG_INTERNAL_DEPENDENCIES}set(pcl_${_ss}_int_dep ")
foreach(_dep ${_deps})
set(PCLCONFIG_INTERNAL_DEPENDENCIES "${PCLCONFIG_INTERNAL_DEPENDENCIES}${_dep} ")
endforeach(_dep)
endforeach()
set(PCLCONFIG_INTERNAL_DEPENDENCIES "${PCLCONFIG_INTERNAL_DEPENDENCIES})\n")
endif()
GET_IN_MAP(_ext_deps PCL_SUBSYS_EXT_DEPS ${_ss})
if(_ext_deps)
set(PCLCONFIG_EXTERNAL_DEPENDENCIES "${PCLCONFIG_EXTERNAL_DEPENDENCIES}set(pcl_${_ss}_ext_dep ")
foreach(_ext_dep ${_ext_deps})
set(PCLCONFIG_EXTERNAL_DEPENDENCIES "${PCLCONFIG_EXTERNAL_DEPENDENCIES}${_ext_dep} ")
endforeach(_ext_dep)
endforeach()
set(PCLCONFIG_EXTERNAL_DEPENDENCIES "${PCLCONFIG_EXTERNAL_DEPENDENCIES})\n")
endif()
GET_IN_MAP(_opt_deps PCL_SUBSYS_OPT_DEPS ${_ss})
Expand All @@ -48,7 +48,7 @@ foreach(_ss ${PCL_SUBSYSTEMS_MODULES})
if(${_condition})
set(PCLCONFIG_OPTIONAL_DEPENDENCIES "${PCLCONFIG_OPTIONAL_DEPENDENCIES}${_opt_dep} ")
endif()
endforeach(_opt_dep)
endforeach()
set(PCLCONFIG_OPTIONAL_DEPENDENCIES "${PCLCONFIG_OPTIONAL_DEPENDENCIES})\n")
endif()

Expand All @@ -66,14 +66,14 @@ foreach(_ss ${PCL_SUBSYSTEMS_MODULES})
set(PCLCONFIG_INTERNAL_DEPENDENCIES "${PCLCONFIG_INTERNAL_DEPENDENCIES}set(pcl_${_sub}_int_dep ")
foreach(_dep ${_deps})
set(PCLCONFIG_INTERNAL_DEPENDENCIES "${PCLCONFIG_INTERNAL_DEPENDENCIES}${_dep} ")
endforeach(_dep)
endforeach()
set(PCLCONFIG_INTERNAL_DEPENDENCIES "${PCLCONFIG_INTERNAL_DEPENDENCIES})\n")
endif()
endif()
endforeach(_sub)
endforeach()
endif()
endif()
endforeach(_ss)
endforeach()

#Boost modules
set(PCLCONFIG_AVAILABLE_BOOST_MODULES "system filesystem thread date_time iostreams")
Expand Down
42 changes: 21 additions & 21 deletions cmake/pcl_targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ macro(PCL_SUBSYS_DEPEND _var _name)
PCL_GET_SUBSYS_INCLUDE_DIR(_include_dir ${_dep})
include_directories(${PROJECT_SOURCE_DIR}/${_include_dir}/include)
endif()
endforeach(_dep)
endforeach()
endif()
if(SUBSYS_EXT_DEPS)
foreach(_dep ${SUBSYS_EXT_DEPS})
Expand All @@ -114,13 +114,13 @@ macro(PCL_SUBSYS_DEPEND _var _name)
set(${_var} FALSE)
PCL_SET_SUBSYS_STATUS(${_name} FALSE "Requires external library ${_dep}.")
endif()
endforeach(_dep)
endforeach()
endif()
if(SUBSYS_OPT_DEPS)
foreach(_dep ${SUBSYS_OPT_DEPS})
PCL_GET_SUBSYS_INCLUDE_DIR(_include_dir ${_dep})
include_directories(${PROJECT_SOURCE_DIR}/${_include_dir}/include)
endforeach(_dep)
endforeach()
endif()
endif()
endmacro()
Expand Down Expand Up @@ -160,7 +160,7 @@ macro(PCL_SUBSUBSYS_DEPEND _var _parent _name)
PCL_GET_SUBSYS_INCLUDE_DIR(_include_dir ${_dep})
include_directories(${PROJECT_SOURCE_DIR}/${_include_dir}/include)
endif()
endforeach(_dep)
endforeach()
endif()
if(SUBSUBSYS_EXT_DEPS)
foreach(_dep ${SUBSUBSYS_EXT_DEPS})
Expand All @@ -169,7 +169,7 @@ macro(PCL_SUBSUBSYS_DEPEND _var _parent _name)
set(${_var} FALSE)
PCL_SET_SUBSYS_STATUS(${_parent}_${_name} FALSE "Requires external library ${_dep}.")
endif()
endforeach(_dep)
endforeach()
endif()
endif()
endmacro()
Expand Down Expand Up @@ -469,11 +469,11 @@ macro(PCL_MAKE_PKGCONFIG _name _component _desc _pcl_deps _ext_deps _int_deps _c
set(PKG_EXTERNAL_DEPS ${_ext_deps_str})
foreach(_dep ${_pcl_deps})
set(PKG_EXTERNAL_DEPS "${PKG_EXTERNAL_DEPS} pcl_${_dep}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}")
endforeach(_dep)
endforeach()
set(PKG_INTERNAL_DEPS "")
foreach(_dep ${_int_deps})
set(PKG_INTERNAL_DEPS "${PKG_INTERNAL_DEPS} -l${_dep}")
endforeach(_dep)
endforeach()

set(_pc_file ${CMAKE_CURRENT_BINARY_DIR}/${_name}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}.pc)
configure_file(${PROJECT_SOURCE_DIR}/cmake/pkgconfig.cmake.in ${_pc_file}
Expand Down Expand Up @@ -504,11 +504,11 @@ LIST_TO_STRING(_ext_deps_str "${_ext_deps}")
set(PKG_EXTERNAL_DEPS ${_ext_deps_str})
foreach(_dep ${_pcl_deps})
set(PKG_EXTERNAL_DEPS "${PKG_EXTERNAL_DEPS} pcl_${_dep}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}")
endforeach(_dep)
endforeach()
set(PKG_INTERNAL_DEPS "")
foreach(_dep ${_int_deps})
set(PKG_INTERNAL_DEPS "${PKG_INTERNAL_DEPS} -l${_dep}")
endforeach(_dep)
endforeach()
set(_pc_file ${CMAKE_CURRENT_BINARY_DIR}/${_name}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}.pc)
configure_file(${PROJECT_SOURCE_DIR}/cmake/pkgconfig-headeronly.cmake.in ${_pc_file} @ONLY)
install(FILES ${_pc_file} DESTINATION ${PKGCFG_INSTALL_DIR}
Expand All @@ -529,7 +529,7 @@ macro(PCL_RESET_MAPS)
set(${PCL_SUBSYS_SUBSYS_DESC} "" CACHE INTERNAL "" FORCE)
set(${PCL_SUBSYS_SUBSYS} "" CACHE INTERNAL "" FORCE)
endif()
endforeach(_ss)
endforeach()

set(PCL_SUBSYS_HYPERSTATUS "" CACHE INTERNAL
"To Build Or Not To Build, That Is The Question." FORCE)
Expand Down Expand Up @@ -649,7 +649,7 @@ macro(PCL_GET_SUBSYS_HYPERSTATUS _var _name)
set(${_var} "AUTO_OFF")
break()
endif()
endforeach(subsys)
endforeach()
endif()
endmacro()

Expand Down Expand Up @@ -697,7 +697,7 @@ macro(PCL_WRITE_STATUS_REPORT)
if(_sub_status)
set(will_build "${will_build}\n |_ ${_sub}")
endif()
endforeach(_sub)
endforeach()
if(NOT ("${will_build}" STREQUAL ""))
set(message_text "${message_text}\n building: ${will_build}")
endif()
Expand All @@ -709,14 +709,14 @@ macro(PCL_WRITE_STATUS_REPORT)
GET_IN_MAP(_reason PCL_SUBSYS_REASONS ${_ss}_${_sub})
set(wont_build "${wont_build}\n |_ ${_sub}: ${_reason}")
endif()
endforeach(_sub)
endforeach()
if(NOT ("${wont_build}" STREQUAL ""))
set(message_text "${message_text}\n not building: ${wont_build}")
endif()
endif()
message(STATUS "${message_text}")
endif()
endforeach(_ss)
endforeach()

message(STATUS "The following subsystems will not be built:")
foreach(_ss ${PCL_SUBSYSTEMS})
Expand All @@ -726,7 +726,7 @@ macro(PCL_WRITE_STATUS_REPORT)
GET_IN_MAP(_reason PCL_SUBSYS_REASONS ${_ss})
message(STATUS " ${_ss}: ${_reason}")
endif()
endforeach(_ss)
endforeach()
endmacro()

##############################################################################
Expand Down Expand Up @@ -754,7 +754,7 @@ macro(collect_subproject_directory_names dirname filename names dirs)
foreach(file ${globbed})
get_filename_component(dir ${file} PATH)
set(${dirs} ${${dirs}} ${dir})
endforeach(file)
endforeach()
endif()
foreach(subdir ${${dirs}})
file(STRINGS ${dirname}/${subdir}/CMakeLists.txt name REGEX "[setSET ]+\\(.*SUBSYS_NAME .*\\)$")
Expand All @@ -772,9 +772,9 @@ macro(collect_subproject_directory_names dirname filename names dirs)
foreach(dependee ${DEPENDENCIES})
string(TOUPPER "PCL_${dependee}_DEPENDIES" SUBSYS_DEPENDIES)
set(${SUBSYS_DEPENDIES} ${${SUBSYS_DEPENDIES}} ${name})
endforeach(dependee)
endforeach()
endif()
endforeach(subdir)
endforeach()
endmacro()

########################################################################################
Expand All @@ -786,7 +786,7 @@ macro(PCL_DISABLE_DEPENDIES _subsys)
foreach(dep ${${PCL_SUBSYS_DEPENDIES}})
PCL_SET_SUBSYS_HYPERSTATUS(${_subsys} ${dep} AUTO_OFF "Disabled: ${_subsys} missing.")
set(BUILD_${dep} OFF CACHE BOOL "Disabled: ${_subsys} missing." FORCE)
endforeach(dep)
endforeach()
endif()
endmacro()

Expand All @@ -803,7 +803,7 @@ macro(PCL_ENABLE_DEPENDIES _subsys)
GET_IN_MAP(desc PCL_SUBSYS_DESC ${dep})
set(BUILD_${dep} ON CACHE BOOL "${desc}" FORCE)
endif()
endforeach(dep)
endforeach()
endif()
endmacro()

Expand Down Expand Up @@ -834,7 +834,7 @@ macro (PCL_ADD_DOC _subsys)
foreach(dep ${dependencies})
set(DOC_SOURCE_DIR
"${DOC_SOURCE_DIR}\n\t\t\t\t\t\t\t\t\t\t\t\t \"${PCL_SOURCE_DIR}/${dep}\"\\")
endforeach(dep)
endforeach()
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html")
set(doxyfile "${CMAKE_CURRENT_BINARY_DIR}/doxyfile")
configure_file("${PCL_SOURCE_DIR}/doc/doxygen/doxyfile.in" ${doxyfile})
Expand Down
Loading

0 comments on commit 1cc592f

Please sign in to comment.