Skip to content

Commit

Permalink
Updated minimum required cmake to 3.16.3. Removed *_ROOT variables fr…
Browse files Browse the repository at this point in the history
…om any find_X calls as hints as they should be used automatically now.
  • Loading branch information
larshg committed Aug 21, 2024
1 parent fcc7f41 commit b71222c
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 38 deletions.
8 changes: 1 addition & 7 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
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
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
4 changes: 0 additions & 4 deletions cmake/Modules/FindOpenNI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ find_path(OPENNI_INCLUDE_DIR XnStatus.h
/usr/include/openni
/usr/include/ni
/opt/local/include/ni
"${OPENNI_ROOT}"
"$ENV{OPENNI_ROOT}"
PATHS "$ENV{OPEN_NI_INSTALL_PATH${OPENNI_SUFFIX}}/Include"
PATH_SUFFIXES openni include Include)

Expand All @@ -38,8 +36,6 @@ find_library(OPENNI_LIBRARY
HINTS ${PC_OPENNI_LIBDIR}
${PC_OPENNI_LIBRARY_DIRS}
/usr/lib
"${OPENNI_ROOT}"
"$ENV{OPENNI_ROOT}"
PATHS "$ENV{OPEN_NI_LIB${OPENNI_SUFFIX}}"
PATH_SUFFIXES lib Lib Lib64)

Expand Down
6 changes: 1 addition & 5 deletions cmake/Modules/FindQhull.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ endif()

find_file(QHULL_HEADER
NAMES libqhull_r.h
HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}" "${QHULL_INCLUDE_DIR}"
HINTS "${QHULL_INCLUDE_DIR}"
PATHS "$ENV{PROGRAMFILES}/QHull" "$ENV{PROGRAMW6432}/QHull"
PATH_SUFFIXES qhull_r src/libqhull_r libqhull_r include)

Expand All @@ -103,25 +103,21 @@ endif()

find_library(QHULL_LIBRARY_SHARED
NAMES qhull_r qhull
HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}"
PATHS "$ENV{PROGRAMFILES}/QHull" "$ENV{PROGRAMW6432}/QHull"
PATH_SUFFIXES project build bin lib)

find_library(QHULL_LIBRARY_DEBUG
NAMES qhull_rd qhull_d
HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}"
PATHS "$ENV{PROGRAMFILES}/QHull" "$ENV{PROGRAMW6432}/QHull"
PATH_SUFFIXES project build bin lib debug/lib)

find_library(QHULL_LIBRARY_STATIC
NAMES qhullstatic_r
HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}"
PATHS "$ENV{PROGRAMFILES}/QHull" "$ENV{PROGRAMW6432}/QHull"
PATH_SUFFIXES project build bin lib)

find_library(QHULL_LIBRARY_DEBUG_STATIC
NAMES qhullstatic_rd
HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}"
PATHS "$ENV{PROGRAMFILES}/QHull" "$ENV{PROGRAMW6432}/QHull"
PATH_SUFFIXES project build bin lib debug/lib)

Expand Down

0 comments on commit b71222c

Please sign in to comment.