-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transform the project into a library
- Loading branch information
1 parent
d43d12e
commit f9633ff
Showing
99 changed files
with
458 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Exclude pyftpdlib module from language statistics. | ||
test/ftp/server/pyftpdlib/** linguist-vendored | ||
test/server/pyftpdlib/** linguist-vendored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,69 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
project(ftp_client VERSION 0.0.1 LANGUAGES CXX) | ||
project(ftp | ||
VERSION 0.0.1 | ||
DESCRIPTION "FTP client library" | ||
LANGUAGES CXX) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}" is_top_level) | ||
|
||
add_subdirectory(src) | ||
add_subdirectory(test) | ||
option(LIBFTP_BUILD_TEST "Build tests" ${is_top_level}) | ||
option(LIBFTP_BUILD_EXAMPLE "Build examples" ${is_top_level}) | ||
option(LIBFTP_BUILD_CMDLINE_CLIENT "Build the command-line FTP client application" ${is_top_level}) | ||
|
||
find_package(Boost 1.67.0 REQUIRED) | ||
|
||
set(sources | ||
include/ftp/detail/ascii_istream.hpp | ||
include/ftp/detail/ascii_ostream.hpp | ||
include/ftp/detail/binary_istream.hpp | ||
include/ftp/detail/binary_ostream.hpp | ||
include/ftp/detail/control_connection.hpp | ||
include/ftp/detail/data_connection.hpp | ||
include/ftp/detail/utils.hpp | ||
include/ftp/stream/input_stream.hpp | ||
include/ftp/stream/istream_adapter.hpp | ||
include/ftp/stream/ostream_adapter.hpp | ||
include/ftp/stream/output_stream.hpp | ||
include/ftp/client.hpp | ||
include/ftp/ftp.hpp | ||
include/ftp/ftp_exception.hpp | ||
include/ftp/observer.hpp | ||
include/ftp/replies.hpp | ||
include/ftp/reply.hpp | ||
include/ftp/transfer_callback.hpp | ||
include/ftp/transfer_mode.hpp | ||
include/ftp/transfer_type.hpp | ||
src/ascii_istream.cpp | ||
src/ascii_ostream.cpp | ||
src/binary_istream.cpp | ||
src/binary_ostream.cpp | ||
src/client.cpp | ||
src/control_connection.cpp | ||
src/data_connection.cpp | ||
src/istream_adapter.cpp | ||
src/ostream_adapter.cpp | ||
src/replies.cpp | ||
src/reply.cpp | ||
src/utils.cpp) | ||
|
||
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${sources}) | ||
|
||
add_library(ftp ${sources}) | ||
add_library(ftp::ftp ALIAS ftp) | ||
|
||
target_link_libraries(ftp PUBLIC Boost::boost) | ||
target_include_directories(ftp PUBLIC include) | ||
target_compile_features(ftp PUBLIC cxx_std_17) | ||
|
||
if (LIBFTP_BUILD_TEST) | ||
enable_testing() | ||
add_subdirectory(test) | ||
endif() | ||
|
||
if (LIBFTP_BUILD_EXAMPLES) | ||
add_subdirectory(example) | ||
endif() | ||
|
||
if (LIBFTP_BUILD_CMDLINE_CLIENT) | ||
add_subdirectory(app/cmdline) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
project(cmdline | ||
VERSION 0.0.1 | ||
DESCRIPTION "Command-line FTP client" | ||
LANGUAGES CXX) | ||
|
||
add_executable(cmdline | ||
src/cmdline_exception.hpp | ||
src/cmdline_interface.cpp | ||
src/cmdline_interface.hpp | ||
src/command.hpp | ||
src/command_handler.cpp | ||
src/command_handler.hpp | ||
src/command_parser.cpp | ||
src/command_parser.hpp | ||
src/main.cpp | ||
src/transfer_callback.cpp | ||
src/transfer_callback.hpp | ||
src/utils.cpp | ||
src/utils.hpp) | ||
|
||
target_link_libraries(cmdline PRIVATE ftp::ftp Boost::boost) | ||
target_compile_features(cmdline PRIVATE cxx_std_17) | ||
|
||
if (LIBFTP_BUILD_TEST) | ||
add_subdirectory(test) | ||
endif() |
Oops, something went wrong.