diff --git a/.gitignore b/.gitignore index b3ee570..c9222b1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .idea/ cmake-build* test_package/build/ -test_package/CMakeUserPresets.json \ No newline at end of file +test_package/CMakeUserPresets.json +conan_provider.cmake +CMakeUserPresets.json diff --git a/CMakeLists.txt b/CMakeLists.txt index cf2406c..28d2366 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,16 +4,12 @@ project(metall-ffi VERSION 0.2.4) include(cmake/boilerplate_init.cmake) boilerplate_init() -OPTION(USE_CONAN "If available, use conan to retrieve dependencies." ON) -if (IS_TOP_LEVEL AND USE_CONAN) - include(cmake/conan_cmake.cmake) - if (PROJECT_IS_TOP_LEVEL AND BUILD_TESTING) - set(CONAN_HYPERTRIE_WITH_TEST_DEPS "True") - else() - set(CONAN_HYPERTRIE_WITH_TEST_DEPS "False") - endif() - set(CONAN_OPTIONS "with_test_deps=${CONAN_HYPERTRIE_WITH_TEST_DEPS}") - install_packages_via_conan("${CMAKE_SOURCE_DIR}/conanfile.py" "${CONAN_OPTIONS};boost:header_only=True") +if (PROJECT_IS_TOP_LEVEL) + set(CONAN_INSTALL_ARGS "${CONAN_INSTALL_ARGS};-o=boost/*:header_only=True") + + if (BUILD_TESTING) + set(CONAN_INSTALL_ARGS "${CONAN_INSTALL_ARGS};-o=&:with_test_deps=True") + endif () endif () find_package(Metall REQUIRED)