Skip to content

Commit

Permalink
Add pre-extra repo support to TRIBITS_FILTER_OR_ASSERT_EXTRA_REPOS() …
Browse files Browse the repository at this point in the history
…(SQUASH ME) (TriBITS TriBITSPub#73)
  • Loading branch information
Roscoe A. Bartlett committed Jun 2, 2015
1 parent 991bca0 commit 59953b3
Show file tree
Hide file tree
Showing 3 changed files with 221 additions and 62 deletions.
2 changes: 1 addition & 1 deletion test/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ TRIBITS_ADD_ADVANCED_TEST( TribitsProcessExtraRepositoriesList_UnitTests
-D${PROJECT_NAME}_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR}
-P "${CMAKE_CURRENT_SOURCE_DIR}/TribitsProcessExtraRepositoriesList_UnitTests.cmake"
PASS_REGULAR_EXPRESSION_ALL
"Final UnitTests Result: num_run = 88"
"Final UnitTests Result: num_run = 142"
"Final UnitTests Result: PASSED"
)

Expand Down
218 changes: 189 additions & 29 deletions test/core/TribitsProcessExtraRepositoriesList_UnitTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ FUNCTION(UNITTEST_TRIBITS_PROCESS_EXTRAREPOS_LISTS)

# ToDo: Test error when invalid VC type is given

# ToDo: Test that all PRE repos come before all POST repos

ENDFUNCTION()


Expand Down Expand Up @@ -312,76 +314,234 @@ ENDFUNCTION()

FUNCTION(UNITTEST_TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS)

SET(${PROJECT_NAME}_EXTRAREPOS_FILE "${CMAKE_CURRENT_LIST_DIR}/emptyFile.cmake")

TRIBITS_PROJECT_DEFINE_EXTRA_REPOSITORIES(
repo0_name "" GIT "[email protected]:repo0" PRE Continuous
repo1_name "" SVN "[email protected]:repo1" PRE,HASPACKAGES Continuous
repo2_name "some/sub/dir" SVN "[email protected]:repo2" NOPACKAGES Nightly
repo3_name "" GIT "[email protected]:repo3" POST Nightly
)

MESSAGE("\n***")
MESSAGE("*** Test TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS with empty ${PROJECT_NAME}_EXTRA_REPOSITORIES")
MESSAGE("*** Test TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS() empty PRE_REPOSITORIES and EXTRA_REPOSITORIES ")
MESSAGE("***\n")

#SET(TRIBITS_PROCESS_EXTRAREPOS_LISTS_DEBUG TRUE)

SET(${PROJECT_NAME}_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE Nightly)
SET(${PROJECT_NAME}_EXTRAREPOS_FILE "${CMAKE_CURRENT_LIST_DIR}/emptyFile.cmake")

TRIBITS_PROJECT_DEFINE_EXTRA_REPOSITORIES(
repo0_name "" GIT "[email protected]:repo0" "" Continuous
repo1_name "some/sub/dir" SVN "[email protected]:repo1" NOPACKAGES Nightly
)
SET(${PROJECT_NAME}_PRE_REPOSITORIES "")
SET(${PROJECT_NAME}_EXTRA_REPOSITORIES "")

TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS()

UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_PRE_REPOSITORIES_DEFAULT
"repo0_name;repo1_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_EXTRA_REPOSITORIES_DEFAULT
"repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DEFAULT
"repo0_name;repo1_name;repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_PRE_REPOSITORIES
"repo0_name;repo1_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_EXTRA_REPOSITORIES
"repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES
"repo0_name;repo1_name;repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS
"repo0_name;some/sub/dir")
"repo0_name;repo1_name;some/sub/dir;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_VCTYPES
"GIT;SVN")
"GIT;SVN;SVN;GIT")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_REPOURLS
"[email protected]:repo0;[email protected]:repo1")
"[email protected]:repo0;[email protected]:repo1;[email protected]:repo2;[email protected]:repo3")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_HASPKGS
"HASPACKAGES;NOPACKAGES")
"HASPACKAGES;HASPACKAGES;NOPACKAGES;HASPACKAGES")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_PREPOSTS
"POST;POST")
"PRE;PRE;POST;POST")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_CATEGORIES
"Continuous;Nightly")
"Continuous;Continuous;Nightly;Nightly")

