diff --git a/CMakeLists.txt b/CMakeLists.txt index 9728ead..f9e8051 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,8 +93,13 @@ set(MINIZIP_DEPENDS "" CACHE INTERNAL "MINIZIP_DEPENDS") set(LIBKML_TARGETS) -find_package(EXPAT) -if(EXPAT_FOUND) +find_package(expat CONFIG REQUIRED) +if(WIN32 AND NOT MINGW) + set(EXPAT_LIBRARY expat::libexpat) +else() + set(EXPAT_LIBRARY expat::expat) +endif() +if(EXPAT_LIBRARY) include_directories(${EXPAT_INCLUDE_DIR}) else() include(External_expat)