Skip to content

Commit

Permalink
Merge pull request #6100 from larshg/RemoveFindScripts
Browse files Browse the repository at this point in the history
Remove findGLEW and FindOpenMP as they are already present in CMake. Update minimum required cmake to 3.16.3
  • Loading branch information
larshg authored Sep 19, 2024
2 parents aabe846 + 5ae66ee commit d231dde
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 730 deletions.
20 changes: 7 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
### ---[ PCL global CMake
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)

if(POLICY CMP0074)
# 1. Remove with 3.12.4.
# 2. Remove search paths with *_ROOT since they will be automatically checked
cmake_policy(SET CMP0074 NEW)
endif()
cmake_minimum_required(VERSION 3.16.3 FATAL_ERROR)

# Set target C++ standard and required compiler features
set(CMAKE_CXX_STANDARD 14 CACHE STRING "The target C++ standard. PCL requires C++14 or higher.")
Expand Down Expand Up @@ -369,6 +363,12 @@ if(WITH_CUDA)
include("${PCL_SOURCE_DIR}/cmake/pcl_find_cuda.cmake")
endif()

# find GLEW before VTK as it uses custom findGLEW that doesn't work with cmakes findGLEW.
option(WITH_GLEW "Support for GLEW" TRUE)
if(WITH_GLEW)
find_package(GLEW QUIET)
endif()


# Reset VTK_FOUND to off
set(VTK_FOUND OFF)
Expand Down Expand Up @@ -401,12 +401,6 @@ if(WITH_OPENGL)
include("${PCL_SOURCE_DIR}/cmake/pcl_find_gl.cmake")
endif()

# GLEW
option(WITH_GLEW "Support for GLEW" TRUE)
if(WITH_GLEW)
find_package(GLEW QUIET)
endif()

# Boost (required)
include("${PCL_SOURCE_DIR}/cmake/pcl_find_boost.cmake")

Expand Down
11 changes: 1 addition & 10 deletions PCLConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,7 @@
#------------------------------------------------------------------------------------

# Set default policy behavior similar to minimum requirement version
cmake_policy(VERSION 3.10)

# explicitly set policies we already support in newer cmake versions
if(POLICY CMP0074)
# TODO: update *_ROOT variables to be PCL_*_ROOT or equivalent.
# CMP0074 directly affects how Find* modules work and *_ROOT variables. Since
# this is a config file that will be consumed by parent projects with (likely)
# NEW behavior, we need to push a policy stack.
cmake_policy(SET CMP0074 NEW)
endif()
cmake_policy(VERSION 3.16.3)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Modules")

Expand Down
10 changes: 0 additions & 10 deletions cmake/Modules/FindFLANN.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ find_path(FLANN_INCLUDE_DIR
flann/flann.hpp
HINTS
${PC_FLANN_INCLUDE_DIRS}
${FLANN_ROOT}
$ENV{FLANN_ROOT}
PATHS
$ENV{PROGRAMFILES}/Flann
$ENV{PROGRAMW6432}/Flann
Expand All @@ -118,8 +116,6 @@ find_library(FLANN_LIBRARY_SHARED
flann_cpp
HINTS
${PC_FLANN_LIBRARY_DIRS}
${FLANN_ROOT}
$ENV{FLANN_ROOT}
PATHS
$ENV{PROGRAMFILES}/Flann
$ENV{PROGRAMW6432}/Flann
Expand All @@ -132,8 +128,6 @@ find_library(FLANN_LIBRARY_DEBUG_SHARED
flann_cpp-gd flann_cppd
HINTS
${PC_FLANN_LIBRARY_DIRS}
${FLANN_ROOT}
$ENV{FLANN_ROOT}
PATHS
$ENV{PROGRAMFILES}/Flann
$ENV{PROGRAMW6432}/Flann
Expand All @@ -146,8 +140,6 @@ find_library(FLANN_LIBRARY_STATIC
flann_cpp_s
HINTS
${PC_FLANN_LIBRARY_DIRS}
${FLANN_ROOT}
$ENV{FLANN_ROOT}
PATHS
$ENV{PROGRAMFILES}/Flann
$ENV{PROGRAMW6432}/Flann
Expand All @@ -160,8 +152,6 @@ find_library(FLANN_LIBRARY_DEBUG_STATIC
flann_cpp_s-gd flann_cpp_sd
HINTS
${PC_FLANN_LIBRARY_DIRS}
${FLANN_ROOT}
$ENV{FLANN_ROOT}
PATHS
$ENV{PROGRAMFILES}/Flann
$ENV{PROGRAMW6432}/Flann
Expand Down
69 changes: 0 additions & 69 deletions cmake/Modules/FindGLEW.cmake

This file was deleted.

2 changes: 0 additions & 2 deletions cmake/Modules/FindGTestSource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ if(APPLE)
endif()

find_path(GTEST_INCLUDE_DIR gtest/gtest.h
HINTS "${GTEST_ROOT}" "$ENV{GTEST_ROOT}"
PATHS "$ENV{PROGRAMFILES}/gtest" "$ENV{PROGRAMW6432}/gtest"
PATHS "$ENV{PROGRAMFILES}/gtest-1.7.0" "$ENV{PROGRAMW6432}/gtest-1.7.0"
PATH_SUFFIXES gtest include/gtest include)

find_path(GTEST_SRC_DIR src/gtest-all.cc
HINTS "${GTEST_ROOT}" "$ENV{GTEST_ROOT}"
PATHS "$ENV{PROGRAMFILES}/gtest" "$ENV{PROGRAMW6432}/gtest"
PATHS "$ENV{PROGRAMFILES}/gtest-1.7.0" "$ENV{PROGRAMW6432}/gtest-1.7.0"
PATH /usr/src/googletest
Expand Down
Loading

0 comments on commit d231dde

Please sign in to comment.