Do not assume Homebrew usage
Let the user decide whether Homebrew packages are to be used.
Fixes #1038
Change-Id: I5cab1cc447f3fe570a8c02d20add465606e6d726
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8e49c19..dba51db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
# Ceres Solver - A fast non-linear least squares minimizer
-# Copyright 2023 Google Inc. All rights reserved.
+# Copyright 2024 Google Inc. All rights reserved.
# http://ceres-solver.org/
#
# Redistribution and use in source and binary forms, with or without
@@ -30,27 +30,6 @@
# alexs.mac@gmail.com (Alex Stewart)
cmake_minimum_required(VERSION 3.16...3.27)
-
-# On macOS, add the Homebrew prefix (with appropriate suffixes) to the
-# respective HINTS directories (after any user-specified locations). This
-# handles Homebrew installations into non-standard locations (not /usr/local).
-# We do not use CMAKE_PREFIX_PATH for this as given the search ordering of
-# find_xxx(), doing so would override any user-specified HINTS locations with
-# the Homebrew version if it exists.
-if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
- find_program(HOMEBREW_EXECUTABLE brew)
- mark_as_advanced(FORCE HOMEBREW_EXECUTABLE)
- if (HOMEBREW_EXECUTABLE)
- # Detected a Homebrew install, query for its install prefix.
- execute_process(COMMAND ${HOMEBREW_EXECUTABLE} --prefix
- OUTPUT_VARIABLE HOMEBREW_INSTALL_PREFIX
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "Detected Homebrew with install prefix: "
- "${HOMEBREW_INSTALL_PREFIX}, adding to CMake search paths.")
- list(APPEND CMAKE_PREFIX_PATH "${HOMEBREW_INSTALL_PREFIX}")
- endif()
-endif()
-
project(Ceres C CXX)
# NOTE: The following CMake variables must be applied consistently to all