build: (fixes #815) Configure find_program to search for AppBundles last in MacOS
This commit is contained in:
20
build-support/3rd-party/find-program-hints.cmake
vendored
Normal file
20
build-support/3rd-party/find-program-hints.cmake
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
set(3RD_PARTY_FIND_PROGRAM_HINTS
|
||||
# find_program HINTS for Doxygen
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/FindDoxygen.cmake
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\doxygen_is1;Inno Setup: App Path]/bin"
|
||||
/Applications/Doxygen.app/Contents/Resources
|
||||
/Applications/Doxygen.app/Contents/MacOS
|
||||
/Applications/Utilities/Doxygen.app/Contents/Resources
|
||||
/Applications/Utilities/Doxygen.app/Contents/MacOS
|
||||
# find_program HINTS for Dia
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/FindDoxygen.cmake
|
||||
"$ENV{ProgramFiles}/Dia"
|
||||
"$ENV{ProgramFiles\(x86\)}/Dia"
|
||||
# find_program HINTS for Graphviz
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/FindDoxygen.cmake
|
||||
"$ENV{ProgramFiles}/ATT/Graphviz/bin"
|
||||
"C:/Program Files/ATT/Graphviz/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ATT\\Graphviz;InstallPath]/bin"
|
||||
/Applications/Graphviz.app/Contents/MacOS
|
||||
/Applications/Utilities/Graphviz.app/Contents/MacOS
|
||||
)
|
||||
@@ -59,6 +59,12 @@ endif()
|
||||
|
||||
if(APPLE)
|
||||
add_definitions(-D__APPLE__)
|
||||
# cmake-format: off
|
||||
# Configure find_program to search for AppBundles only if programs are not found in PATH.
|
||||
# This prevents Doxywizard from being launched when the Doxygen.app is installed.
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/FindDoxygen.cmake
|
||||
# cmake-format: on
|
||||
set(CMAKE_FIND_APPBUNDLE "LAST")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
@@ -317,6 +323,9 @@ macro(clear_global_cached_variables)
|
||||
)
|
||||
endmacro()
|
||||
|
||||
# Include CMake file with common find_program HINTS
|
||||
include(build-support/3rd-party/find-program-hints.cmake)
|
||||
|
||||
# function used to search for package and program dependencies than store list
|
||||
# of missing dependencies in the list whose name is stored in missing_deps
|
||||
function(check_deps package_deps program_deps missing_deps)
|
||||
@@ -335,7 +344,9 @@ function(check_deps package_deps program_deps missing_deps)
|
||||
# here or it won't check other dependencies
|
||||
string(TOUPPER ${program} upper_${program})
|
||||
mark_as_advanced(${upper_${program}})
|
||||
find_program(${upper_${program}} ${program})
|
||||
find_program(
|
||||
${upper_${program}} ${program} HINTS ${3RD_PARTY_FIND_PROGRAM_HINTS}
|
||||
)
|
||||
if("${${upper_${program}}}" STREQUAL "${upper_${program}}-NOTFOUND")
|
||||
list(APPEND local_missing_deps ${program})
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user