cmake: Fix possible redefinition of imported target in FindOpenSLES

This commit is contained in:
Florent Castelli 2017-02-06 04:18:59 +01:00
parent e211cdd11d
commit 3dfae32963

View File

@ -18,11 +18,13 @@ find_package_handle_standard_args(OpenSLES DEFAULT_MSG
OPENSLES_LIBRARY OPENSLES_INCLUDE_DIR) OPENSLES_LIBRARY OPENSLES_INCLUDE_DIR)
if(OpenSLES_FOUND) if(OpenSLES_FOUND)
add_library(OpenSLES::OpenSLES UNKNOWN IMPORTED) if(NOT TARGET OpenSLES::OpenSLES)
set_target_properties(OpenSLES::OpenSLES PROPERTIES add_library(OpenSLES::OpenSLES UNKNOWN IMPORTED)
IMPORTED_LOCATION ${OPENSLES_LIBRARY} set_target_properties(OpenSLES::OpenSLES PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${OPENSLES_INCLUDE_DIR} IMPORTED_LOCATION ${OPENSLES_LIBRARY}
) INTERFACE_INCLUDE_DIRECTORIES ${OPENSLES_INCLUDE_DIR}
)
endif()
endif() endif()
mark_as_advanced(OPENSLES_INCLUDE_DIR OPENSLES_LIBRARY ) mark_as_advanced(OPENSLES_INCLUDE_DIR OPENSLES_LIBRARY )