Skip to content

Commit

Permalink
Change TRIBITS_FILTER_OR_ASSERT_EXTRA_REPOS() from macro to function …
Browse files Browse the repository at this point in the history
…(SQUASH ME) (TriBITS TriBITSPub#73)

Macros have numerious namespace problems.  You should be explicit about what
varibles you are modifying in the caller's environment.
  • Loading branch information
Roscoe A. Bartlett committed Jun 2, 2015
1 parent 59953b3 commit 0ae7636
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions tribits/core/package_arch/TribitsProcessExtraRepositoriesList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -473,14 +473,16 @@ ENDFUNCTION()
#
# Filter out or assert msising repos read from an extra repos.
#
# This macro keys off of the variables:
# This function keys off of the variables:
#
# ${PROJECT_NAME}_PRE_REPOSITORIES
# ${PROJECT_NAME}_EXTRA_REPOSITORIES
# ${PROJECT_NAME}_IGNORE_MISSING_EXTRA_REPOSITORIES
#
# and the variables:
#
# ${PROJECT_NAME}_PRE_REPOSITORIES_DEFAULT
# ${PROJECT_NAME}_EXTRA_REPOSITORIES_DEFAULT
# ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DEFAULT
# ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS
# ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_VCTYPES
Expand All @@ -504,11 +506,22 @@ ENDFUNCTION()
# repos must exist or MESSSAGE(FATAL_ERROR ...) is called and will fail the
# configure.
#
# On output ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES will be set according to the
# logic described above and the other extra repo variables will be filtered in
# a consistent way.
# On output the variables:
#
MACRO(TRIBITS_FILTER_OR_ASSERT_EXTRA_REPOS)
# ${PROJECT_NAME}_PRE_REPOSITORIES
# ${PROJECT_NAME}_EXTRA_REPOSITORIES
# ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES
# ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS
# ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_VCTYPES
# ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_REPOURLS
# ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_HASPKGS
# ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_PREPOSTS
# ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_CATEGORIES
#
# will be set according to the logic described above and the other extra repo
# variables will be filtered in a consistent way.
#
FUNCTION(TRIBITS_FILTER_OR_ASSERT_EXTRA_REPOS)

#PRINT_VAR(${PROJECT_NAME}_PRE_REPOSITORIES)
#PRINT_VAR(${PROJECT_NAME}_EXTRA_REPOSITORIES)
Expand Down Expand Up @@ -660,27 +673,27 @@ MACRO(TRIBITS_FILTER_OR_ASSERT_EXTRA_REPOS)

# B) Copy over extra repos arrays with filtered arrays
SET(${PROJECT_NAME}_PRE_REPOSITORIES
${PRE_REPOSITORIES_TMP})
${PRE_REPOSITORIES_TMP} PARENT_SCOPE)
SET(${PROJECT_NAME}_EXTRA_REPOSITORIES
${EXTRA_REPOSITORIES_TMP})
${EXTRA_REPOSITORIES_TMP} PARENT_SCOPE)
SET(${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES
${ALL_EXTRA_REPOSITORIES_TMP})
${ALL_EXTRA_REPOSITORIES_TMP} PARENT_SCOPE)
SET(${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS
${ALL_EXTRA_REPOSITORIES_DIRS_TMP})
${ALL_EXTRA_REPOSITORIES_DIRS_TMP} PARENT_SCOPE)
SET(${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_VCTYPES
${ALL_EXTRA_REPOSITORIES_VCTYPES_TMP})
${ALL_EXTRA_REPOSITORIES_VCTYPES_TMP} PARENT_SCOPE)
SET(${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_REPOURLS
${ALL_EXTRA_REPOSITORIES_REPOURLS_TMP})
${ALL_EXTRA_REPOSITORIES_REPOURLS_TMP} PARENT_SCOPE)
SET(${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_HASPKGS
${ALL_EXTRA_REPOSITORIES_HASPKGS_TMP})
${ALL_EXTRA_REPOSITORIES_HASPKGS_TMP} PARENT_SCOPE)
SET(${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_PREPOSTS
${ALL_EXTRA_REPOSITORIES_PREPOSTS_TMP})
${ALL_EXTRA_REPOSITORIES_PREPOSTS_TMP} PARENT_SCOPE)
SET(${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_CATEGORIES
${ALL_EXTRA_REPOSITORIES_CATEGORIES_TMP})
${ALL_EXTRA_REPOSITORIES_CATEGORIES_TMP} PARENT_SCOPE)

TRIBITS_DUMP_EXTRA_REPOSITORIES_LIST()

ENDMACRO()
ENDFUNCTION()


#
Expand Down

0 comments on commit 0ae7636

Please sign in to comment.