File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,8 +97,10 @@ macro(
9797 "${${_pkg_uc} _BINARY_DIR}"
9898 )
9999
100- add_library ("${package} ::${package} " INTERFACE IMPORTED )
101- target_link_libraries ("${package} ::${package} " INTERFACE "${package} " )
100+ if (NOT TARGET "${package} ::${package} " )
101+ add_library ("${package} ::${package} " INTERFACE IMPORTED )
102+ target_link_libraries ("${package} ::${package} " INTERFACE "${package} " )
103+ endif ()
102104
103105 # We need the module directory in the subproject before we finish the configure stage
104106 if (NOT EXISTS "${${_pkg_uc} _BINARY_DIR}/include" )
@@ -122,8 +124,10 @@ macro(
122124 )
123125 FetchContent_MakeAvailable ("${_pkg_lc} " )
124126
125- add_library ("${package} ::${package} " INTERFACE IMPORTED )
126- target_link_libraries ("${package} ::${package} " INTERFACE "${package} " )
127+ if (NOT TARGET "${package} ::${package} " )
128+ add_library ("${package} ::${package} " INTERFACE IMPORTED )
129+ target_link_libraries ("${package} ::${package} " INTERFACE "${package} " )
130+ endif ()
127131
128132 # We need the module directory in the subproject before we finish the configure stage
129133 FetchContent_GetProperties ("${_pkg_lc} " SOURCE_DIR "${_pkg_uc} _SOURCE_DIR" )
You can’t perform that action at this time.
0 commit comments