--- source/CMakeLists.txt.orig	2020-06-06 08:18:40 UTC
+++ source/CMakeLists.txt
@@ -122,3 +122,4 @@
     if(ENABLE_LIBVMAF)
         add_definitions(-DENABLE_LIBVMAF)
+        include_directories(${VMAF_INCLUDE_DIR})
     endif()
@@ -592,12 +592,6 @@ if(ENABLE_HDR10_PLUS)
         ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
 endif()
 
-if(SVTHEVC_FOUND)
-    install(FILES "${SVT_HEVC_INCLUDE_DIR}/EbApi.h" DESTINATION include)
-    install(FILES "${SVT_HEVC_INCLUDE_DIR}/EbErrorCodes.h" DESTINATION include)
-    install(FILES "${SVT_HEVC_LIBRARY}" DESTINATION ${LIB_INSTALL_DIR})
-endif()
-
 install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" DESTINATION include)
 if((WIN32 AND ENABLE_CLI) OR (WIN32 AND ENABLE_SHARED))
     if(MSVC_IDE)
@@ -649,7 +643,10 @@ if(ENABLE_SHARED)
     if(EXTRA_LIB)
         target_link_libraries(x265-shared ${EXTRA_LIB})
     endif()
-	 target_link_libraries(x265-shared ${PLATFORM_LIBS})
+    if(ENABLE_LIBVMAF)
+	target_link_libraries(x265-shared ${VMAF})
+    endif()
+	target_link_libraries(x265-shared ${PLATFORM_LIBS})
     if(SVTHEVC_FOUND)
         target_link_libraries(x265-shared ${SVT_HEVC_LIBRARY})
     endif(SVTHEVC_FOUND)
