Skip to content

Commit

Permalink
Bring back deprecated <Project>_ASSERT_MISSING_PACKAGES (trilinos/Tri…
Browse files Browse the repository at this point in the history
…linos#11429)

I also added a test to make sure it should at least for the case
<Project>_ASSERT_MISSING_PACKAGES=ON.  For the case 'OFF', it just sets INGORE
by default (and should be correct by simple inspection).

See new CHANGLOG entry.
  • Loading branch information
bartlettroscoe committed Jan 10, 2023
1 parent 6d68c89 commit bf7c58f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
18 changes: 18 additions & 0 deletions test/core/DependencyUnitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,24 @@ create_dependency_handling_test_case(
)


create_dependency_handling_test_case(
preCopyrightTrilinos_ShowInvalidPackageNameAndTplNameError_AssertMissingPackagesOn
ARGS
-DSHOW_INVALID_PACKAGE_NAME_ERROR=ON
-DSHOW_INVALID_TPL_NAME_ERROR=ON
-DTrilinos_ASSERT_MISSING_PACKAGES=ON
PASS_REGULAR_EXPRESSION_ALL
"CMake Deprecation Warning at .*/MessageWrapper.cmake:.+ [(]message[)]:"
" Warning, Trilinos_ASSERT_MISSING_PACKAGES='ON' is set and is no longer"
" supported! Please set Trilinos_ASSERT_DEFINED_DEPENDENCIES instead [(]see"
" build ref[)]!"
"CMake Error at .*/TribitsReadDepsFilesCreateDepsGraph.cmake:.+ [(]message[)]:"
"Error, the package 'Zlib' is listed as a dependency of the package 'Zoltan'"
"ignore/disable the undefined package 'Zlib', set the cache variable"
"Trilinos_ASSERT_DEFINED_DEPENDENCIES=IGNORE[.]"
)


create_dependency_handling_test_case(
preCopyrightTrilinos_ShowInvalidPackageSelfDependency
ARGS -DTrilinos_EXTRA_REPOSITORIES=preCopyrightTrilinos
Expand Down
9 changes: 9 additions & 0 deletions tribits/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
ChangeLog for TriBITS
----------------------------------------

## 2023-01-10:

* **Added:** Added back support for deprecated variable
`<Project>_ASSERT_MISSING_PACKAGES` that was removed
[2022-10-11](#2022-10-11). When `<Project>_ASSERT_MISSING_PACKAGES` is set
to a non-null value, it overrides the default value for
`<Project>_ASSERT_DEFINED_DEPENDENCIES` (but setting
`<Project>_ASSERT_DEFINED_DEPENDENCIES` in the cache takes precedence).

## 2023-01-06:

* **Changed:** Changed all TPL dependencies back to 'Optional' so that
Expand Down
20 changes: 13 additions & 7 deletions tribits/core/package_arch/TribitsGlobalMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -720,13 +720,26 @@ macro(tribits_define_global_options_and_define_extra_repos)
"Determines if a variety of development mode checks are turned on by default or not."
)

if (NOT "${${PROJECT_NAME}_ASSERT_MISSING_PACKAGES}" STREQUAL "")
tribits_deprecated("Warning, ${PROJECT_NAME}_ASSERT_MISSING_PACKAGES="
"'${${PROJECT_NAME}_ASSERT_MISSING_PACKAGES}' is set and is no"
" longer supported! Please set"
" ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES instead (see build ref)!" )
if (${PROJECT_NAME}_ASSERT_MISSING_PACKAGES)
set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT FATAL_ERROR)
else()
set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT IGNORE)
endif()
endif()

if ("${${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT}" STREQUAL "")
if (${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE)
set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT FATAL_ERROR)
else()
set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT IGNORE)
endif()
endif()

set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST
"FATAL_ERROR" "SEND_ERROR" )
set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_VALUES_LIST
Expand All @@ -740,13 +753,6 @@ macro(tribits_define_global_options_and_define_extra_repos)
${${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_VALUES_LIST}
IS_ADVANCED )

if (NOT "${${PROJECT_NAME}_ASSERT_MISSING_PACKAGES}" STREQUAL "")
message(FATAL_ERROR "Error, ${PROJECT_NAME}_ASSERT_MISSING_PACKAGES="
" '${${PROJECT_NAME}_ASSERT_MISSING_PACKAGES}' is set and is no"
" longer supported! Please set"
" ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES=FATAL_ERROR instead!" )
endif()

if ("${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT}" STREQUAL "")
if (${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE)
set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT FATAL_ERROR)
Expand Down

0 comments on commit bf7c58f

Please sign in to comment.