Skip to content

Commit

Permalink
update to conan 2
Browse files Browse the repository at this point in the history
  • Loading branch information
liss-h committed Jul 30, 2024
1 parent 4b435db commit 04ba173
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.idea/
cmake-build*
test_package/build/
test_package/CMakeUserPresets.json
test_package/CMakeUserPresets.json
conan_provider.cmake
CMakeUserPresets.json
16 changes: 6 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 04ba173

Please sign in to comment.