Skip to content

Commit

Permalink
Unified if/else/elseif/endif style
Browse files Browse the repository at this point in the history
* commands are now always in lowercase
* remove unnecessary expressions in else/endif
* unified whitespaces between command and bracket
  • Loading branch information
Heiko Thiel committed Nov 30, 2018
1 parent e5eb7be commit 52eb8a1
Show file tree
Hide file tree
Showing 120 changed files with 652 additions and 652 deletions.
4 changes: 2 additions & 2 deletions 2d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if(build)
set(VTK_USE_FILE "${VTK_USE_FILE}" CACHE INTERNAL "VTK_USE_FILE")
include("${VTK_USE_FILE}")
set(VTK_IO_TARGET_LINK_LIBRARIES vtkCommon vtkWidgets vtkIO vtkImaging)
endif(${VTK_FOUND})
endif()

include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include" ${VTK_INCLUDE_DIRECTORIES})

Expand All @@ -42,4 +42,4 @@ if(build)
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}" ${incs})
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/impl" ${impl_incs})

endif(build)
endif()
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)

if(NOT ANDROID)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
endif(NOT ANDROID)
endif()

if("${CMAKE_SHARED_LINKER_FLAGS}" STREQUAL "" AND NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
Expand Down Expand Up @@ -237,9 +237,9 @@ SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}" is_system_dir)
IF("${is_system_dir}" STREQUAL "-1")
if("${is_system_dir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
ENDIF("${is_system_dir}" STREQUAL "-1")
endif()

### ---[ Find universal dependencies
# the gcc-4.2.1 coming with MacOS X is not compatible with the OpenMP pragmas we use, so disabling OpenMP for it
Expand Down Expand Up @@ -270,7 +270,7 @@ if(OPENMP_FOUND)
else()
message(WARNING "Delay loading flag for OpenMP DLL is invalid.")
endif()
endif(MSVC)
endif()
else()
message(STATUS "Not found OpenMP")
endif()
Expand Down
106 changes: 53 additions & 53 deletions PCLConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ endmacro(pcl_report_not_found)
macro(pcl_message)
if(NOT PCL_FIND_QUIETLY)
message(${ARGN})
endif(NOT PCL_FIND_QUIETLY)
endif()
endmacro(pcl_message)

# Remove duplicate libraries
Expand Down Expand Up @@ -76,13 +76,13 @@ macro(pcl_remove_duplicate_libraries _unfiltered_libraries _filtered_libraries)
list(APPEND _optimized_libraries ${library})
endif()
set(_waiting_for_optimized 0)
else("${library}" STREQUAL "debug")
else()
list(FIND _other_libraries "${library}" library_position)
if(library_position EQUAL -1)
list(APPEND ${_filtered_libraries} ${library})
list(APPEND _other_libraries ${library})
endif()
endif("${library}" STREQUAL "debug")
endif()
endforeach(library)
endmacro(pcl_remove_duplicate_libraries)

Expand All @@ -92,26 +92,26 @@ macro(find_boost)
set(BOOST_ROOT "${PCL_ROOT}/3rdParty/Boost")
elseif(NOT BOOST_INCLUDEDIR)
set(BOOST_INCLUDEDIR "@Boost_INCLUDE_DIR@")
endif(PCL_ALL_IN_ONE_INSTALLER)
endif()
# use static Boost in Windows
if(WIN32)
set(Boost_USE_STATIC_LIBS @Boost_USE_STATIC_LIBS@)
set(Boost_USE_STATIC @Boost_USE_STATIC@)
set(Boost_USE_MULTITHREAD @Boost_USE_MULTITHREAD@)
endif(WIN32)
endif()
if(${CMAKE_VERSION} VERSION_LESS 2.8.5)
set(Boost_ADDITIONAL_VERSIONS
"1.47.0" "1.47" "1.46.1"
"1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43")
else(${CMAKE_VERSION} VERSION_LESS 2.8.5)
else()
set(Boost_ADDITIONAL_VERSIONS
"@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@.@Boost_SUBMINOR_VERSION@" "@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@"
"1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
"1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
"1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
"1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
"1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47")
endif(${CMAKE_VERSION} VERSION_LESS 2.8.5)
endif()
# Disable the config mode of find_package(Boost)
set(Boost_NO_BOOST_CMAKE ON)
find_package(Boost 1.40.0 ${QUIET_} COMPONENTS @PCLCONFIG_AVAILABLE_BOOST_MODULES@)
Expand All @@ -122,7 +122,7 @@ macro(find_boost)
set(BOOST_LIBRARIES ${Boost_LIBRARIES})
if(WIN32 AND NOT MINGW)
set(BOOST_DEFINITIONS ${BOOST_DEFINITIONS} -DBOOST_ALL_NO_LIB)
endif(WIN32 AND NOT MINGW)
endif()
endmacro(find_boost)

#remove this as soon as eigen is shipped with FindEigen.cmake
Expand All @@ -131,7 +131,7 @@ macro(find_eigen)
set(EIGEN_ROOT "${PCL_ROOT}/3rdParty/Eigen")
elseif(NOT EIGEN_ROOT)
get_filename_component(EIGEN_ROOT "@EIGEN_INCLUDE_DIRS@" ABSOLUTE)
endif(PCL_ALL_IN_ONE_INSTALLER)
endif()
find_package(Eigen)
set(EIGEN_DEFINITIONS ${EIGEN_DEFINITIONS})
endmacro(find_eigen)
Expand All @@ -142,7 +142,7 @@ macro(find_qhull)
set(QHULL_ROOT "${PCL_ROOT}/3rdParty/Qhull")
elseif(NOT QHULL_ROOT)
get_filename_component(QHULL_ROOT "@QHULL_INCLUDE_DIRS@" PATH)
endif(PCL_ALL_IN_ONE_INSTALLER)
endif()

set(QHULL_USE_STATIC @QHULL_USE_STATIC@)
find_package(Qhull)
Expand Down Expand Up @@ -230,7 +230,7 @@ macro(find_flann)
set(FLANN_ROOT "${PCL_ROOT}/3rdParty/Flann")
elseif(NOT FLANN_ROOT)
get_filename_component(FLANN_ROOT "@FLANN_INCLUDE_DIRS@" PATH)
endif(PCL_ALL_IN_ONE_INSTALLER)
endif()

set(FLANN_USE_STATIC @FLANN_USE_STATIC@)
find_package(FLANN)
Expand All @@ -245,7 +245,7 @@ macro(find_VTK)
endif()
elseif(NOT VTK_DIR AND NOT ANDROID)
set(VTK_DIR "@VTK_DIR@" CACHE PATH "The directory containing VTKConfig.cmake")
endif(PCL_ALL_IN_ONE_INSTALLER AND NOT ANDROID)
endif()
if(NOT ANDROID)
find_package(VTK ${QUIET_})
endif()
Expand All @@ -262,7 +262,7 @@ macro(find_libusb)
NAMES usb-1.0
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib)
find_package_handle_standard_args(libusb-1.0 LIBUSB_1_LIBRARY LIBUSB_1_INCLUDE_DIR)
endif(NOT WIN32)
endif()
endmacro(find_libusb)

