Skip to content

Commit

Permalink
Add Findfmt.cmake like FindFeast.cmake.
Browse files Browse the repository at this point in the history
  • Loading branch information
iglesias committed May 1, 2024
1 parent 6306c1c commit 8fa7497
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/cmake/Findfmt.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FIND_LIBRARY(FMT_LIB NAMES fmt fmtd)

SET(FMT_FOUND FALSE)
IF (FMT_LIB)
SET(FMT_FOUND TRUE)
MARK_AS_ADVANCED(LIBFMT_LIBRARY)
ENDIF (FMT_LIB)

IF (FMT_FOUND)
IF (NOT FMT_LIB_FIND_QUIETLY)
MESSAGE(STATUS "Found fmt : ${FMT_LIB}")
GET_FILENAME_COMPONENT(FMT_PATH ${FMT_LIB} PATH CACHE)
SET(FMT_INCLUDE_DIR "")
ENDIF (NOT FMT_LIB_FIND_QUIETLY)
ELSE(FMT_FOUND)
MESSAGE(FATAL_ERROR "Could not find fmt")
ENDIF (FMT_FOUND)

1 comment on commit 8fa7497

@iglesias
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ cmake -B build -S .
CMake Error at CMakeLists.txt:21 (find_package):
  By not providing "Findfmt.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "fmt", but
  CMake did not find one.

  Could not find a package configuration file provided by "fmt" with any of
  the following names:

    fmtConfig.cmake
    fmt-config.cmake

  Add the installation prefix of "fmt" to CMAKE_PREFIX_PATH or set "fmt_DIR"
  to a directory containing one of the above files.  If "fmt" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!
$ cmake -B build -S .
CMake Error at src/cmake/Findfmt.cmake:16 (MESSAGE):
  Could not find fmt
Call Stack (most recent call first):
  CMakeLists.txt:21 (find_package)


-- Configuring incomplete, errors occurred!

Please sign in to comment.