MESSAGE("\n***")
MESSAGE("*** Test TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS(), EXTRA_REPOSITORIES=repo2_name")
MESSAGE("***\n")

#SET(TRIBITS_PROCESS_EXTRAREPOS_LISTS_DEBUG TRUE)

SET(${PROJECT_NAME}_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE Nightly)
SET(${PROJECT_NAME}_PRE_REPOSITORIES "")
SET(${PROJECT_NAME}_EXTRA_REPOSITORIES repo2_name)

TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS()

UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_PRE_REPOSITORIES_DEFAULT
"")
"repo0_name;repo1_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_EXTRA_REPOSITORIES_DEFAULT
"repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DEFAULT
"repo0_name;repo1_name;repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_PRE_REPOSITORIES
"repo0_name;repo1_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_EXTRA_REPOSITORIES
"repo2_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES
"repo0_name;repo1_name;repo2_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS
"repo0_name;repo1_name;some/sub/dir")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_VCTYPES
"GIT;SVN;SVN")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_REPOURLS
"[email protected]:repo0;[email protected]:repo1;[email protected]:repo2")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_HASPKGS
"HASPACKAGES;HASPACKAGES;NOPACKAGES")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_PREPOSTS
"PRE;PRE;POST")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_CATEGORIES
"Continuous;Continuous;Nightly")

MESSAGE("\n***")
MESSAGE("*** Test TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS with non-empty ${PROJECT_NAME}_EXTRA_REPOSITORIES")
MESSAGE("*** Test TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS(), EXTRA_REPOSITORIES=repo3_name")
MESSAGE("***\n")

#SET(TRIBITS_PROCESS_EXTRAREPOS_LISTS_DEBUG TRUE)

SET(${PROJECT_NAME}_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE Nightly)
SET(${PROJECT_NAME}_EXTRAREPOS_FILE "${CMAKE_CURRENT_LIST_DIR}/emptyFile.cmake")
SET(${PROJECT_NAME}_EXTRA_REPOSITORIES repo0_name)

TRIBITS_PROJECT_DEFINE_EXTRA_REPOSITORIES(
repo0_name "" GIT "[email protected]:repo0" "" Continuous
repo1_name "some/sub/dir" SVN "[email protected]:repo1" NOPACKAGES Nightly
)
SET(${PROJECT_NAME}_PRE_REPOSITORIES "")
SET(${PROJECT_NAME}_EXTRA_REPOSITORIES repo3_name)

TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS()

UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_PRE_REPOSITORIES_DEFAULT
"")
"repo0_name;repo1_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_EXTRA_REPOSITORIES_DEFAULT
"repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DEFAULT
"repo0_name;repo1_name;repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_PRE_REPOSITORIES
"repo0_name;repo1_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_EXTRA_REPOSITORIES
"repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES
"repo0_name;repo1_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS
"repo0_name;repo1_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_VCTYPES
"GIT;SVN;GIT")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_REPOURLS
"[email protected]:repo0;[email protected]:repo1;[email protected]:repo3")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_HASPKGS
"HASPACKAGES;HASPACKAGES;HASPACKAGES")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_PREPOSTS
"PRE;PRE;POST")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_CATEGORIES
"Continuous;Continuous;Nightly")

MESSAGE("\n***")
MESSAGE("*** Test TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS(), PRE_REPOSITORIES=repo0_name")
MESSAGE("***\n")

#SET(TRIBITS_PROCESS_EXTRAREPOS_LISTS_DEBUG TRUE)

