diff --git a/CMakeLists.txt b/CMakeLists.txt index 91489e8e..ca396734 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -520,8 +520,6 @@ target_include_directories(getdns_objects src/yxml ${CMAKE_CURRENT_BINARY_DIR} - ${LIBIDN_INCLUDE_DIR} - ${LIBIDN2_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR} ) if (NOT HAVE_SSL_DANE_ENABLE) @@ -529,6 +527,12 @@ if (NOT HAVE_SSL_DANE_ENABLE) target_include_directories(getdns_objects PRIVATE src/ssl_dane) set(USE_DANESSL 1) endif () +if (Libidn_FOUND) + target_include_directories(getdns_objects PRIVATE Libidn::Libidn) +endif () +if (Libidn2_FOUND) + target_include_directories(getdns_objects PRIVATE Libidn2::Libidn2) +endif () # Don't compile separate objects for shared and static libraries. # Yes, -fPIC is slightly suboptimal for static libraries, but it looks