macro(find_glew)
Expand Down Expand Up @@ -311,7 +311,7 @@ macro(find_external_library _component _lib _is_optional)
find_glew()
elseif("${_lib}" STREQUAL "opengl")
find_package(OpenGL)
endif("${_lib}" STREQUAL "boost")
endif()

string(TOUPPER "${_component}" COMPONENT)
string(TOUPPER "${_lib}" LIB)
Expand All @@ -320,16 +320,16 @@ macro(find_external_library _component _lib _is_optional)
list(APPEND PCL_${COMPONENT}_INCLUDE_DIRS ${${LIB}_INCLUDE_DIRS})
if(${LIB}_USE_FILE)
include(${${LIB}_USE_FILE})
else(${LIB}_USE_FILE)
else()
list(APPEND PCL_${COMPONENT}_LIBRARY_DIRS "${${LIB}_LIBRARY_DIRS}")
endif(${LIB}_USE_FILE)
endif()
if(${LIB}_LIBRARIES)
list(APPEND PCL_${COMPONENT}_LIBRARIES "${${LIB}_LIBRARIES}")
endif(${LIB}_LIBRARIES)
endif()
if(${LIB}_DEFINITIONS AND NOT ${LIB} STREQUAL "VTK")
list(APPEND PCL_${COMPONENT}_DEFINITIONS ${${LIB}_DEFINITIONS})
endif(${LIB}_DEFINITIONS AND NOT ${LIB} STREQUAL "VTK")
else(${LIB}_FOUND)
endif()
else()
if("${_is_optional}" STREQUAL "OPTIONAL")
list(APPEND PCL_${COMPONENT}_DEFINITIONS "-DDISABLE_${LIB}")
pcl_message("** WARNING ** ${_component} features related to ${_lib} will be disabled")
Expand All @@ -341,9 +341,9 @@ macro(find_external_library _component _lib _is_optional)
string(TOUPPER "${_component}" COMPONENT)
pcl_message("** WARNING ** ${_component} will be disabled cause ${_lib} was not found")
list(REMOVE_ITEM PCL_TO_FIND_COMPONENTS ${_component})
endif((NOT PCL_FIND_ALL) OR (PCL_FIND_ALL EQUAL 1))
endif("${_is_optional}" STREQUAL "OPTIONAL")
endif(${LIB}_FOUND)
endif()
endif()
endif()
endmacro(find_external_library)