SET(${PROJECT_NAME}_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE Nightly)
SET(${PROJECT_NAME}_PRE_REPOSITORIES repo0_name)
SET(${PROJECT_NAME}_EXTRA_REPOSITORIES "")

TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS()

UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_PRE_REPOSITORIES_DEFAULT
"repo0_name;repo1_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_EXTRA_REPOSITORIES_DEFAULT
"repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DEFAULT
"repo0_name;repo1_name;repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_PRE_REPOSITORIES
"repo0_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_EXTRA_REPOSITORIES
"repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES
"repo0_name;repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS
"repo0_name;some/sub/dir;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_VCTYPES
"GIT;SVN;GIT")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_REPOURLS
"[email protected]:repo0;[email protected]:repo2;[email protected]:repo3")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_HASPKGS
"HASPACKAGES;NOPACKAGES;HASPACKAGES")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_PREPOSTS
"PRE;POST;POST")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_CATEGORIES
"Continuous;Nightly;Nightly")

MESSAGE("\n***")
MESSAGE("*** Test TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS(), PRE_REPOSITORIES=repo1_name")
MESSAGE("***\n")

#SET(TRIBITS_PROCESS_EXTRAREPOS_LISTS_DEBUG TRUE)

SET(${PROJECT_NAME}_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE Nightly)
SET(${PROJECT_NAME}_PRE_REPOSITORIES repo1_name)
SET(${PROJECT_NAME}_EXTRA_REPOSITORIES "")

TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS()

UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_PRE_REPOSITORIES_DEFAULT
"repo0_name;repo1_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_EXTRA_REPOSITORIES_DEFAULT
"repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DEFAULT
"repo0_name;repo1_name;repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_PRE_REPOSITORIES
"repo1_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_EXTRA_REPOSITORIES
"repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES
"repo1_name;repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS
"repo1_name;some/sub/dir;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_VCTYPES
"SVN;SVN;GIT")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_REPOURLS
"[email protected]:repo1;[email protected]:repo2;[email protected]:repo3")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_HASPKGS
"HASPACKAGES;NOPACKAGES;HASPACKAGES")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_PREPOSTS
"PRE;POST;POST")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_CATEGORIES
"Continuous;Nightly;Nightly")

MESSAGE("\n***")
MESSAGE("*** Test TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS(), PRE_REPOSITORIES=repo0_name, EXTRA_REPOSITORIES=repo3_name")
MESSAGE("***\n")

SET(${PROJECT_NAME}_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE Nightly)
SET(${PROJECT_NAME}_PRE_REPOSITORIES repo0_name)
SET(${PROJECT_NAME}_EXTRA_REPOSITORIES repo3_name)

TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS()

UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_PRE_REPOSITORIES_DEFAULT
"repo0_name;repo1_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_EXTRA_REPOSITORIES_DEFAULT
"repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DEFAULT
"repo0_name;repo1_name;repo2_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_PRE_REPOSITORIES
"repo0_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_EXTRA_REPOSITORIES
"repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES
"repo0_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS
"repo0_name;repo3_name")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_VCTYPES
"GIT")
"GIT;GIT")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_REPOURLS
"[email protected]:repo0")
"[email protected]:repo0;[email protected]:repo3")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_HASPKGS
"HASPACKAGES")
"HASPACKAGES;HASPACKAGES")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_PREPOSTS
"POST")
"PRE;POST")
UNITTEST_COMPARE_CONST( ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_CATEGORIES
"Continuous")
"Continuous;Nightly")

ENDFUNCTION()

Expand Down Expand Up @@ -409,4 +569,4 @@ UNITTEST_TRIBITS_PROCESS_EXTRAREPOS_LISTS_OLD_REPOTYPE()
UNITTEST_TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS()

