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