macro(pcl_check_external_dependency _component)
Expand All @@ -363,38 +363,38 @@ macro(compute_dependencies TO_FIND_COMPONENTS)
list(INSERT ${TO_FIND_COMPONENTS} ${pos} ${dependency})
if(pcl_${dependency}_ext_dep)
list(APPEND pcl_${component}_ext_dep ${pcl_${dependency}_ext_dep})
endif(pcl_${dependency}_ext_dep)
endif()
if(pcl_${dependency}_opt_dep)
list(APPEND pcl_${component}_opt_dep ${pcl_${dependency}_opt_dep})
endif(pcl_${dependency}_opt_dep)
endif()
compute_dependencies(${TO_FIND_COMPONENTS})
else(${pcl_dependency}_int_dep)
else()
list(INSERT ${TO_FIND_COMPONENTS} 0 ${dependency})
endif(${pcl_dependency}_int_dep)
endif(found EQUAL -1)
endif()
endif()
endforeach(dependency)
endif(${pcl_component}_int_dep AND (NOT PCL_FIND_ALL))
endif()
endforeach(component)
endmacro(compute_dependencies)

### ---[ Find PCL

if(PCL_FIND_QUIETLY)
set(QUIET_ QUIET)
else(PCL_FIND_QUIETLY)
else()
set(QUIET_)
endif(PCL_FIND_QUIETLY)
endif()

find_package(PkgConfig QUIET)