# Pass in the number of expected tests that must pass!
UNITTEST_FINAL_RESULT(88)
UNITTEST_FINAL_RESULT(142)
63 changes: 31 additions & 32 deletions tribits/core/package_arch/TribitsProcessExtraRepositoriesList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -375,30 +375,6 @@ MACRO(TRIBITS_PROCESS_EXTRAREPOS_LISTS)
TRIBITS_PARSE_EXTRAREPO_PACKSTAT("${EXTRAREPO_PACKSTAT}"
EXTRAREPO_HASPKGS EXTRAREPO_PREPOST )

# ToDo: TriBITS:73: Remove below commented out code!
# SET(EXTRAREPO_HASPKGS ${EXTRAREPO_PACKSTAT})
# # ToDo: TriBITS:73: Parse HASPKGS and PREPOST out of PACKSTAT!
# IF (TRIBITS_PROCESS_EXTRAREPOS_LISTS_DEBUG)
# PRINT_VAR(EXTRAREPO_HASPKGS)
# ENDIF()
#
# # HASPKGS
# IF ("${EXTRAREPO_HASPKGS}" STREQUAL "")
# SET(EXTRAREPO_HASPKGS HASPACKAGES)
# ELSEIF ("${EXTRAREPO_HASPKGS}" STREQUAL NOPACKAGES)
# # Okay
# ELSE()
# MESSAGE(FATAL_ERROR "Error, the PACKSTAT of '${EXTRAREPO_HASPKGS}' for"
# " extra repo ${EXTRAREPO_NAME} is *not* valid. Valid choices are '' and 'NOPACKAGES'!")
# ENDIF()
# IF (TRIBITS_PROCESS_EXTRAREPOS_LISTS_DEBUG)
# PRINT_VAR(EXTRAREPO_HASPKGS)
# ENDIF()
#
# # PREPOST
# SET(EXTRAREPO_PREPOST POST)
# # ToDo: TriBITS:73: Get EXTRAREPO_PREPOST out of 'PACKSTAT' field

# CLASSIFICATION
MATH(EXPR EXTRAREPO_CLASSIFICATION_IDX
"${EXTRAREPO_IDX}*${ERP_NUM_FIELDS_PER_REPO}+${ERP_REPO_CLASSIFICATION_OFFSET}")
Expand Down Expand Up @@ -534,17 +510,31 @@ ENDFUNCTION()
#
MACRO(TRIBITS_FILTER_OR_ASSERT_EXTRA_REPOS)

# ToDo: Also filter only those repos that are listed in
# ${${PROJECT_NAME}_EXTRA_REPOSITORIES (which have already been asserted)

#PRINT_VAR(${PROJECT_NAME}_PRE_REPOSITORIES)
#PRINT_VAR(${PROJECT_NAME}_EXTRA_REPOSITORIES)

# Get the list of repos to filter

IF ("${${PROJECT_NAME}_PRE_REPOSITORIES}" STREQUAL "")
SET(${PROJECT_NAME}_PRE_REPOSITORIES_IN ${${PROJECT_NAME}_PRE_REPOSITORIES_DEFAULT})
ELSE()
SET(${PROJECT_NAME}_PRE_REPOSITORIES_IN ${${PROJECT_NAME}_PRE_REPOSITORIES})
ENDIF()

IF ("${${PROJECT_NAME}_EXTRA_REPOSITORIES}" STREQUAL "")
SET(${PROJECT_NAME}_EXTRA_REPOSITORIES_IN ${${PROJECT_NAME}_EXTRA_REPOSITORIES_DEFAULT})
ELSE()
SET(${PROJECT_NAME}_EXTRA_REPOSITORIES_IN ${${PROJECT_NAME}_EXTRA_REPOSITORIES})
ENDIF()

SET(ALL_EXTRA_REPOSITORIES_IN
${${PROJECT_NAME}_PRE_REPOSITORIES} ${${PROJECT_NAME}_EXTRA_REPOSITORIES})
${${PROJECT_NAME}_PRE_REPOSITORIES_IN} ${${PROJECT_NAME}_EXTRA_REPOSITORIES_IN})
#PRINT_VAR(ALL_EXTRA_REPOSITORIES_IN)

