Skip to content

Commit

Permalink
[CMake] Fix order of GNUInstallDirs module (#15966)
Browse files Browse the repository at this point in the history
In CMakeLists.txt, the variables CMAKE_INSTALL_<dir> 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 <syalavarthi@marvell.com>
  • Loading branch information
syalavarthi committed Oct 25, 2023
1 parent 2f0a385 commit 3c4ee86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<TARGET_OBJECTS:tvm_objs> $<TARGET_OBJECTS:tvm_runtime_objs> $<TARGET_OBJECTS:tvm_libinfo_objs>)
else()
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 3c4ee86

Please sign in to comment.