file(TO_CMAKE_PATH "${PCL_DIR}" PCL_DIR)
if(WIN32 AND NOT MINGW)
# PCLConfig.cmake is installed to PCL_ROOT/cmake
get_filename_component(PCL_ROOT "${PCL_DIR}" PATH)
else(WIN32 AND NOT MINGW)
else()
# PCLConfig.cmake is installed to PCL_ROOT/share/pcl-x.y
get_filename_component(PCL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
endif(WIN32 AND NOT MINGW)
endif()

# check whether PCLConfig.cmake is found into a PCL installation or in a build tree
if(EXISTS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}/pcl/pcl_config.h")
Expand All @@ -404,24 +404,24 @@ if(EXISTS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}/pcl
set(PCL_LIBRARY_DIRS "${PCL_ROOT}/@LIB_INSTALL_DIR@")
if(EXISTS "${PCL_ROOT}/3rdParty")
set(PCL_ALL_IN_ONE_INSTALLER ON)
endif(EXISTS "${PCL_ROOT}/3rdParty")
endif()
elseif(EXISTS "${PCL_ROOT}/include/pcl/pcl_config.h")
# Found a non-standard (likely ANDROID) PCL installation
# pcl_message("Found a PCL installation")
set(PCL_INCLUDE_DIRS "${PCL_ROOT}/include")
set(PCL_LIBRARY_DIRS "${PCL_ROOT}/lib")
if(EXISTS "${PCL_ROOT}/3rdParty")
set(PCL_ALL_IN_ONE_INSTALLER ON)
endif(EXISTS "${PCL_ROOT}/3rdParty")
endif()
elseif(EXISTS "${PCL_DIR}/include/pcl/pcl_config.h")
# Found PCLConfig.cmake in a build tree of PCL
# pcl_message("PCL found into a build tree.")
set(PCL_INCLUDE_DIRS "${PCL_DIR}/include") # for pcl_config.h
set(PCL_LIBRARY_DIRS "${PCL_DIR}/@LIB_INSTALL_DIR@")
set(PCL_SOURCES_TREE "@CMAKE_SOURCE_DIR@")
else(EXISTS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}/pcl/pcl_config.h")
else()
pcl_report_not_found("PCL can not be found on this machine")
endif(EXISTS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}/pcl/pcl_config.h")
endif()

#set a suffix for debug libraries
set(PCL_DEBUG_SUFFIX "@CMAKE_DEBUG_POSTFIX@")
Expand Down Expand Up @@ -453,13 +453,13 @@ if(PCL_FIND_COMPONENTS)
if(PCL_FIND_COMPONENTS_LENGTH EQUAL PCL_NB_COMPONENTS)
set(PCL_TO_FIND_COMPONENTS ${pcl_all_components})
set(PCL_FIND_ALL 1)
else(PCL_FIND_COMPONENTS_LENGTH EQUAL PCL_NB_COMPONENTS)
else()
set(PCL_TO_FIND_COMPONENTS ${PCL_FIND_COMPONENTS})
endif(PCL_FIND_COMPONENTS_LENGTH EQUAL PCL_NB_COMPONENTS)
else(PCL_FIND_COMPONENTS)
endif()
else()
set(PCL_TO_FIND_COMPONENTS ${pcl_all_components})
set(PCL_FIND_ALL 1)
endif(PCL_FIND_COMPONENTS)
endif()

compute_dependencies(PCL_TO_FIND_COMPONENTS)

Expand Down Expand Up @@ -518,9 +518,9 @@ foreach(component ${PCL_TO_FIND_COMPONENTS})

if(PCL_${COMPONENT}_INCLUDE_DIR)
list(APPEND PCL_${COMPONENT}_INCLUDE_DIRS "${PCL_${COMPONENT}_INCLUDE_DIR}")
else(PCL_${COMPONENT}_INCLUDE_DIR)
else()
#pcl_message("No include directory found for pcl_${component}.")
endif(PCL_${COMPONENT}_INCLUDE_DIR)
endif()

# Skip find_library for header only modules
list(FIND pcl_header_only_components ${component} _is_header_only)
Expand All @@ -544,20 +544,20 @@ foreach(component ${PCL_TO_FIND_COMPONENTS})
get_filename_component(${component}_library_path_debug
${PCL_${COMPONENT}_LIBRARY_DEBUG}
PATH)
endif(PCL_${COMPONENT}_LIBRARY_DEBUG)
endif()

# Restrict this to Windows users
if(NOT PCL_${COMPONENT}_LIBRARY AND WIN32)
# might be debug only
set(PCL_${COMPONENT}_LIBRARY ${PCL_${COMPONENT}_LIBRARY_DEBUG})
endif(NOT PCL_${COMPONENT}_LIBRARY AND WIN32)
endif()

find_package_handle_standard_args(PCL_${COMPONENT} DEFAULT_MSG
PCL_${COMPONENT}_LIBRARY PCL_${COMPONENT}_INCLUDE_DIR)
else(_is_header_only EQUAL -1)
else()
find_package_handle_standard_args(PCL_${COMPONENT} DEFAULT_MSG
PCL_${COMPONENT}_INCLUDE_DIR)
endif(_is_header_only EQUAL -1)
endif()

if(PCL_${COMPONENT}_FOUND)
if(NOT "${PCL_${COMPONENT}_INCLUDE_DIRS}" STREQUAL "")
Expand All @@ -570,7 +570,7 @@ foreach(component ${PCL_TO_FIND_COMPONENTS})
list(REMOVE_DUPLICATES _filtered)
set(PCL_${COMPONENT}_INCLUDE_DIRS ${_filtered})
list(APPEND PCL_INCLUDE_DIRS ${_filtered})
endif(NOT "${PCL_${COMPONENT}_INCLUDE_DIRS}" STREQUAL "")
endif()
mark_as_advanced(PCL_${COMPONENT}_INCLUDE_DIRS)
if(_is_header_only EQUAL -1)
list(APPEND PCL_DEFINITIONS ${PCL_${COMPONENT}_DEFINITIONS})
Expand All @@ -588,8 +588,8 @@ foreach(component ${PCL_TO_FIND_COMPONENTS})
list(APPEND PCL_${COMPONENT}_INCLUDE_DIRS ${PCL_${INT_DEP}_INCLUDE_DIRS})
if(PCL_${INT_DEP}_LIBRARIES)
list(APPEND PCL_${COMPONENT}_LINK_LIBRARIES "${PCL_${INT_DEP}_LIBRARIES}")
endif(PCL_${INT_DEP}_LIBRARIES)
endif(PCL_${INT_DEP}_FOUND)
endif()
endif()
endforeach(int_dep)
if(_is_header_only EQUAL -1)
add_library(${pcl_component} @PCL_LIB_TYPE@ IMPORTED)
Expand Down Expand Up @@ -633,20 +633,20 @@ foreach(component ${PCL_TO_FIND_COMPONENTS})
endif()
set(PCL_${COMPONENT}_LIBRARIES ${pcl_component})
endif()
endif(PCL_${COMPONENT}_FOUND)
endif()
endforeach(component)

if(NOT "${PCL_INCLUDE_DIRS}" STREQUAL "")
list(REMOVE_DUPLICATES PCL_INCLUDE_DIRS)
endif(NOT "${PCL_INCLUDE_DIRS}" STREQUAL "")
endif()

if(NOT "${PCL_LIBRARY_DIRS}" STREQUAL "")
list(REMOVE_DUPLICATES PCL_LIBRARY_DIRS)
endif(NOT "${PCL_LIBRARY_DIRS}" STREQUAL "")
endif()

if(NOT "${PCL_DEFINITIONS}" STREQUAL "")
list(REMOVE_DUPLICATES PCL_DEFINITIONS)
endif(NOT "${PCL_DEFINITIONS}" STREQUAL "")
endif()

pcl_remove_duplicate_libraries(PCL_COMPONENTS PCL_LIBRARIES)

Expand Down
2 changes: 1 addition & 1 deletion PCLConfigVersion.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
if("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
Loading

0 comments on commit 52eb8a1

Please sign in to comment.