2019-09-29 20:13:24 +02:00
|
|
|
# Copyright(c) 2019 spdlog authors
|
|
|
|
# Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
2019-05-10 00:30:44 +02:00
|
|
|
|
2020-04-11 22:31:39 +02:00
|
|
|
cmake_minimum_required(VERSION 3.2)
|
2019-09-29 20:13:24 +02:00
|
|
|
project(spdlog_examples CXX)
|
2019-05-10 00:30:44 +02:00
|
|
|
|
|
|
|
if(NOT TARGET spdlog)
|
2019-09-29 20:13:24 +02:00
|
|
|
# Stand-alone build
|
|
|
|
find_package(spdlog REQUIRED)
|
2019-05-10 00:30:44 +02:00
|
|
|
endif()
|
|
|
|
|
2019-09-29 20:13:24 +02:00
|
|
|
#---------------------------------------------------------------------------------------
|
|
|
|
# Example of using pre-compiled library
|
|
|
|
#---------------------------------------------------------------------------------------
|
2019-05-10 00:30:44 +02:00
|
|
|
add_executable(example example.cpp)
|
2019-09-29 20:13:24 +02:00
|
|
|
target_link_libraries(example PRIVATE spdlog::spdlog)
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------
|
|
|
|
# Example of using header-only library
|
|
|
|
#---------------------------------------------------------------------------------------
|
|
|
|
if(SPDLOG_BUILD_EXAMPLE_HO)
|
2020-04-11 22:31:39 +02:00
|
|
|
add_executable(example_header_only example.cpp)
|
2019-09-29 20:13:24 +02:00
|
|
|
target_link_libraries(example_header_only PRIVATE spdlog::spdlog_header_only)
|
2019-05-10 00:30:44 +02:00
|
|
|
endif()
|
|
|
|
|