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 + $ + $ + 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})