Avoid trying to re-create targets in cmake config (#2471)
When `find_package(Rizin ...)` would be called multiple times, the second add_library call would error because the target already exists.
This commit is contained in:
parent
907f296f57
commit
be48ddcd9f
1 changed files with 6 additions and 1 deletions
|
|
@ -88,6 +88,11 @@ foreach(_comp ${Rizin_FIND_COMPONENTS})
|
|||
set(Rizin_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
|
||||
return()
|
||||
endif()
|
||||
if (rz_${_comp_lower}_FOUND)
|
||||
# Already got this component, trying to re-add the
|
||||
# target below would be an error
|
||||
continue()
|
||||
endif()
|
||||
find_package(rz_${_comp_lower} PATHS ${_rizin_cmake_path})
|
||||
if (NOT rz_${_comp_lower}_FOUND)
|
||||
set(Rizin_FOUND False)
|
||||
|
|
@ -103,4 +108,4 @@ foreach(_comp ${Rizin_FIND_COMPONENTS})
|
|||
INTERFACE_INCLUDE_DIRECTORIES "${rz_${_comp_lower}_INCLUDE_DIRS}")
|
||||
endforeach()
|
||||
|
||||
set(Rizin_PLUGINDIR @INSTALL_PLUGDIR@)
|
||||
set(Rizin_PLUGINDIR @INSTALL_PLUGDIR@)
|
||||
|
|
|
|||
Loading…
Reference in a new issue