aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2019-11-05 08:50:12 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-11-07 16:14:46 +0100
commitff534bc2fe9a4f25923fa1ffbdb114a7fa4d2907 (patch)
treef094d78b233d1fed699afa04968f8597d714059d
parent27096c3c0f218e1a8977dc5f08def1ea9c22d546 (diff)
downloadlibssh-ff534bc2fe9a4f25923fa1ffbdb114a7fa4d2907.tar.gz
libssh-ff534bc2fe9a4f25923fa1ffbdb114a7fa4d2907.tar.xz
libssh-ff534bc2fe9a4f25923fa1ffbdb114a7fa4d2907.zip
cmake: Use target_include_directories()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> (cherry picked from commit 5e2788d4c54de203e0fa5a6c9253e93c2836bd01)
-rw-r--r--src/CMakeLists.txt9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0c153ad3..1a2036f0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -295,11 +295,6 @@ if (NOT WITH_NACL)
endif (NOT HAVE_OPENSSL_ED25519)
endif (NOT WITH_NACL)
-include_directories(
- ${LIBSSH_PUBLIC_INCLUDE_DIRS}
- ${LIBSSH_PRIVATE_INCLUDE_DIRS}
-)
-
# Set the path to the default map file
set(MAP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.map")
@@ -336,6 +331,8 @@ target_compile_options(${LIBSSH_SHARED_LIBRARY}
PRIVATE
${DEFAULT_C_COMPILE_FLAGS}
-D_GNU_SOURCE)
+target_include_directories(${LIBSSH_SHARED_LIBRARY}
+ PRIVATE ${LIBSSH_PUBLIC_INCLUDE_DIRS} ${LIBSSH_PRIVATE_INCLUDE_DIRS})
target_link_libraries(${LIBSSH_SHARED_LIBRARY}
PRIVATE ${LIBSSH_LINK_LIBRARIES})
@@ -390,6 +387,8 @@ if (BUILD_STATIC_LIB)
${DEFAULT_C_COMPILE_FLAGS}
-D_GNU_SOURCE)
+ target_include_directories(${LIBSSH_STATIC_LIBRARY}
+ PRIVATE ${LIBSSH_PUBLIC_INCLUDE_DIRS} ${LIBSSH_PRIVATE_INCLUDE_DIRS})
target_link_libraries(${LIBSSH_STATIC_LIBRARY}
PUBLIC ${LIBSSH_LINK_LIBRARIES})