Skip to content

Commit c31404e

Browse files
committed
cmake: make installed package relocatable
Remove the absolute include header path from the install target. The created CMake package still has the right include generated: ```cmake set_target_properties(libdeflate::libdeflate_static PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" ) ``` As mentioned in the (Creating Relocatable Packages)[https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#creating-relocatable-packages] section of the CMake documentation packages created with `install(EXPORT)` are designed to be relocatable. This also makes it possible to cache the install directory over multiple computer (for example through a package manager).
1 parent d65d5db commit c31404e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ endif()
244244

245245
set(LIB_INCLUDE_DIRS
246246
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
247-
$<INSTALL_INTERFACE:${CMAKE_INSTALL_FULL_INCLUDEDIR}>)
247+
)
248248

249249
if(LIBDEFLATE_APPLE_FRAMEWORK)
250250
# Define resource files for Apple Framework

0 commit comments

Comments
 (0)