Closed JosiahWI closed 1 year ago
@JosiahWI how we exactly achieve this? I tried:
include(FetchContent)
FetchContent_Declare(
nuraft
GIT_REPOSITORY https://ghproxy.com/https://github.com/eBay/NuRaft.git
GIT_TAG 188947bcc73ce38ab1c3cf9d01015ca8a29decd9
GIT_SUBMODULES_RECURSE TRUE
)
FetchContent_MakeAvailable(nuraft)
find_package(NuRaft REQUIRED)
add_executable(mephisto main.cpp)
target_link_libraries(mephisto PRIVATE NuRaft::static_lib)
... and get:
CMake Error at CMakeLists.txt:15 (find_package):
By not providing "FindNuRaft.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "NuRaft", but
CMake did not find one.
Could not find a package configuration file provided by "NuRaft" with any
of the following names:
NuRaftConfig.cmake
nuraft-config.cmake
Add the installation prefix of "NuRaft" to CMAKE_PREFIX_PATH or set
"NuRaft_DIR" to a directory containing one of the above files. If "NuRaft"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
It seems the config file locates in _deps/nuraft-build/NuRaftConfig.cmake
but the find_package
cannot find it.
This exports both the shared and static library targets. A downstream project can use then use them as follows:
Closes #450