2019-05-19 22:17:58 +08:00
|
|
|
# Copyright(c) 2019 spdlog authors
|
|
|
|
# Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
2018-02-12 03:45:56 +08:00
|
|
|
|
2018-02-12 04:16:15 +08:00
|
|
|
cmake_minimum_required(VERSION 3.1)
|
2019-05-29 05:04:36 +08:00
|
|
|
project(spdlog_examples CXX)
|
2018-02-12 03:45:56 +08:00
|
|
|
|
2019-05-29 05:04:36 +08:00
|
|
|
if(NOT TARGET spdlog)
|
2019-05-18 12:15:08 +08:00
|
|
|
# Stand-alone build
|
|
|
|
find_package(spdlog REQUIRED)
|
2018-02-12 03:45:56 +08:00
|
|
|
endif()
|
|
|
|
|
2019-05-19 21:34:38 +08:00
|
|
|
#---------------------------------------------------------------------------------------
|
2019-05-18 12:20:30 +08:00
|
|
|
# Example of using pre-compiled library
|
2019-05-19 21:34:38 +08:00
|
|
|
#---------------------------------------------------------------------------------------
|
2018-02-12 03:45:56 +08:00
|
|
|
add_executable(example example.cpp)
|
2019-05-18 12:23:51 +08:00
|
|
|
target_link_libraries(example spdlog::spdlog)
|
2018-10-03 16:10:37 +08:00
|
|
|
|
2019-05-19 21:34:38 +08:00
|
|
|
#---------------------------------------------------------------------------------------
|
2019-05-18 12:20:30 +08:00
|
|
|
# Example of using header-only library
|
2019-05-19 21:34:38 +08:00
|
|
|
#---------------------------------------------------------------------------------------
|
2019-05-18 12:20:30 +08:00
|
|
|
add_executable(example_header_only example.cpp)
|
2019-05-19 21:34:38 +08:00
|
|
|
target_link_libraries(example_header_only spdlog::spdlog_header_only)
|
|
|
|
|
2019-05-19 22:16:22 +08:00
|
|
|
# Create logs directory
|
2018-02-12 03:45:56 +08:00
|
|
|
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
|