find_path(EXPAT_INCLUDE_DIR NAMES expat.h PATHS ${CONAN_INCLUDE_DIRS_EXPAT})
find_library(EXPAT_LIBRARY NAMES ${CONAN_LIBS_EXPAT} PATHS ${CONAN_LIB_DIRS_EXPAT})

message(STATUS "** EXPAT already found by conan!")
message(STATUS "** Found EXPAT: ${EXPAT_LIBRARY}")
message(STATUS "** Found EXPAT include: ${EXPAT_INCLUDE_DIR}")

set(EXPAT_LIBRARIES ${EXPAT_LIBRARY})
set(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR})
set(EXPAT_FOUND TRUE)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Expat DEFAULT_MSG
    EXPAT_INCLUDE_DIR EXPAT_LIBRARY)

if(NOT TARGET EXPAT::EXPAT)
  add_library(EXPAT::EXPAT INTERFACE IMPORTED)
  set_property(TARGET EXPAT::EXPAT PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${EXPAT_INCLUDE_DIRS})
  set_property(TARGET EXPAT::EXPAT PROPERTY INTERFACE_LINK_LIBRARIES ${EXPAT_LIBRARIES})
endif()
