When one tries to link with archive_static when cross compiling,
compiler cannot find header files.
This PR adds TARGET_INCLUDE_DIRECTORIES for archive_static target,
similar as it is done for shared target.
Similar issues:
https://github.com/libarchive/libarchive/issues/1328
https://discourse.cmake.org/t/cannot-find-library-header-files-when-cross-compiling/5926
Co-authored-by: asolawa <asolawa@cern.ch>
# archive_static is a static library
ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS})
+TARGET_INCLUDE_DIRECTORIES(archive_static PUBLIC .)
TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS})
SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS
LIBARCHIVE_STATIC)