Config Mode Search Procedure

fmt
├── release
 │     ├── include
 │     └── lib
                 ├── fmt.lib
                 ├── cmake/fmt
                             ├── fmt-config.cmake

command

cmake -G "Visual Studio 16 2019" ^
		-DCMAKE_BUILD_TYPE=Release ^
		-DSPDLOG_FMT_EXTERNAL=True ^
		-Dfmt_DIR=..\fmt\release\

https://cmake.org/cmake/help/v3.23/command/find_package.html

how to define name?

-Dfmt_DIR=…\fmt\release
prefix= …fmt
name=release
?

If it is, do you have the suggest structure for build release and debud?

I follow the below cmake command and build the structure. It seem to cant effectively use Config Mode Search Procedure

cmake -G "Visual Studio 16 2019" ^
		-S .\ ^
		-B .\build-release ^
		-DCMAKE_BUILD_TYPE=Release ^
cmake --build build-release --config Release
cmake --install build-release --config Release --prefix ..\release
fmt
├── release
│       ├── include
│       └── lib
                 ├── fmt.lib
                 ├── cmake/fmt
                             ├── fmt-config.cmake
├── debug
│       ├── include
│       └── lib
                 ├── fmt.lib
                 ├── cmake/fmt
                             ├── fmt-config.cmake

name is the string given to find_package for the name of the package. You can use --debug-find to have CMake give more information about its search procedures. As for release and debug builds, usually they differ in just filenames and you can just overlay the installations over each other. However, it seems like fmt.lib is the same in both, so you’ll have to have different install prefixes in that case.