Skip to content

Commit

Permalink
WIP: Change name of TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE() to TRIBITS…
Browse files Browse the repository at this point in the history
…_REPORT_INVALID_TRIBITS_USAGE() (#200)
  • Loading branch information
bartlettroscoe committed May 8, 2019
1 parent 5bb1101 commit 770480c
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 48 deletions.
10 changes: 5 additions & 5 deletions tribits/core/package_arch/TribitsAddExecutable.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ INCLUDE(TribitsAddExecutableTestHelpers)
INCLUDE(TribitsCommonArgsHelpers)
INCLUDE(TribitsAddTestHelpers)
INCLUDE(TribitsGeneralMacros)
INCLUDE(TribitsAssertCorrectTribitsUsage)
INCLUDE(TribitsReportInvalidTribitsUsage)

INCLUDE(PrintVar)
INCLUDE(AppendSet)
Expand Down Expand Up @@ -345,13 +345,13 @@ FUNCTION(TRIBITS_ADD_EXECUTABLE EXE_NAME)
# This is a subpackage being processed

IF(NOT ${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_SUBPACKAGE() before TRIBITS_ADD_EXECUTABLE()"
" in ${CURRENT_SUBPACKAGE_CMAKELIST_FILE}")
ENDIF()

IF(${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_POSTPROCESS_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_ADD_EXECUTABLE() before "
" TRIBITS_SUBPACKAGE_POSTPROCESS() in ${CURRENT_SUBPACKAGE_CMAKELIST_FILE}")
ENDIF()
Expand All @@ -361,13 +361,13 @@ FUNCTION(TRIBITS_ADD_EXECUTABLE EXE_NAME)
# This is a package being processed

IF(NOT ${PACKAGE_NAME}_TRIBITS_PACKAGE_DECL_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_PACKAGE() or TRIBITS_PACKAGE_DECL() before"
" TRIBITS_ADD_EXECUTABLE() in ${TRIBITS_PACKAGE_CMAKELIST_FILE}")
ENDIF()

IF(${PACKAGE_NAME}_TRIBITS_PACKAGE_POSTPROCESS_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_ADD_EXECUTABLE() before "
" TRIBITS_PACKAGE_POSTPROCESS() in ${TRIBITS_PACKAGE_CMAKELIST_FILE}")
ENDIF()
Expand Down
10 changes: 5 additions & 5 deletions tribits/core/package_arch/TribitsLibraryMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ INCLUDE(AppendStringVar)
INCLUDE(PrependGlobalSet)
INCLUDE(RemoveGlobalDuplicates)
INCLUDE(TribitsGeneralMacros)
INCLUDE(TribitsAssertCorrectTribitsUsage)
INCLUDE(TribitsReportInvalidTribitsUsage)
INCLUDE(SetAndIncDirs)

###
Expand Down Expand Up @@ -484,13 +484,13 @@ FUNCTION(TRIBITS_ADD_LIBRARY LIBRARY_NAME_IN)
# This is a subpackage being processed

IF(NOT ${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_SUBPACKAGE() before TRIBITS_ADD_LIBRARY()"
" in ${CURRENT_SUBPACKAGE_CMAKELIST_FILE}")
ENDIF()

IF(${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_POSTPROCESS_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_ADD_LIBRARY() before "
" TRIBITS_SUBPACKAGE_POSTPROCESS() in ${CURRENT_SUBPACKAGE_CMAKELIST_FILE}")
ENDIF()
Expand All @@ -500,13 +500,13 @@ FUNCTION(TRIBITS_ADD_LIBRARY LIBRARY_NAME_IN)
# This is a package being processed

IF(NOT ${PACKAGE_NAME}_TRIBITS_PACKAGE_DECL_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_PACKAGE() or TRIBITS_PACKAGE_DECL() before"
" TRIBITS_ADD_LIBRARY() in ${TRIBITS_PACKAGE_CMAKELIST_FILE}")
ENDIF()

IF(${PACKAGE_NAME}_TRIBITS_PACKAGE_POSTPROCESS_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_ADD_LIBRARY() before "
" TRIBITS_PACKAGE_POSTPROCESS() in ${TRIBITS_PACKAGE_CMAKELIST_FILE}")
ENDIF()
Expand Down
52 changes: 26 additions & 26 deletions tribits/core/package_arch/TribitsPackageMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ INCLUDE(TribitsAddExecutableAndTest)
INCLUDE(TribitsAddTest)
INCLUDE(TribitsAddAdvancedTest)
INCLUDE(TribitsCopyFilesToBinaryDir)
INCLUDE(TribitsAssertCorrectTribitsUsage)
INCLUDE(TribitsReportInvalidTribitsUsage)


###
Expand Down Expand Up @@ -190,14 +190,14 @@ MACRO(TRIBITS_PACKAGE_DECL PACKAGE_NAME_IN)
ENDIF()

IF (CURRENTLY_PROCESSING_SUBPACKAGE)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Cannot call TRIBITS_PACKAGE_DECL() in a subpackage."
" Use TRIBITS_SUBPACKAGE() instead"
" error in ${CURRENT_SUBPACKAGE_CMAKELIST_FILE}")
ENDIF()

IF(${PACKAGE_NAME}_TRIBITS_PACKAGE_DECL_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"TRIBITS_PACKAGE_DECL() called more than once in Package ${PACKAGE_NAME}"
" This may be because TRIBITS_PACKAGE_DECL was expicitly called more than once or"
" TRIBITS_PACKAGE_DECL was called after TRIBITS_PACKAGE. You do not need both."
Expand Down Expand Up @@ -306,7 +306,7 @@ MACRO(TRIBITS_PACKAGE_DEF)
# check that this is not being called from a subpackage
IF(NOT ${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_POSTPROCESS_CALLED)
IF (CURRENTLY_PROCESSING_SUBPACKAGE)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Cannot call TRIBITS_PACKAGE_DEF() in a subpackage."
" Use TRIBITS_SUBPACKAGE() instead"
" error in ${CURRENT_SUBPACKAGE_CMAKELIST_FILE}")
Expand All @@ -318,7 +318,7 @@ MACRO(TRIBITS_PACKAGE_DEF)

# check that this is not called morethan once in a package
IF (${PACKAGE_NAME}_TRIBITS_PACKAGE_DEF_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"TRIBITS_PACKAGE_DEF was called more than once in"
"${CURRENT_SUBPACKAGE_CMAKELIST_FILE}")
ENDIF()
Expand Down Expand Up @@ -369,15 +369,15 @@ MACRO(TRIBITS_PACKAGE PACKAGE_NAME_IN)

IF (CURRENTLY_PROCESSING_SUBPACKAGE)
IF (NOT ${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_POSTPROCESS_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Cannot call TRIBITS_PACKAGE() in a subpackage."
" Use TRIBITS_SUBPACKAGE() instead"
" error in ${CURRENT_SUBPACKAGE_CMAKELIST_FILE}")
ENDIF()
ENDIF()

IF(${PACKAGE_NAME}_SUBPACKAGES)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"This package has subpackages so you cannot use TRIBITS_PACKAGE()"
"\n Instead use the following call order:"
"\n TRIBITS_PROJECT_DECL(${PACKAGE_NAME})"
Expand All @@ -388,7 +388,7 @@ MACRO(TRIBITS_PACKAGE PACKAGE_NAME_IN)
ENDIF()

IF(${PACKAGE_NAME}_TRIBITS_PACKAGE_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Package ${PACKAGE_NAME} declared more than once!")
ENDIF()

Expand Down Expand Up @@ -427,13 +427,13 @@ MACRO(TRIBITS_ADD_TEST_DIRECTORIES)
# This is a subpackage being processed

IF(NOT ${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_SUBPACKAGE() before TRIBITS_ADD_TEST_DIRECTORIES()"
" in ${CURRENT_SUBPACKAGE_CMAKELIST_FILE}")
ENDIF()

IF(${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_POSTPROCESS_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_ADD_TEST_DIRECTORIES() before "
" TRIBITS_SUBPACKAGE_POSTPROCESS() in ${CURRENT_SUBPACKAGE_CMAKELIST_FILE}")
ENDIF()
Expand All @@ -443,13 +443,13 @@ MACRO(TRIBITS_ADD_TEST_DIRECTORIES)
# This is a package being processed

IF(NOT ${PACKAGE_NAME}_TRIBITS_PACKAGE_DECL_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_PACKAGE() or TRIBITS_PACKAGE_DECL() before"
" TRIBITS_ADD_TEST_DIRECTORIES() in ${TRIBITS_PACKAGE_CMAKELIST_FILE}")
ENDIF()

IF(${PACKAGE_NAME}_TRIBITS_PACKAGE_POSTPROCESS_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_ADD_TEST_DIRECTORIES() before "
" TRIBITS_PACKAGE_POSTPROCESS() in ${TRIBITS_PACKAGE_CMAKELIST_FILE}")
ENDIF()
Expand Down Expand Up @@ -581,13 +581,13 @@ MACRO(TRIBITS_ADD_EXAMPLE_DIRECTORIES)

# This is a subpackage being processed
IF(NOT ${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_SUBPACKAGE() before TRIBITS_ADD_EXAMPLE_DIRECTORIES()"
" in ${CURRENT_SUBPACKAGE_CMAKELIST_FILE}")
ENDIF()

IF(${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_POSTPROCESS_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_ADD_EXAMPLE_DIRECTORIES() before "
" TRIBITS_SUBPACKAGE_POSTPROCESS() in ${CURRENT_SUBPACKAGE_CMAKELIST_FILE}")
ENDIF()
Expand All @@ -596,13 +596,13 @@ MACRO(TRIBITS_ADD_EXAMPLE_DIRECTORIES)

# This is a package being processed
IF(NOT ${PACKAGE_NAME}_TRIBITS_PACKAGE_DECL_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_PACKAGE() or TRIBITS_PACKAGE_DECL() before"
" TRIBITS_ADD_EXAMPLE_DIRECTORIES() in ${TRIBITS_PACKAGE_CMAKELIST_FILE}")
ENDIF()

IF(${PACKAGE_NAME}_TRIBITS_PACKAGE_POSTPROCESS_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_ADD_EXAMPLE_DIRECTORIES() before "
" TRIBITS_PACKAGE_POSTPROCESS() in ${TRIBITS_PACKAGE_CMAKELIST_FILE}")
ENDIF()
Expand Down Expand Up @@ -742,7 +742,7 @@ MACRO(TRIBITS_PACKAGE_POSTPROCESS)
# check that this is not being called from inside a subpackage
IF (CURRENTLY_PROCESSING_SUBPACKAGE)
IF(NOT ${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_POSTPROCESS_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Cannot call TRIBITS_PACKAGE_POSTPROCESS() in a subpackage."
" Use TRIBITS_SUBPACKAGE_POSTPROCESS() instead"
" ${CURRENT_SUBPACKAGE_CMAKELIST_FILE}")
Expand All @@ -756,7 +756,7 @@ MACRO(TRIBITS_PACKAGE_POSTPROCESS)
NOT ${PACKAGE_NAME}_TRIBITS_PACKAGE_DEF_CALLED OR
NOT ${PACKAGE_NAME}_TRIBITS_PROCESS_SUBPACKAGES_CALLED )

TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_PACKAGE_DECL(), TRIBITS_PROCESS_SUBPACKAGES()"
"and TRIBITS_PACKAGE_DEF before TRIBITS_PACKAGE_POSTPROCESS()."
" Because this package has subpackages you cannot use TRIBITS_PACKAGE()"
Expand All @@ -779,7 +779,7 @@ MACRO(TRIBITS_PACKAGE_POSTPROCESS)
AND
(NOT ${PACKAGE_NAME}_TRIBITS_PACKAGE_DEF_CALLED)
)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_PACKAGE() or TRIBITS_PACKAGE_DEF() before"
" TRIBITS_PACKAGE_POSTPROCESS()"
" at the top of the file:\n"
Expand All @@ -790,7 +790,7 @@ MACRO(TRIBITS_PACKAGE_POSTPROCESS)
ENDIF()

IF(NOT ${PACKAGE_NAME}_TRIBITS_PACKAGE_DEF_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_PACKAGE() before TRIBITS_PACKAGE_POSTPROCESS()"
"Or if your package has subpackages you must first call TRIBITS_PACKAGE_DECL, "
"then TRIBITS_PROCESS_SUBPACKAGES, then TRIBITS_PACKAGE_DEF, then"
Expand All @@ -800,7 +800,7 @@ MACRO(TRIBITS_PACKAGE_POSTPROCESS)
ENDIF()

IF(${PACKAGE_NAME}_TRIBITS_PACKAGE_POSTPROCESS_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"TRIBITS_PACKAGE_POSTPROCESS() has been called more than once in"
" ${TRIBITS_PACKAGE_CMAKELIST_FILE}")
ENDIF()
Expand Down Expand Up @@ -846,32 +846,32 @@ ENDMACRO()
MACRO(TRIBITS_PROCESS_SUBPACKAGES)

IF (CURRENTLY_PROCESSING_SUBPACKAGE)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Cannot call TRIBITS_PROCESS_SUBPACKAGES() in a subpackage."
" subpackages cannot contain other subpackages"
" ${CURRENT_SUBPACKAGE_CMAKELIST_FILE}")
ENDIF()

IF (${PACKAGE_NAME}_TRIBITS_PACKAGE_POSTPROCESS_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_PROCESS_SUBPACKAGES() before TRIBITS_PACKAGE_POSTPROCESS()"
" in ${TRIBITS_PACKAGE_CMAKELIST_FILE}")
ENDIF()

IF (NOT ${PACKAGE_NAME}_TRIBITS_PACKAGE_DECL_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_PACKAGE_DECL() before TRIBITS_PROCESS_SUBPACKAGES()"
"in ${TRIBITS_PACKAGE_CMAKELIST_FILE}")
ENDIF()

IF (${PACKAGE_NAME}_TRIBITS_PACKAGE_DEF_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Must call TRIBITS_PACKAGE_DEF() after TRIBITS_PROCESS_SUBPACKAGES()"
" in ${TRIBITS_PACKAGE_CMAKELIST_FILE}")
ENDIF()

IF (NOT ${PARENT_PACKAGE_NAME}_SUBPACKAGES)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"The TriBITS Package '${PACKAGE_NAME}' does not have any subpackages."
" Therefore, you are not allowed to call TRIBITS_PROCESS_SUBPACKAGES()!")
ENDIF()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@
# ************************************************************************
# @HEADER

IF (__TribitsAssertCorrectTribitsUsage_INCLUDED__)
IF (__TribitsReportInvalidTribitsUsage_INCLUDED__)
RETURN()
ELSE()
SET(__TribitsAssertCorrectTribitsUsage_INCLUDED__ TRUE)
SET(__TribitsReportInvalidTribitsUsage_INCLUDED__ TRUE)
ENDIF()

# Called to report incorrect usage
#
# Usage:
#
# TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE("<err_msg0>" "<err_msg1>" ...)
# TRIBITS_REPORT_INVALID_TRIBITS_USAGE("<err_msg0>" "<err_msg1>" ...)
#
# Depending on the value of ${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE, this
# function will:
Expand All @@ -60,7 +60,7 @@ ENDIF()
# If '${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE}' is empty on call, then
# `FATAL_ERROR` will be used.
#
FUNCTION(TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE)
FUNCTION(TRIBITS_REPORT_INVALID_TRIBITS_USAGE)
IF ("${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE}" STREQUAL "")
SET(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE FATAL_ERROR)
ENDIF()
Expand Down
16 changes: 8 additions & 8 deletions tribits/core/package_arch/TribitsSubPackageMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# @HEADER

INCLUDE(TribitsPackageMacros)
INCLUDE(TribitsAssertCorrectTribitsUsage)
INCLUDE(TribitsReportInvalidTribitsUsage)


#
Expand Down Expand Up @@ -82,7 +82,7 @@ MACRO(TRIBITS_SUBPACKAGE SUBPACKAGE_NAME_IN)
IF (NOT CURRENTLY_PROCESSING_SUBPACKAGE)
# we are in a package

TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Cannot call TRIBITS_SUBPACKAGE() from a package."
" Use TRIBITS_PACKAGE() instead"
" ${CURRENT_PACKAGE_CMAKELIST_FILE}")
Expand All @@ -92,20 +92,20 @@ MACRO(TRIBITS_SUBPACKAGE SUBPACKAGE_NAME_IN)

# check to see if postprocess is called before subpackage
IF(${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_POSTPROCESS_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"TRIBITS_SUBPACKAGE_POSTPROCESS() called before TRIBITS_SUBPACKAGE()")
ENDIF()

# check to see if we have already called this macro
IF(${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Already called TRIBITS_SUBPACKGE() for the"
" ${PARENT_PACKAGE_NAME} subpackage ${TRIBITS_SUBPACKAGE}")
ENDIF()

# make sure the name in the macro call matches the name in the packages cmake file
IF (NOT ${SUBPACKAGE_NAME_IN} STREQUAL ${SUBPACKAGE_NAME})
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Error, the package-defined subpackage name"
" '${SUBPACKAGE_NAME_IN}' is not the same as the subpackage name"
" '${SUBPACKAGE_NAME}' defined in the parent packages's"
Expand Down Expand Up @@ -152,7 +152,7 @@ MACRO(TRIBITS_SUBPACKAGE_POSTPROCESS)

# This is being called from a package

TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Cannot call TRIBITS_SUBPACKAGE_POSTPROCESS() from a package."
" Use TRIBITS_PACKAGE_POSTPROCESS() instead"
" ${CURRENT_PACKAGE_CMAKELIST_FILE}")
Expand All @@ -162,14 +162,14 @@ MACRO(TRIBITS_SUBPACKAGE_POSTPROCESS)

# check to make sure this has not already been called
IF (${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_POSTPROCESS_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"Already called TRIBITS_SUBPACKGE_POSTPROCESS() for the"
" ${PARENT_PACKAGE_NAME} subpackage ${TRIBITS_SUBPACKAGE}")
ENDIF()

# make sure subpackage is called prior to subpackage postprocess
IF(NOT ${SUBPACKAGE_FULLNAME}_TRIBITS_SUBPACKAGE_CALLED)
TRIBITS_ASSERT_CORRECT_TRIBITS_USAGE(
TRIBITS_REPORT_INVALID_TRIBITS_USAGE(
"TRIBITS_SUBPACKAGE() must be called before TRIBITS_SUBPACKAGE_POSTPROCESS()"
" for the ${PARENT_PACKAGE_NAME} subpackage ${TRIBITS_SUBPACKAGE}")
ENDIF()
Expand Down

0 comments on commit 770480c

Please sign in to comment.