dfleury2 / beauty

A Simple C++ Http server/client above Boost.Beast
MIT License
188 stars 23 forks source link

Not able to disable conan install method #6

Closed dhruvkakadiya closed 2 years ago

dhruvkakadiya commented 2 years ago

In readme, seems minor typo.

replace cmake .. -DCMAKE_BUILD_TYPE=Release by cmake .. -DCMAKE_BUILD_TYPE=Release -DCONAN_false to not use Conan. Hope your the dependencies are found on your Linux.

which can be

replace cmake .. -DCMAKE_BUILD_TYPE=Release by cmake .. -DCMAKE_BUILD_TYPE=Release -DCONAN=false to not use Conan. Hope your the dependencies are found on your Linux.

Even though correcting that, cmake toolchain try to find conan so it's trying to install this library through conan.. so seems like disabling conan not working as expected.

While digging through root level CMakeLists.txt file, below can be found so probably that needs to be taken under CONAN macro which worked fine for me. Also didn't understand use case of empty CONAN_EXPORTED.

if (CONAN_EXPORTED)
else()
    if (NOT EXISTS ${CMAKE_BINARY_DIR}/conan_toolchain.cmake)
        include(${PROJECT_SOURCE_DIR}/cmake/conan.cmake)

        conan_cmake_autodetect(settings)

        conan_cmake_install(PATH_OR_REFERENCE ${PROJECT_SOURCE_DIR}/conanfile.py
                PROFILE ${CONAN_PROFILE}
                PROFILE_BUILD ${CONAN_PROFILE}
                BUILD missing
                SETTINGS ${settings}
                )
    endif()
endif()

include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake)

which can be

if (CONAN)
    if (NOT EXISTS ${CMAKE_BINARY_DIR}/conan_toolchain.cmake)
        include(${PROJECT_SOURCE_DIR}/cmake/conan.cmake)

        conan_cmake_autodetect(settings)

        conan_cmake_install(PATH_OR_REFERENCE ${PROJECT_SOURCE_DIR}/conanfile.py
                PROFILE ${CONAN_PROFILE}
                PROFILE_BUILD ${CONAN_PROFILE}
                BUILD missing
                SETTINGS ${settings}
                )
    else()
        include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake)
    endif()
endif()
dfleury2 commented 2 years ago

Hi, Thanks I will fix this part when conan is not used.

dfleury2 commented 2 years ago

Done. You can try the lastest commits, should work without Conan.

dhruvkakadiya commented 2 years ago

Thank you, @dfleury2.