From 9521cd63b28b185aaa5b7aa356b99ce93e4013fc Mon Sep 17 00:00:00 2001 From: Srikanth Yalavarthi Date: Sat, 21 Oct 2023 01:47:30 -0700 Subject: [PATCH] [CMake] Fix order of GNUInstallDirs module In CMakeLists.txt, the variables CMAKE_INSTALL_ are referenced before the execution of GNUInstallDirs module. This order is incorrect as the variables are defined by the GNUInstallDirs module. Since the variables are undefined, INTERFACE_INCLUDE_DIRECTORIES property is not set in the tvmTargets.cmake. This causes external applications based on TVM unable to find TVM runtime headers. Signed-off-by: Srikanth Yalavarthi --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4d599134587..7a55a629bd8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -566,6 +566,7 @@ add_library(tvm_objs OBJECT ${COMPILER_SRCS}) add_library(tvm_runtime_objs OBJECT ${RUNTIME_SRCS}) add_library(tvm_libinfo_objs OBJECT ${LIBINFO_FILE}) +include(GNUInstallDirs) if(NOT BUILD_DUMMY_LIBTVM) add_library(tvm SHARED $ $ $) else() @@ -783,7 +784,6 @@ else(INSTALL_DEV) ) endif(INSTALL_DEV) -include(GNUInstallDirs) include(CMakePackageConfigHelpers) set(PROJECT_CONFIG_CONTENT "@PACKAGE_INIT@\n") string(APPEND PROJECT_CONFIG_CONTENT "include(CMakeFindDependencyMacro)\n")