Skip to content

Commit

Permalink
cmake [FIXUP]: Move find_program(brew) out from introspection file
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Apr 30, 2024
1 parent 6640654 commit 017aeda
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
4 changes: 0 additions & 4 deletions cmake/introspection.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,3 @@ check_cxx_source_compiles("
int main(){}
" HAVE_DLLEXPORT_ATTRIBUTE
)

if(CMAKE_HOST_APPLE)
find_program(BREW_COMMAND brew)
endif()
26 changes: 15 additions & 11 deletions cmake/module/FindBerkeleyDB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,21 @@ This module defines the following variables:
#]=======================================================================]

if(BREW_COMMAND)
# The Homebrew package manager installs the berkeley-db* packages as
# "keg-only", which means they are not symlinked into the default prefix.
# To find such a package, the find_path() and find_library() commands
# need additional path hints that are computed by Homebrew itself.
execute_process(
COMMAND ${BREW_COMMAND} --prefix berkeley-db@4
OUTPUT_VARIABLE _BerkeleyDB_homebrew_prefix
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(_BerkeleyDB_homebrew_prefix)
if(CMAKE_HOST_APPLE)
find_program(HOMEBREW_EXECUTABLE brew)
if(HOMEBREW_EXECUTABLE)
# The Homebrew package manager installs the berkeley-db* packages as
# "keg-only", which means they are not symlinked into the default prefix.
# To find such a package, the find_path() and find_library() commands
# need additional path hints that are computed by Homebrew itself.
execute_process(
COMMAND ${HOMEBREW_EXECUTABLE} --prefix berkeley-db@4
OUTPUT_VARIABLE _BerkeleyDB_homebrew_prefix
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
endif()

find_path(BerkeleyDB_INCLUDE_DIR
Expand Down
18 changes: 11 additions & 7 deletions cmake/optional_qt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ if(WITH_GUI)
set(QT_NO_CREATE_VERSIONLESS_FUNCTIONS ON)
set(QT_NO_CREATE_VERSIONLESS_TARGETS ON)

if(BREW_COMMAND)
execute_process(
COMMAND ${BREW_COMMAND} --prefix qt@5
OUTPUT_VARIABLE qt5_brew_prefix
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(qt5_brew_prefix)
if(CMAKE_HOST_APPLE)
find_program(HOMEBREW_EXECUTABLE brew)
if(HOMEBREW_EXECUTABLE)
execute_process(
COMMAND ${HOMEBREW_EXECUTABLE} --prefix qt@5
OUTPUT_VARIABLE qt5_brew_prefix
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
endif()

if(WITH_GUI STREQUAL "AUTO")
Expand Down

0 comments on commit 017aeda

Please sign in to comment.