Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Enhacements to the dependency report #4294

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ jobs:
OIIO_CMAKE_FLAGS=-DUSE_PYTHON=0
LLVM_VERSION=17.0.6 LLVM_DISTRO_NAME=ubuntu-22.04
SKIP_SYSTEM_DEPS_INSTALL=1 QT_VERSION=0
OpenImageIO_BUILD_MISSING_DEPS=none

runs-on: ${{ matrix.runner }}
env:
Expand Down
1 change: 1 addition & 0 deletions src/cmake/build_Robinmap.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ set (Robinmap_ROOT ${Robinmap_INSTALL_DIR})

# Signal to caller that we need to find again at the installed location
set (Robinmap_REFIND TRUE)
set (Robinmap_VERSION ${Robinmap_BUILD_VERSION})
49 changes: 37 additions & 12 deletions src/cmake/dependency_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set_cache (${PROJECT_NAME}_BUILD_LOCAL_DEPS ""
set_cache (${PROJECT_NAME}_LOCAL_DEPS_ROOT "${PROJECT_BINARY_DIR}/deps"
"Directory were we do local builds of dependencies")
list (APPEND CMAKE_PREFIX_PATH ${${PROJECT_NAME}_LOCAL_DEPS_ROOT}/dist)
include_directories(BEFORE ${${PROJECT_NAME}_LOCAL_DEPS_ROOT}/include)

# Build type for locally built dependencies. Default to the same build type
# as the current project.
Expand All @@ -39,6 +40,7 @@ endif ()

# Track all build deps we find with checked_find_package
set (CFP_ALL_BUILD_DEPS_FOUND "")
set (CFP_EXTERNAL_BUILD_DEPS_FOUND "")

# Track all build deps we failed to find with checked_find_package
set (CFP_ALL_BUILD_DEPS_NOTFOUND "")
Expand Down Expand Up @@ -74,24 +76,38 @@ function (print_package_notfound_report)
if (CFP_ALL_BUILD_DEPS_NOTFOUND OR CFP_ALL_BUILD_DEPS_BADVERSION)
message (STATUS)
message (STATUS "${ColorBoldYellow}=========================================================================${ColorReset}")
message (STATUS "${ColorBoldYellow}= Dependency report =${ColorReset}")
message (STATUS "${ColorBoldYellow}=========================================================================${ColorReset}")
message (STATUS)
if (CFP_ALL_BUILD_DEPS_NOTFOUND)
message (STATUS "${ColorBoldWhite}The following dependencies were not found:${ColorReset}")
foreach (_pkg IN LISTS CFP_ALL_BUILD_DEPS_NOTFOUND)
if (_pkg IN_LIST CFP_LOCALLY_BUILT_DEPS)
message (STATUS " ${_pkg} ${ColorMagenta}(BUILT LOCALLY)${ColorReset}")
else ()
message (STATUS " ${_pkg}")
endif ()
if (CFP_EXTERNAL_BUILD_DEPS_FOUND)
message (STATUS "${ColorBoldWhite}The following dependencies found externally:${ColorReset}")
list (SORT CFP_EXTERNAL_BUILD_DEPS_FOUND CASE INSENSITIVE)
list (REMOVE_DUPLICATES CFP_EXTERNAL_BUILD_DEPS_FOUND)
foreach (_pkg IN LISTS CFP_EXTERNAL_BUILD_DEPS_FOUND)
message (STATUS " ${_pkg} ${${_pkg}_VERSION}")
endforeach ()
endif ()
if (CFP_ALL_BUILD_DEPS_BADVERSION)
message (STATUS "${ColorBoldWhite}The following dependencies were found but were too old:${ColorReset}")
list (SORT CFP_ALL_BUILD_DEPS_BADVERSION CASE INSENSITIVE)
list (REMOVE_DUPLICATES CFP_ALL_BUILD_DEPS_BADVERSION)
foreach (_pkg IN LISTS CFP_ALL_BUILD_DEPS_BADVERSION)
if (_pkg IN_LIST CFP_LOCALLY_BUILT_DEPS)
message (STATUS " ${_pkg} ${ColorMagenta}(BUILT LOCALLY)${ColorReset}")
message (STATUS " ${_pkg} ${${_pkg}_NOT_FOUND_EXPLANATION} ${ColorMagenta}(${${_pkg}_VERSION} BUILT LOCALLY)${ColorReset}")
else ()
message (STATUS " ${_pkg} ${${_pkg}_NOT_FOUND_EXPLANATION}")
endif ()
endforeach ()
endif ()
if (CFP_ALL_BUILD_DEPS_NOTFOUND)
message (STATUS "${ColorBoldWhite}The following dependencies were not found:${ColorReset}")
list (SORT CFP_ALL_BUILD_DEPS_NOTFOUND CASE INSENSITIVE)
list (REMOVE_DUPLICATES CFP_ALL_BUILD_DEPS_NOTFOUND)
foreach (_pkg IN LISTS CFP_ALL_BUILD_DEPS_NOTFOUND)
if (_pkg IN_LIST CFP_LOCALLY_BUILT_DEPS)
message (STATUS " ${_pkg} ${_${_pkg}_version_range} ${${_pkg}_NOT_FOUND_EXPLANATION} ${ColorMagenta}(${${_pkg}_VERSION} BUILT LOCALLY)${ColorReset}")
else ()
message (STATUS " ${_pkg}")
message (STATUS " ${_pkg} ${_${_pkg}_version_range} ${${_pkg}_NOT_FOUND_EXPLANATION}")
endif ()
endforeach ()
endif ()
Expand Down Expand Up @@ -159,6 +175,13 @@ function (reject_out_of_range_versions pkgname pkgversion versionmin versionmax
# if (${pkgname}_local_build_script_exists)
# list (APPEND CFP_LOCALLY_BUILDABLE_DEPS_BADVERSION ${pkgname})
# endif ()
if (versionmax VERSION_GREATER_EQUAL 10000)
set (${pkgname}_NOT_FOUND_EXPLANATION
"(found ${pkgversion}, needed >= ${versionmin})" PARENT_SCOPE)
else ()
set (${pkgname}_NOT_FOUND_EXPLANATION
"(found ${pkgversion}, needed ${versionmin} ... ${versionmax})" PARENT_SCOPE)
endif ()
unset (${pkgname}_FOUND PARENT_SCOPE)
unset (${pkgname}_VERSION PARENT_SCOPE)
unset (${pkgname}_INCLUDE PARENT_SCOPE)
Expand Down Expand Up @@ -370,7 +393,9 @@ macro (checked_find_package pkgname)
reject_out_of_range_versions (${pkgname} ${${pkgname}_VERSION}
${_pkg_VERSION_MIN} ${_pkg_VERSION_MAX}
_pkg_version_in_range)
if (NOT _pkg_version_in_range)
if (_pkg_version_in_range)
list (APPEND CFP_EXTERNAL_BUILD_DEPS_FOUND ${pkgname})
else ()
message (STATUS "${ColorRed}${pkgname} ${${pkgname}_VERSION} is outside the required range ${_pkg_VERSION_MIN}...${_pkg_VERSION_MAX} ${ColorReset}")
list (APPEND CFP_ALL_BUILD_DEPS_BADVERSION ${pkgname})
if (${pkgname}_local_build_script_exists)
Expand Down Expand Up @@ -454,7 +479,7 @@ macro (checked_find_package pkgname)
message (STATUS "${ColorRed}Not using ${pkgname} -- disabled ${_disablereason} ${ColorReset}")
endif ()
endif ()
unset (_${pkgname}_version_range)
# unset (_${pkgname}_version_range)
endmacro()


Expand Down
Loading