diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-01-23 18:57:35 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-01-23 18:57:35 +0100 |
commit | 8abdaa7abf64b67ac6ca04e2d5fee84ebec47691 (patch) | |
tree | 7e0d3cc57322f0d62d1a13ea39a547a14782ece3 | |
parent | 80ef7d93046cffe174e8a46706e2481f54e7a4aa (diff) | |
download | libssh-8abdaa7abf64b67ac6ca04e2d5fee84ebec47691.tar.gz libssh-8abdaa7abf64b67ac6ca04e2d5fee84ebec47691.tar.xz libssh-8abdaa7abf64b67ac6ca04e2d5fee84ebec47691.zip |
examples: Start to build examples on more plattforms.
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | examples/CMakeLists.txt | 58 |
2 files changed, 30 insertions, 32 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a96eec81..d5a2c1a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,9 +87,7 @@ install( pkgconfig ) -if (CMAKE_SYSTEM_NAME STREQUAL "Linux") - add_subdirectory(examples) -endif (CMAKE_SYSTEM_NAME STREQUAL "Linux") +add_subdirectory(examples) if (WITH_TESTING) find_package(CMockery REQUIRED) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index ad614294..671d2e43 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -8,41 +8,41 @@ set(examples_SRCS include_directories( ${LIBSSH_PUBLIC_INCLUDE_DIRS} - ${LIBSSH_PRIVATE_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR} ) -add_executable(libssh_scp libssh_scp.c ${examples_SRCS}) -add_executable(scp_download scp_download.c ${examples_SRCS}) -add_executable(samplessh sample.c ${examples_SRCS}) -add_executable(exec exec.c ${examples_SRCS}) -add_executable(senddata senddata.c ${examples_SRCS}) -add_executable(sshnetcat sshnetcat.c ${examples_SRCS}) +if (LINUX) + add_executable(libssh_scp libssh_scp.c ${examples_SRCS}) + target_link_libraries(libssh_scp ${LIBSSH_SHARED_LIBRARY}) -add_executable(libsshpp libsshpp.cpp) -add_executable(libsshpp_noexcept libsshpp_noexcept.cpp) + add_executable(scp_download scp_download.c ${examples_SRCS}) + target_link_libraries(scp_download ${LIBSSH_SHARED_LIBRARY}) -target_link_libraries(libssh_scp ${LIBSSH_SHARED_LIBRARY}) -target_link_libraries(scp_download ${LIBSSH_SHARED_LIBRARY}) -target_link_libraries(samplessh ${LIBSSH_SHARED_LIBRARY}) -target_link_libraries(exec ${LIBSSH_SHARED_LIBRARY}) -target_link_libraries(senddata ${LIBSSH_SHARED_LIBRARY}) -target_link_libraries(libsshpp ${LIBSSH_SHARED_LIBRARY}) -target_link_libraries(libsshpp_noexcept ${LIBSSH_SHARED_LIBRARY}) -target_link_libraries(sshnetcat ${LIBSSH_SHARED_LIBRARY}) + add_executable(samplessh sample.c ${examples_SRCS}) + target_link_libraries(samplessh ${LIBSSH_SHARED_LIBRARY}) + add_executable(exec exec.c ${examples_SRCS}) + target_link_libraries(exec ${LIBSSH_SHARED_LIBRARY}) -include_directories( - ${LIBSSH_PUBLIC_INCLUDE_DIRS} - ${CMAKE_BINARY_DIR} -) + add_executable(senddata senddata.c ${examples_SRCS}) + target_link_libraries(senddata ${LIBSSH_SHARED_LIBRARY}) + + add_executable(sshnetcat sshnetcat.c ${examples_SRCS}) + target_link_libraries(sshnetcat ${LIBSSH_SHARED_LIBRARY}) -if (WITH_SFTP) - add_executable(samplesftp samplesftp.c ${examples_SRCS}) - target_link_libraries(samplesftp ${LIBSSH_SHARED_LIBRARY}) -endif (WITH_SFTP) + if (WITH_SFTP) + add_executable(samplesftp samplesftp.c ${examples_SRCS}) + target_link_libraries(samplesftp ${LIBSSH_SHARED_LIBRARY}) + endif (WITH_SFTP) -if (WITH_SERVER) - add_executable(samplesshd samplesshd.c) - target_link_libraries(samplesshd ${LIBSSH_SHARED_LIBRARY}) -endif (WITH_SERVER) + if (WITH_SERVER) + add_executable(samplesshd samplesshd.c) + target_link_libraries(samplesshd ${LIBSSH_SHARED_LIBRARY}) + endif (WITH_SERVER) +endif (LINUX) +add_executable(libsshpp libsshpp.cpp) +target_link_libraries(libsshpp ${LIBSSH_SHARED_LIBRARY}) + +add_executable(libsshpp_noexcept libsshpp_noexcept.cpp) +target_link_libraries(libsshpp_noexcept ${LIBSSH_SHARED_LIBRARY}) |