@@ -11,7 +11,9 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
1111set (CMAKE_VISIBILITY_INLINES_HIDDEN 1)
1212
1313find_package (Threads REQUIRED)
14- find_package (asio REQUIRED)
14+ if (FINEFTP_SERVER_USE_BUILTIN_ASIO)
15+ find_package (asio REQUIRED)
16+ endif ()
1517
1618# Include GenerateExportHeader that will create export macros for us
1719include (GenerateExportHeader)
@@ -65,18 +67,22 @@ generate_export_header(${PROJECT_NAME}
6567
6668add_library (fineftp::server ALIAS ${PROJECT_NAME} )
6769
68-
6970target_link_libraries (${PROJECT_NAME}
70- PRIVATE
71- Threads::Threads
72- $<$<BOOL :${WIN32} >:ws2_32>
73- $<$<BOOL :${WIN32} >:wsock32>
74-
75- # Link header-only libs (asio & recycle) as described in this workaround:
76- # https://gitlab.kitware.com/cmake/cmake/-/issues/15415#note_633938
77- $<BUILD_INTERFACE:asio::asio>
71+ PRIVATE
72+ Threads::Threads
73+ $<$<BOOL :${WIN32} >:ws2_32>
74+ $<$<BOOL :${WIN32} >:wsock32>
7875)
7976
77+ if (FINEFTP_SERVER_USE_BUILTIN_ASIO)
78+ target_link_libraries (${PROJECT_NAME}
79+ PRIVATE
80+ # Link header-only libs (asio & recycle) as described in this workaround:
81+ # https://gitlab.kitware.com/cmake/cmake/-/issues/15415#note_633938
82+ $<BUILD_INTERFACE:asio::asio>
83+ )
84+ endif ()
85+
8086target_compile_definitions (${PROJECT_NAME}
8187 PRIVATE
8288 ASIO_STANDALONE
0 commit comments