Skip to content

Commit

Permalink
Remove duplicates in project library list and TPL include list (#282)
Browse files Browse the repository at this point in the history
There is now a strong test that asserts that duplicates are getting removed.
  • Loading branch information
bartlettroscoe committed Mar 29, 2019
1 parent 6340599 commit 9f49538
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions tribits/core/installation/TribitsProjectConfigTemplate.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,6 @@ SET(${PROJECT_NAME}_AR ${CMAKE_AR})
## The project version number
SET(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION}")

## The project include file directories.
#SET(${PROJECT_NAME}_INCLUDE_DIRS "${${PROJECT_NAME}_CONFIG_INCLUDE_DIRS}")

## The project library directories.
#SET(${PROJECT_NAME}_LIBRARY_DIRS "${${PROJECT_NAME}_CONFIG_LIBRARY_DIRS}")

## The project libraries.
#SET(${PROJECT_NAME}_LIBRARIES "${${PROJECT_NAME}_CONFIG_LIBRARIES}")

## The project tpl include paths
#SET(${PROJECT_NAME}_TPL_INCLUDE_DIRS "${${PROJECT_NAME}_CONFIG_TPL_INCLUDE_DIRS}")

## The project tpl library paths
#SET(${PROJECT_NAME}_TPL_LIBRARY_DIRS "${${PROJECT_NAME}_CONFIG_TPL_LIBRARY_DIRS}")

## The project tpl libraries
#SET(${PROJECT_NAME}_TPL_LIBRARIES "${${PROJECT_NAME}_CONFIG_TPL_LIBRARIES}")

# For best practices in handling of components, see
# <http://www.cmake.org/cmake/help/v3.2/manual/cmake-developer.7.html#find-modules>.
#
Expand Down Expand Up @@ -172,6 +154,18 @@ ENDFOREACH()
LIST(REMOVE_DUPLICATES short_dirs)
SET(${PROJECT_NAME}_LIBRARY_DIRS ${PDOLLAR}{short_dirs})

# Remove duplicates in ${PROJECT_NAME}_LIBRARIES
LIST(REVERSE ${PROJECT_NAME}_LIBRARIES)
LIST(REMOVE_DUPLICATES ${PROJECT_NAME}_LIBRARIES)
LIST(REVERSE ${PROJECT_NAME}_LIBRARIES)

# Remove duplicates in ${PROJECT_NAME}_TPL_INCLUDE_DIRS
LIST(REMOVE_DUPLICATES ${PROJECT_NAME}_TPL_INCLUDE_DIRS)

# NOTE: It is *NOT* safe to try to remove duplicate in
# ${PROJECT_NAME}_TPL_LIBRARIES because these can be specified as -L, -l, etc.
# Actaully, we should think about that.

## ---------------------------------------------------------------------------
## MPI specific variables
## These variables are provided to make it easier to get the mpi libraries
Expand Down

0 comments on commit 9f49538

Please sign in to comment.