Wrap interface include directories with BUILD_INTERFACE generator expression (#966)

* Wrap interface include directories with BUILD_INTERFACE generator expression

When exporting a CMake target using install(TARGETS) + install(EXPORT),
CMake requires all include directories to be clean of build system
directories.

https://cmake.org/cmake/help/latest/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.html

This change also allows use of brotli as a CMake subproject and
installing + exporting it.

* Fix typo in generator expression
This commit is contained in:
Anonymous Maarten 2022-05-12 09:50:48 +02:00 committed by GitHub
parent f09b2555ac
commit 9801a2c5d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,7 +197,7 @@ foreach(lib IN LISTS BROTLI_SHARED_LIBS BROTLI_STATIC_LIBS)
if(NOT BROTLI_EMSCRIPTEN) if(NOT BROTLI_EMSCRIPTEN)
set_target_properties(${lib} PROPERTIES POSITION_INDEPENDENT_CODE TRUE) set_target_properties(${lib} PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
endif() endif()
set_property(TARGET ${lib} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIRS}") set_property(TARGET ${lib} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${BROTLI_INCLUDE_DIRS}>")
endforeach() endforeach()
if(NOT BROTLI_EMSCRIPTEN) if(NOT BROTLI_EMSCRIPTEN)