Skip to content

Commit

Permalink
Revert "Only assert defined vars conditionally"
Browse files Browse the repository at this point in the history
This reverts commit 05d4429.
  • Loading branch information
bartlettroscoe committed Oct 6, 2023
1 parent 05d4429 commit 4be87d2
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tribits/core/package_arch/TribitsPackageMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -440,19 +440,13 @@ macro(tribits_disable_optional_dependency upstreamPackageName reasonStr)
" Instead, please call this from the package's base CMakeLists.txt file"
" '${${PACKAGE_NAME}_SOURCE_DIR}/CMakeLists.txt'" )
endif()
# Get the variable names that are going to be set
# Get the variable names that are going to be set assert they exist already
set(packageEnableVarName ${PACKAGE_NAME}_ENABLE_${upstreamPackageName})
assert_defined(${packageEnableVarName})
string(TOUPPER ${upstreamPackageName} upstreamPackageName_UC)
set(havePackageUpstreamPackageMacroVarName
HAVE_${PACKAGE_NAME_UC}_${upstreamPackageName_UC})
# Assert that the vars already exist (to make sure the package and dependency exist)
if (${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES IN_LIST
${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST
)
# We only assert if all packages have to exist, which is not true in a reduced source tree
assert_defined(${packageEnableVarName})
assert_defined(${havePackageUpstreamPackageMacroVarName})
endif()
assert_defined(${havePackageUpstreamPackageMacroVarName})
# Set the variables to OFF in local and project-level scopes
if (NOT "${reasonStr}" STREQUAL "")
message("-- ${reasonStr}")
Expand Down

0 comments on commit 4be87d2

Please sign in to comment.