title: CMake add fmt library
body: <p>I have a CMake project, with following structure:</p>
  <pre><code>cmake_minimum_required(VERSION 3.11)
  project(ReadGraph)
  
  # Download and unpack googletest at configure time
  configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
  execute_process(COMMAND ${CMAKE_COMMAND} -G &quot;${CMAKE_GENERATOR}&quot; .
    RESULT_VARIABLE result
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download )
  if(result)
    message(FATAL_ERROR &quot;CMake step for googletest failed: ${result}&quot;)
  endif()
  execute_process(COMMAND ${CMAKE_COMMAND} --build .
    RESULT_VARIABLE result
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download )
  if(result)
    message(FATAL_ERROR &quot;Build step for googletest failed: ${result}&quot;)
  endif()
  
  # Add googletest directly to our build. This defines
  # the gtest and gtest_main targets.
  add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src
                   ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
                   EXCLUDE_FROM_ALL)
  
  SET(CMAKE_CXX_FLAGS &quot;-std=c++20 -pthread -O3&quot;)
  include_directories(include)
  
  enable_testing()
  file(GLOB TESTS &quot;test/*.cpp&quot; &quot;test/*/*.cpp&quot; &quot;src/*.cpp&quot; &quot;src/*/*.cpp&quot;)
  add_executable(Tests ${TESTS})
  target_link_libraries(Tests gtest_main)
  </code></pre>
  <p>And this CMakeLists.txt.in file:</p>
  <pre><code>cmake_minimum_required(VERSION 3.11)
  
  project(googletest-download NONE)
  
  include(ExternalProject)
  ExternalProject_Add(googletest
    GIT_REPOSITORY    https://github.com/google/googletest.git
    GIT_TAG           master
    SOURCE_DIR        &quot;${CMAKE_CURRENT_BINARY_DIR}/googletest-src&quot;
    BINARY_DIR        &quot;${CMAKE_CURRENT_BINARY_DIR}/googletest-build&quot;
    CONFIGURE_COMMAND &quot;&quot;
    BUILD_COMMAND     &quot;&quot;
    INSTALL_COMMAND   &quot;&quot;
    TEST_COMMAND      &quot;&quot;
  )
  </code></pre>
  <p>Most of this I copy-pasted from <a href="https://github.com/google/googletest" rel="noreferrer">GoogleTest</a> instructions.</p>
  <p>Usage of Gtests works perfectly for me.</p>
  <p>I figured that I want to use <a href="https://github.com/fmtlib/fmt" rel="noreferrer">FMT Library</a> in my project.</p>
  <p>I tried some approaches (such as direct copy of approach from gtest) to include FMT into my project, but failed.</p>
  <p>I want CMake to download this library and embed it into my project, so I can use FMT as follow:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;fmt/core.h&gt;
  </code></pre>
  <p>Currently I am receiving following error massage:</p>
  <pre><code>fatal error: fmt/core.h: No such file or directory
     10 | #include &lt;fmt/core.h&gt;
        |          ^~~~~~~~~~~~
  compilation terminated.
  </code></pre>