Zstd: cmake target libzstd_static does not export public include directory

Created on 19 Nov 2018  路  4Comments  路  Source: facebook/zstd

This is a regression that happened in 1.3.5.
With zstd 1.3.4 I could use library as subproject in cmake, without global install

  1. put the whole source in my project,
  2. in CMake add subdirectory: add_subdirectory(zstd-1.3.4/build/cmake)
  3. In CMake in my target add target_link_library(my_target PRIVATE libzstd_static)
  4. Use library with #include

With 1.3.5 and 1.3.7 this fails with "zstd.h file not found".

build issue help wanted

All 4 comments

ok, possibly this is not regression - I may have modified 1.3.4 locally.
Anyway,
target_include_directories(libzstd_static INTERFACE ${LIBRARY_DIR}) is needed in build/cmake/lib/CMakeLists.txt and similar for shared version.

We accept PR on this topic

FYI: #1474, #1475 are precursors towards being able to support this use-case robustly.

With both #1474 and #1475 merged, I guess this topic is covered now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robert3005 picture robert3005  路  4Comments

pjebs picture pjebs  路  3Comments

indygreg picture indygreg  路  3Comments

sergeevabc picture sergeevabc  路  3Comments

animalize picture animalize  路  3Comments