Add binary dir to target include directories

Build binary dir contains the libssh_version.h file. By adding the binary dir to
the target include path, the include file can be found by projects which use
libssh as a sub-project by add_subdirectory().

Signed-off-by: Sven Fischer <sven@leiderfischer.de>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Sven Fischer
2023-11-17 18:16:46 +01:00
committed by Jakub Jelen
parent 54ac7c95e8
commit 19439fcfd8

View File

@@ -346,6 +346,7 @@ endif ()
target_include_directories(ssh
PUBLIC
$<BUILD_INTERFACE:${libssh_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${libssh_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE ${LIBSSH_PRIVATE_INCLUDE_DIRS})
@@ -409,6 +410,7 @@ if (BUILD_STATIC_LIB)
target_include_directories(ssh-static
PUBLIC
$<BUILD_INTERFACE:${libssh_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${libssh_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE ${LIBSSH_PRIVATE_INCLUDE_DIRS})
target_link_libraries(ssh-static