ydp/fbthrift_example

cmake failed because of "fmt::fmt"

jimkingstone opened this issue · 0 comments

question details:
[cmake]
############
-- Found FBThrift: /usr/local
-- Found folly: /usr/local
-- Found wangle: /usr/local
-- Found fizz: /usr/local
-- Found YARPL: /usr/local
-- Found rsocket: /usr/local
-- Found gflags from package config /usr/local/lib/cmake/gflags/gflags-config.cmake
-- Configuring done
CMake Error at CMakeLists.txt:17 (add_executable):
Target "fbthrift_ex" links to target "fmt::fmt" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?

CMake Error at CMakeLists.txt:17 (add_executable):
Target "fbthrift_ex" links to target "fmt::fmt" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?

-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
############

[make]
############
[ 11%] Building CXX object CMakeFiles/fbthrift_ex.dir/main.cc.o
[ 22%] Building CXX object CMakeFiles/fbthrift_ex.dir/gen-cpp2/ExampleService.cpp.o
[ 33%] Building CXX object CMakeFiles/fbthrift_ex.dir/gen-cpp2/ExampleServiceAsyncClient.cpp.o
[ 44%] Building CXX object CMakeFiles/fbthrift_ex.dir/gen-cpp2/ExampleService_processmap_binary.cpp.o
[ 55%] Building CXX object CMakeFiles/fbthrift_ex.dir/gen-cpp2/ExampleService_processmap_compact.cpp.o
[ 66%] Building CXX object CMakeFiles/fbthrift_ex.dir/gen-cpp2/example_constants.cpp.o
[ 77%] Building CXX object CMakeFiles/fbthrift_ex.dir/gen-cpp2/example_data.cpp.o
[ 88%] Building CXX object CMakeFiles/fbthrift_ex.dir/gen-cpp2/example_types.cpp.o
[100%] Linking CXX executable fbthrift_ex
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld.gold: error: cannot find -lfmt::fmt
############

[solution]
############
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 16b7c89..99a929d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,7 @@ find_package(fizz REQUIRED)
find_package(Threads REQUIRED)
find_package(yarpl REQUIRED)
find_package(rsocket REQUIRED)
+find_package(fmt REQUIRED)
find_package(Glog)
find_package(Gflags)
############