From 75c0ad637e01c9d4710064bc48945fd12e5c8b59 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Mon, 15 Sep 2025 08:32:45 +0200 Subject: [PATCH] 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). --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7c615af..79f8badd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -244,7 +244,7 @@ endif() set(LIB_INCLUDE_DIRS $ - $) +) if(LIBDEFLATE_APPLE_FRAMEWORK) # Define resource files for Apple Framework