Skip to content

Commit

Permalink
Wrap interface include directories with BUILD_INTERFACE generator exp…
Browse files Browse the repository at this point in the history
…ression (google#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
  • Loading branch information
madebr authored and slouken committed May 12, 2022
1 parent e61745a commit 2ae7ff8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -192,7 +192,7 @@ foreach(lib IN LISTS BROTLI_SHARED_LIBS BROTLI_STATIC_LIBS)
if(NOT BROTLI_EMSCRIPTEN)
set_target_properties(${lib} PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
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()

if(NOT BROTLI_EMSCRIPTEN)
Expand Down

0 comments on commit 2ae7ff8

Please sign in to comment.