vcpkg-cmake-wrapper.cmake 1.1 KB

123456789101112131415161718192021222324252627
  1. include(SelectLibraryConfigurations)
  2. set(EXPATNAMES expat expatw libexpat libexpatw)
  3. set(DEBUGNAMES)
  4. foreach(_CRT "" MT MD)
  5. foreach(name IN LISTS EXPATNAMES)
  6. list(APPEND EXPATNAMES ${name}${_CRT})
  7. list(APPEND DEBUGNAMES ${name}d${_CRT})
  8. endforeach()
  9. endforeach()
  10. find_library(EXPAT_LIBRARY_DEBUG NAMES ${DEBUGNAMES} ${EXPATNAMES} NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH)
  11. find_library(EXPAT_LIBRARY_RELEASE NAMES ${EXPATNAMES} NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH)
  12. select_library_configurations(EXPAT)
  13. set(EXPAT_LIBRARY "${EXPAT_LIBRARIES}" CACHE STRING "" FORCE)
  14. _find_package(${ARGS})
  15. if(EXPAT_FOUND AND TARGET EXPAT::EXPAT)
  16. if(EXPAT_LIBRARY_DEBUG)
  17. set_target_properties(EXPAT::EXPAT PROPERTIES IMPORTED_LOCATION_DEBUG "${EXPAT_LIBRARY_DEBUG}")
  18. endif()
  19. if(EXPAT_LIBRARY_RELEASE)
  20. set_target_properties(EXPAT::EXPAT PROPERTIES IMPORTED_LOCATION_RELEASE "${EXPAT_LIBRARY_RELEASE}")
  21. endif()
  22. endif()
  23. unset(EXPATNAMES)
  24. unset(DEBUGNAMES)