diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake index 9effd1a2db..ed15ad31aa 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake @@ -20,16 +20,16 @@ endforeach() message("Loading Dependencies ...") # ABSL should be included before protobuf because protobuf may use absl if(NOT onnxruntime_DISABLE_ABSEIL) - include(external/abseil-cpp.cmake) + find_package(absl REQUIRED) + set(ABSEIL_LIBS absl::inlined_vector absl::flat_hash_set + absl::flat_hash_map absl::node_hash_set absl::node_hash_map absl::base absl::throw_delegate absl::raw_hash_set + absl::hash absl::city absl::low_level_hash absl::raw_logging_internal) endif() +find_package(Protobuf REQUIRED) +find_package(re2 REQUIRED) +find_package(nlohmann_json REQUIRED) set(RE2_BUILD_TESTING OFF CACHE BOOL "" FORCE) -FetchContent_Declare( - re2 - URL ${DEP_URL_re2} - URL_HASH SHA1=${DEP_SHA1_re2} - FIND_PACKAGE_ARGS NAMES re2 -) if (onnxruntime_BUILD_UNIT_TESTS) # WebAssembly threading support in Node.js is still an experimental feature and @@ -163,7 +163,6 @@ if (onnxruntime_DISABLE_RTTI) set(protobuf_DISABLE_RTTI ON CACHE BOOL "Remove runtime type information in the binaries" FORCE) endif() -include(protobuf_function) #protobuf end set(ENABLE_DATE_TESTING OFF CACHE BOOL "" FORCE) @@ -303,7 +302,7 @@ FetchContent_Declare( ) # The next line will generate an error message "fatal: not a git repository", but it is ok. It is from flatbuffers -onnxruntime_fetchcontent_makeavailable(Protobuf nlohmann_json mp11 re2 safeint GSL flatbuffers) +onnxruntime_fetchcontent_makeavailable(mp11 safeint GSL flatbuffers) if(NOT flatbuffers_FOUND) if(NOT TARGET flatbuffers::flatbuffers) add_library(flatbuffers::flatbuffers ALIAS flatbuffers) diff --git a/cmake/onnxruntime_unittests.cmake b/cmake/onnxruntime_unittests.cmake index 9347be180d..8c60ff40f4 100644 --- a/cmake/onnxruntime_unittests.cmake +++ b/cmake/onnxruntime_unittests.cmake @@ -876,6 +876,7 @@ endif() onnxruntime_add_include_to_target(onnx_test_data_proto onnx_proto) target_include_directories(onnx_test_data_proto PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) set_target_properties(onnx_test_data_proto PROPERTIES FOLDER "ONNXRuntimeTest") +include(protobuf_function) onnxruntime_protobuf_generate(APPEND_PATH IMPORT_DIRS ${onnx_SOURCE_DIR} TARGET onnx_test_data_proto) #