From 5323a4af20bd455217bbfc59e47b20feeac5adb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Agostinho?= Date: Fri, 24 May 2019 10:06:17 +0200 Subject: [PATCH] [cmake/tests] Fix find_package_handle_standard_args incorrect argument * Fix regression introduced in 32d6cefe6581239f69c61e243e85a5a1b5a51680 * find_package_handle_standard_args is meant to be invoked with the same package name as a preceding call to find_package. Without it, it won't be able to tell, if the package is required or optional. --- CMakeLists.txt | 6 ------ cmake/Modules/FindGTestSource.cmake | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e85b59046f..4223696fc37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -421,12 +421,6 @@ configure_file("${pcl_config_h_in}" "${pcl_config_h}") PCL_ADD_INCLUDES(common "" "${pcl_config_h}") include_directories("${CMAKE_CURRENT_BINARY_DIR}/include") -### ---[ Set up for tests -enable_testing() - -### ---[ Set up for examples -#include("${PCL_SOURCE_DIR}/cmake/pcl_examples.cmake") - ### ---[ Add the libraries subdirectories include("${PCL_SOURCE_DIR}/cmake/pcl_targets.cmake") diff --git a/cmake/Modules/FindGTestSource.cmake b/cmake/Modules/FindGTestSource.cmake index 801886f1435..e4c6e133dd4 100644 --- a/cmake/Modules/FindGTestSource.cmake +++ b/cmake/Modules/FindGTestSource.cmake @@ -32,7 +32,8 @@ set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR}) set(CMAKE_FIND_FRAMEWORK) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Gtest DEFAULT_MSG GTEST_INCLUDE_DIR GTEST_SRC_DIR) +find_package_handle_standard_args(GTestSource DEFAULT_MSG GTEST_INCLUDE_DIR GTEST_SRC_DIR) +set(GTEST_FOUND ${GTestSource_FOUND}) mark_as_advanced(GTEST_INCLUDE_DIR GTEST_SRC_DIR)