summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2019-11-06 09:43:49 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-11-07 14:01:01 +0100
commit4ab0fb2b48f3cfee6085e2189e6c121c64a78344 (patch)
treec8ad16dccb9456a5d9a19ad34b3013036779dfec
parent8c36a865f267ca99562238f61c34e3578cb05098 (diff)
downloadlibssh-4ab0fb2b48f3cfee6085e2189e6c121c64a78344.tar.gz
libssh-4ab0fb2b48f3cfee6085e2189e6c121c64a78344.tar.xz
libssh-4ab0fb2b48f3cfee6085e2189e6c121c64a78344.zip
cmake: Do not use cached LIBSSH_PUBLIC_INCLUDE_DIRS
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
-rw-r--r--examples/CMakeLists.txt5
-rw-r--r--src/CMakeLists.txt10
-rw-r--r--tests/CMakeLists.txt15
-rw-r--r--tests/benchmarks/CMakeLists.txt4
-rw-r--r--tests/pkd/CMakeLists.txt14
-rw-r--r--tests/server/CMakeLists.txt8
-rw-r--r--tests/server/test_server/CMakeLists.txt6
7 files changed, 24 insertions, 38 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 065200b5..b3b6b358 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -6,10 +6,7 @@ set(examples_SRCS
connect_ssh.c
)
-include_directories(
- ${LIBSSH_PUBLIC_INCLUDE_DIRS}
- ${CMAKE_BINARY_DIR}
-)
+include_directories(${libssh_BINARY_DIR})
if (ARGP_INCLUDE_DIR)
include_directories(${ARGP_INCLUDE_DIR})
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 485f6ed4..804aa41f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,7 +1,4 @@
-set(LIBSSH_PUBLIC_INCLUDE_DIRS
- ${libssh_SOURCE_DIR}/include
- CACHE INTERNAL "libssh public include directories"
-)
+set(LIBSSH_PUBLIC_INCLUDE_DIRS ${libssh_SOURCE_DIR}/include)
set(LIBSSH_PRIVATE_INCLUDE_DIRS
${libssh_BINARY_DIR}
@@ -317,7 +314,10 @@ target_compile_options(ssh
${DEFAULT_C_COMPILE_FLAGS}
-D_GNU_SOURCE)
target_include_directories(ssh
- PRIVATE ${LIBSSH_PUBLIC_INCLUDE_DIRS} ${LIBSSH_PRIVATE_INCLUDE_DIRS})
+ PUBLIC
+ $<BUILD_INTERFACE:${libssh_SOURCE_DIR}/include>
+ $<INSTALL_INTERFACE:include>
+ PRIVATE ${LIBSSH_PRIVATE_INCLUDE_DIRS})
target_link_libraries(ssh
PRIVATE ${LIBSSH_LINK_LIBRARIES})
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index e8b5482f..1df0010e 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -6,15 +6,12 @@ endif (BSD OR SOLARIS OR OSX)
set(TORTURE_LIBRARY torture)
-include_directories(
- ${LIBSSH_PUBLIC_INCLUDE_DIRS}
- ${OPENSSL_INCLUDE_DIR}
- ${CMOCKA_INCLUDE_DIR}
- ${ZLIB_INCLUDE_DIR}
- ${CMAKE_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}/src
- ${CMAKE_CURRENT_SOURCE_DIR}
-)
+include_directories(${OPENSSL_INCLUDE_DIR}
+ ${CMOCKA_INCLUDE_DIR}
+ ${ZLIB_INCLUDE_DIR}
+ ${libssh_BINARY_DIR}
+ ${libssh_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_SOURCE_DIR})
set(TORTURE_LINK_LIBRARIES
${CMOCKA_LIBRARY}
diff --git a/tests/benchmarks/CMakeLists.txt b/tests/benchmarks/CMakeLists.txt
index b8d7cfed..dbaa4d51 100644
--- a/tests/benchmarks/CMakeLists.txt
+++ b/tests/benchmarks/CMakeLists.txt
@@ -4,9 +4,7 @@ set(benchmarks_SRCS
bench_scp.c bench_sftp bench_raw.c benchmarks.c latency.c
)
-include_directories(
- ${LIBSSH_PUBLIC_INCLUDE_DIRS}
-)
+include_directories(${libssh_BINARY_DIR})
add_executable(benchmarks ${benchmarks_SRCS})
diff --git a/tests/pkd/CMakeLists.txt b/tests/pkd/CMakeLists.txt
index 5a543010..85a57775 100644
--- a/tests/pkd/CMakeLists.txt
+++ b/tests/pkd/CMakeLists.txt
@@ -2,14 +2,12 @@ project(pkd C)
if (WITH_SERVER AND UNIX AND NOT WIN32)
-include_directories(
- ${LIBSSH_PUBLIC_INCLUDE_DIRS}
- ${CMOCKA_INCLUDE_DIR}
- ${ZLIB_INCLUDE_DIR}
- ${CMAKE_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}/src
- ${CMAKE_CURRENT_SOURCE_DIR}
-)
+ include_directories(${libssh_SOURCE_DIR}/include
+ ${CMOCKA_INCLUDE_DIR}
+ ${ZLIB_INCLUDE_DIR}
+ ${CMAKE_BINARY_DIR}
+ ${libssh_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_SOURCE_DIR})
set(pkd_hello_src
pkd_daemon.c
diff --git a/tests/server/CMakeLists.txt b/tests/server/CMakeLists.txt
index deba556b..9476ea91 100644
--- a/tests/server/CMakeLists.txt
+++ b/tests/server/CMakeLists.txt
@@ -12,11 +12,9 @@ set(LIBSSH_SERVER_TESTS
torture_server_config
)
-include_directories(
- ${LIBSSH_PUBLIC_INCLUDE_DIRS}
- ${CMAKE_BINARY_DIR}
- test_server
-)
+include_directories(${libssh_SOURCE_DIR}/include
+ ${libssh_BINARY_DIR}
+ test_server)
if (ARGP_INCLUDE_DIR)
include_directories(${ARGP_INCLUDE_DIR})
diff --git a/tests/server/test_server/CMakeLists.txt b/tests/server/test_server/CMakeLists.txt
index 57edd3f4..10bf4b7d 100644
--- a/tests/server/test_server/CMakeLists.txt
+++ b/tests/server/test_server/CMakeLists.txt
@@ -16,10 +16,8 @@ set(LIBSSH_SERVER_TESTS
# torture_server_kbdint
)
-include_directories(
- ${LIBSSH_PUBLIC_INCLUDE_DIRS}
- ${CMAKE_BINARY_DIR}
-)
+include_directories(${libssh_SOURCE_DIR}/include
+ ${libssh_BINARY_DIR})
if (ARGP_INCLUDE_DIR)
include_directories(${ARGP_INCLUDE_DIR})