spdlog/example/CMakeLists.txt

30 lines
1.0 KiB
CMake
Raw Normal View History

2019-05-19 22:17:58 +08:00
# Copyright(c) 2019 spdlog authors
# Distributed under the MIT License (http://opensource.org/licenses/MIT)
cmake_minimum_required(VERSION 3.1)
2019-05-29 05:04:36 +08:00
project(spdlog_examples CXX)
include(../cmake/utils.cmake)
2019-05-29 05:04:36 +08:00
if(NOT TARGET spdlog)
# Stand-alone build
find_package(spdlog REQUIRED)
endif()
2019-05-19 21:34:38 +08:00
#---------------------------------------------------------------------------------------
# Example of using pre-compiled library
2019-05-19 21:34:38 +08:00
#---------------------------------------------------------------------------------------
add_executable(example example.cpp)
2019-06-10 23:09:36 +08:00
spdlog_enable_warnings(example)
2019-06-10 23:32:10 +08:00
target_link_libraries(example PRIVATE spdlog::spdlog)
2019-05-19 21:34:38 +08:00
#---------------------------------------------------------------------------------------
# Example of using header-only library
2019-05-19 21:34:38 +08:00
#---------------------------------------------------------------------------------------
2019-07-01 07:06:09 +08: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 21:34:38 +08:00