Skip to content

Commit

Permalink
Merge pull request #8 from faodel/topic/fix-ugni-target-redefinition
Browse files Browse the repository at this point in the history
BUILD: When creating Cray DRC targets, check if the target already exists
  • Loading branch information
tkordenbrock committed Sep 30, 2020
2 parents f0267fc + b67e856 commit 7f1c96f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cmake/FaodelTPLs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,13 @@ elseif( Faodel_NETWORK_LIBRARY STREQUAL "nnti" )
foreach(drclib ${DRC_PC_LIBRARIES})
find_library(${drclib}_LIBRARY NAMES ${drclib} HINTS ${DRC_PC_LIBRARY_DIRS})
if (${drclib}_LIBRARY)
add_library( ${drclib} IMPORTED UNKNOWN )
set_property( TARGET ${drclib} PROPERTY IMPORTED_LOCATION ${${drclib}_LIBRARY} )
set_property( TARGET ${drclib} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${DRC_PC_INCLUDE_DIRS}" )
LIST( APPEND DRC_TARGETS ${drclib} )
LIST( APPEND DRC_LIBRARIES ${${drclib}_LIBRARY})
if( NOT TARGET ${drclib} )
add_library( ${drclib} IMPORTED UNKNOWN )
set_property( TARGET ${drclib} PROPERTY IMPORTED_LOCATION ${${drclib}_LIBRARY} )
set_property( TARGET ${drclib} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${DRC_PC_INCLUDE_DIRS}" )
LIST( APPEND DRC_TARGETS ${drclib} )
LIST( APPEND DRC_LIBRARIES ${${drclib}_LIBRARY})
endif ( NOT TARGET ${drclib} )
endif (${drclib}_LIBRARY)
endforeach(drclib)
LIST(APPEND DRC_INCLUDE_DIRS ${DRC_PC_INCLUDE_DIRS})
Expand Down

0 comments on commit 7f1c96f

Please sign in to comment.