spdlogConfig.cmake 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Copyright(c) 2019 spdlog authors
  2. # Distributed under the MIT License (http://opensource.org/licenses/MIT)
  3. ####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
  4. ####### Any changes to this file will be overwritten by the next CMake run ####
  5. ####### The input file was spdlogConfig.cmake.in ########
  6. get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
  7. macro(set_and_check _var _file)
  8. set(${_var} "${_file}")
  9. if(NOT EXISTS "${_file}")
  10. message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
  11. endif()
  12. endmacro()
  13. macro(check_required_components _NAME)
  14. foreach(comp ${${_NAME}_FIND_COMPONENTS})
  15. if(NOT ${_NAME}_${comp}_FOUND)
  16. if(${_NAME}_FIND_REQUIRED_${comp})
  17. set(${_NAME}_FOUND FALSE)
  18. endif()
  19. endif()
  20. endforeach()
  21. endmacro()
  22. ####################################################################################
  23. find_package(Threads REQUIRED)
  24. set(SPDLOG_FMT_EXTERNAL ON)
  25. set(SPDLOG_FMT_EXTERNAL_HO OFF)
  26. set(config_targets_file spdlogConfigTargets.cmake)
  27. if(SPDLOG_FMT_EXTERNAL OR SPDLOG_FMT_EXTERNAL_HO)
  28. include(CMakeFindDependencyMacro)
  29. find_dependency(fmt CONFIG)
  30. endif()
  31. include("${CMAKE_CURRENT_LIST_DIR}/${config_targets_file}")
  32. check_required_components(spdlog)