embeddedmz / ftpclient-cpp

C++ client for making FTP requests
MIT License
211 stars 67 forks source link

Add conanfile.py and support generating conan package #30

Closed chubei-oppen closed 2 years ago

embeddedmz commented 3 years ago

Hi chubei-oppen,

LINUX macro is already defined by the CMake script, I don't know if it's a good idea to use linux macro instead (I don't know if all the GNU/Linux compilers define it).

I never used Conan but I trust what you have done.

Regards.

embeddedmz commented 3 years ago

Can you also use a CMake option for FTPClient_SKIP_TESTS ? i.e. : option(SKIP_TESTS_BUILD "Skip tests build" ON)

You can put it in the main CMakeLists.txt file and use it to cover this CMake code like this :

if(NOT SKIP_TESTS_BUILD)
add_subdirectory(TestFTP)

include(CTest)
enable_testing ()

# test if the test INI file exist, otherwise default it to the one in TestFTP folder
IF (NOT TEST_INI_FILE)
    SET(TEST_INI_FILE "./TestFTP/template_test_conf.ini")
    MESSAGE(WARNING "You didn't provide an INI test configuration file.\
    Defaulting TEST_INI_FILE to ./TestFTP/template_test_conf.ini")
ENDIF()

add_test (NAME FtpClientTest COMMAND test_ftpclient ${TEST_INI_FILE})
endif(NOT SKIP_TESTS_BUILD)

Thanks

chubei-oppen commented 2 years ago

Hi @embeddedmz, thanks for you review and comment. I've made the modifications as you suggested.

Conan is just a package manager like vcpkg, while being more flexible and extensible IMHO.

embeddedmz commented 2 years ago

Thank you !