-
Notifications
You must be signed in to change notification settings - Fork 74
Respect FINEFTP_SERVER_USE_BUILTIN_ASIO #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
d08abf9 to
9d2b5e5
Compare
- Fix asio cmake to take FINEFTP_SERVER_USE_BUILTIN_ASIO into account - Removed trailing spaces
9d2b5e5 to
745de30
Compare
|
Hi @ShaharHD, May I ask which issue made you implement this PR? Because the Cmake Option is handled here: Line 39 in bbd4e0e
Even if you set FINEFTP_SERVER_USE_BUILTIN_ASIO to OFF, the library still has to find asio from somewhere, therefore the find package call should still be there. The option is only supposed to enable the user to provide their own version of asio, as the built in version will not be found anymore. |
|
I'm integrating your code into a Yocto (custom linux build) using the attached bitbake.
(also worth noting I'm using Moving forward, I could rename the CMake flag to be SUMMARY = "Minimal FTP server library for Windows and Unix flavors"
HOMEPAGE = "https://github.com/eclipse-ecal/fineftp-server"
SECTION = "libs"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=255477cf76395ebf131ac789c47d0dc5"
DEPENDS = "asio"
PV .= "+git${SRCPV}"
SRC_URI = "\
git://github.com/eclipse-ecal/fineftp-server.git;protocol=https;branch=master \
file://0001-Fix-asio-cmake-required.patch"
SRCREV = "1f08ffaa413dd6b75d0bbb46bfbc140c7f4758ff"
S = "${WORKDIR}/git"
inherit cmake
EXTRA_OECMAKE += "\
-DFINEFTP_SERVER_BUILD_SAMPLES=OFF \
-DFINEFTP_SERVER_USE_BUILTIN_ASIO=OFF \
-DFINEFTP_SERVER_USE_BUILTIN_GTEST=OFF \
-DBUILD_SHARED_LIBS=ON"
BBCLASSEXTEND = "native nativesdk"
If you wish, you can actually submit your library as an offiical layer into Yocto at https://layers.openembedded.org/layerindex/branch/master/recipes/ |
|
OK, I understand you issue. For some reason, your system has asio in a standard include path, but it lacks a CMake find or config script. Thus, on that particular system you don't need a find_package call, because asio is in your standard include paths and you cannot link against asio::asio, as no find or config script created proper CMake targets. However, simply removing the
If I would merge this PR in the current state, using asio from somewhere else would fail on every other system that uses a proper asio find module or config script. I would however be OK with also providing a Can you ceck if having the following file ijn your
find_path(asio_INCLUDE_DIR
NAMES asio.hpp
HINTS
${asio_ROOT_DIR}
/usr/local
/opt
/usr
PATH_SUFFIXES include
DOC "Path to the asio include directory"
)
if(asio_INCLUDE_DIR-NOTFOUND)
message(FATAL_ERROR "Could not find asio library")
set(asio_FOUND FALSE)
else()
set(asio_FOUND TRUE)
set(ASIO_INCLUDE_DIR ${asio_INCLUDE_DIR})
endif()
if(asio_FOUND)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(asio
REQUIRED_VARS asio_INCLUDE_DIR)
if(NOT TARGET asio::asio)
set(asio_INCLUDE_DIRS ${asio_INCLUDE_DIR})
add_library(asio::asio INTERFACE IMPORTED)
set_target_properties(asio::asio PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${asio_INCLUDE_DIR}
INTERFACE_COMPILE_DEFINITIONS ASIO_STANDALONE)
mark_as_advanced(asio_INCLUDE_DIR)
endif()
endif() |
|
Can please you update the PR to include the Keep in mind, that I already have the patch of this PR integrated into my bitbake I'm trying to confirm if you're suggesting to replace one injection patch with another? |
|
No, the idea is not to use a patch here, but just place the code I posted earlier somewhere on the build system and then add the directory as CMAKE_MODULE_PATH: the find_asio.cmake script does not need to be included from within the CMakeLists.txt. Doing that actually only is a workaround to make sure that the vendored asio is used. |
FINEFTP_SERVER_USE_BUILTIN_ASIOinto account