summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDaniil Rozanov <daniilrozzanov@gmail.com>2023-07-05 03:11:34 +0300
committerDaniil Rozanov <daniilrozzanov@gmail.com>2023-07-05 03:11:34 +0300
commitd3f11e3b7b86eda4733ece84294d9dc8da1d23bc (patch)
tree860fea9c8e63d0f62e28a513c0e50d2d7171a8d4 /CMakeLists.txt
parentf51c3ac3f1c0cac99eb8cfe91b280d84f128cdc9 (diff)
Added declaration of connection class with connect and execute members. Created detail and impl folder. Created one example's fileHEADmain
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt37
1 files changed, 37 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3d04ea4..b332a52 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,3 +3,40 @@ project(
ftp
VERSION 0.0.1
LANGUAGES CXX)
+
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+option(FTP_BUILD_TESTS "Enable tests build" OFF)
+option(FTP_BUILD_EXAMPLES "Enable examples build" ON)
+option(FTP_HEADER_ONLY "Install as header only" ON)
+
+find_package(Boost 1.82.0 REQUIRED COMPONENTS system thread regex context)
+
+add_library(ftp INTERFACE)
+add_library(ftp::ftp ALIAS ftp)
+
+target_include_directories(
+ ftp INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ $<INSTALL_INTERFACE:include>)
+
+target_compile_features(ftp INTERFACE cxx_std_17)
+
+if(FTP_HEADER_ONLY)
+ target_compile_definitions(ftp INTERFACE "FTP_HEADER_ONLY")
+ target_sources(ftp INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include/ftp/impl)
+endif()
+
+target_link_libraries(ftp INTERFACE Boost::thread)
+
+set(CMAKE_CXX_EXTENSIONS OFF)
+
+if(FTP_BUILD_TESTS)
+ message("Building tests")
+ add_subdirectory(tests)
+endif()
+
+message(${FTP_BUILD_EXAMPLES})
+if(FTP_BUILD_EXAMPLES)
+ message("Building examples")
+ add_subdirectory(examples)
+endif()