CMakeLists.txt 963 B

1234567891011121314151617181920212223
  1. # Copyright(c) 2019 spdlog authors Distributed under the MIT License (http://opensource.org/licenses/MIT)
  2. cmake_minimum_required(VERSION 3.10)
  3. project(spdlog_examples CXX)
  4. if(NOT TARGET spdlog)
  5. # Stand-alone build
  6. find_package(spdlog REQUIRED)
  7. endif()
  8. # ---------------------------------------------------------------------------------------
  9. # Example of using pre-compiled library
  10. # ---------------------------------------------------------------------------------------
  11. add_executable(example example.cpp)
  12. target_link_libraries(example PRIVATE spdlog::spdlog)
  13. # ---------------------------------------------------------------------------------------
  14. # Example of using header-only library
  15. # ---------------------------------------------------------------------------------------
  16. if(SPDLOG_BUILD_EXAMPLE_HO)
  17. add_executable(example_header_only example.cpp)
  18. target_link_libraries(example_header_only PRIVATE spdlog::spdlog_header_only)
  19. endif()