Skip to content

Commit

Permalink
Merge pull request ESMCI#1311 from NESII/skip-pkgcomp-overload
Browse files Browse the repository at this point in the history
Do not overload user-defined PKGCOMPs
  • Loading branch information
jedwards4b authored Aug 6, 2018
2 parents 4091da5 + 29196d0 commit 96e562f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cmake/LibFind.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,15 @@ function (find_package_component PKG)
if (${PKG}_PATHS)
list (APPEND SEARCH_DIRS ${${PKG}_PATHS})
endif ()

# Start the search for the include file and library file
set (${PKGCOMP}_PREFIX ${PKGCOMP}_PREFIX-NOTFOUND)
set (${PKGCOMP}_INCLUDE_DIR ${PKGCOMP}_INCLUDE_DIR-NOTFOUND)
set (${PKGCOMP}_LIBRARY ${PKGCOMP}_LIBRARY-NOTFOUND)

# Start the search for the include file and library file. Only overload
# if the variable is not defined.
foreach (suffix PREFIX LIBRARY INCLUDE_DIR)
if (NOT DEFINED ${PKGCOMP}_${suffix})
set (${PKGCOMP}_${suffix} ${PKGCOMP}_${suffix}-NOTFOUND)
endif ()
endforeach ()

foreach (dir IN LISTS SEARCH_DIRS)

# Search for include file names in current dirrectory
Expand Down

0 comments on commit 96e562f

Please sign in to comment.