# A) Loop through and copy info for existing repos to temp arrays

SET(PRE_REPOSITORIES_TMP)
SET(EXTRA_REPOSITORIES_TMP)
SET(ALL_EXTRA_REPOSITORIES_TMP)
SET(ALL_EXTRA_REPOSITORIES_DIRS_TMP)
SET(ALL_EXTRA_REPOSITORIES_VCTYPES_TMP)
Expand All @@ -553,6 +543,10 @@ MACRO(TRIBITS_FILTER_OR_ASSERT_EXTRA_REPOS)
SET(ALL_EXTRA_REPOSITORIES_PREPOSTS_TMP)
SET(ALL_EXTRA_REPOSITORIES_CATEGORIES_TMP)

# ToDo: TriBITS:73: Remove logic that allows ALL_EXTRA_REPOSITORIES_IN to be
# empty but ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DEFAULT not empty. You
# don't need it anymore.

# Set-up for filtering based on ALL_EXTRA_REPOSITORIES_IN != ""
LIST(LENGTH ALL_EXTRA_REPOSITORIES_IN ALL_EXTRA_REPOSITORIES_IN_LEN)
#PRINT_VAR(ALL_EXTRA_REPOSITORIES_IN_LEN)
Expand Down Expand Up @@ -646,6 +640,11 @@ MACRO(TRIBITS_FILTER_OR_ASSERT_EXTRA_REPOS)
# A.3) Conditionally copy the info for the extra repo
IF (ADD_EXTRAREPO)
MESSAGE("-- " "Adding extra ${EXTRAREPO_CATEGORY} repository ${EXTRAREPO_NAME} ...")
IF (EXTRAREPO_PREPOST STREQUAL "PRE")
LIST(APPEND PRE_REPOSITORIES_TMP ${EXTRAREPO_NAME})
ELSEIF (EXTRAREPO_PREPOST STREQUAL "POST")
LIST(APPEND EXTRA_REPOSITORIES_TMP ${EXTRAREPO_NAME})
ENDIF()
LIST(APPEND ALL_EXTRA_REPOSITORIES_TMP ${EXTRAREPO_NAME})
LIST(APPEND ALL_EXTRA_REPOSITORIES_DIRS_TMP ${EXTRAREPO_DIR})
LIST(APPEND ALL_EXTRA_REPOSITORIES_VCTYPES_TMP ${EXTRAREPO_VCTYPE})
Expand All @@ -660,6 +659,10 @@ MACRO(TRIBITS_FILTER_OR_ASSERT_EXTRA_REPOS)
ENDFOREACH()

# B) Copy over extra repos arrays with filtered arrays
SET(${PROJECT_NAME}_PRE_REPOSITORIES
${PRE_REPOSITORIES_TMP})
SET(${PROJECT_NAME}_EXTRA_REPOSITORIES
${EXTRA_REPOSITORIES_TMP})
SET(${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES
${ALL_EXTRA_REPOSITORIES_TMP})
SET(${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS
Expand All @@ -674,10 +677,6 @@ MACRO(TRIBITS_FILTER_OR_ASSERT_EXTRA_REPOS)
${ALL_EXTRA_REPOSITORIES_PREPOSTS_TMP})
SET(${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_CATEGORIES
${ALL_EXTRA_REPOSITORIES_CATEGORIES_TMP})
# ToDo: TriBITS:73: Set ${PROJECT_NAME}_PRE_REPOSITORIES along with
# ${PROJECT_NAME}_EXTRA_REPOSITORIES above properly, not with the hack below
SET(${PROJECT_NAME}_EXTRA_REPOSITORIES
${${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES})

TRIBITS_DUMP_EXTRA_REPOSITORIES_LIST()

Expand Down

0 comments on commit 59953b3

Please sign in to comment.