Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IMPORTED_LOCATION not set for imported target

Tags:

cmake

fmt

I'm getting the following error in cmake

[cmake] CMake Error in CMakeLists.txt:
[cmake]   IMPORTED_LOCATION not set for imported target "fmt::fmt" configuration
[cmake]   "Debug".

I've installed fmtlib

$ sudo cmake --install . --config Debug
-- Installing: /usr/local/lib/libfmt.so.9.1.1
-- Installing: /usr/local/lib/libfmt.so.9
-- Installing: /usr/local/lib/libfmt.so
-- Installing: /usr/local/include/fmt/args.h
-- Installing: /usr/local/include/fmt/chrono.h
-- Installing: /usr/local/include/fmt/color.h
-- Installing: /usr/local/include/fmt/compile.h
-- Installing: /usr/local/include/fmt/core.h
-- Installing: /usr/local/include/fmt/format.h
-- Installing: /usr/local/include/fmt/format-inl.h
-- Installing: /usr/local/include/fmt/os.h
-- Installing: /usr/local/include/fmt/ostream.h
-- Installing: /usr/local/include/fmt/printf.h
-- Installing: /usr/local/include/fmt/ranges.h
-- Installing: /usr/local/include/fmt/std.h
-- Installing: /usr/local/include/fmt/xchar.h
-- Installing: /usr/local/lib/cmake/fmt/fmt-config.cmake
-- Installing: /usr/local/lib/cmake/fmt/fmt-config-version.cmake
-- Installing: /usr/local/lib/cmake/fmt/fmt-targets.cmake
-- Installing: /usr/local/lib/pkgconfig/fmt.pc

Here's my CMakeLists.txt:

cmake_minimum_required (VERSION 3.20)
project (Test)
set(CMAKE_CXX_STANDARD 23)
add_executable(main main.cpp)
find_package(fmt)
target_link_libraries(main fmt::fmt)
like image 950
Tom Huntington Avatar asked Oct 23 '25 07:10

Tom Huntington


1 Answers

Reinstalling without the debug config got it working:

$ sudo cmake --install .
like image 66
Tom Huntington Avatar answered Oct 25 '25 04:10

Tom Huntington



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!