spdlog/example/CMakeLists.txt

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
990 B
CMake
Raw Permalink Normal View History

2020-05-02 16:38:14 +08:00
# Copyright(c) 2019 spdlog authors Distributed under the MIT License (http://opensource.org/licenses/MIT)
cmake_minimum_required(VERSION 3.11)
2019-05-29 05:04:36 +08:00
project(spdlog_examples CXX)
2019-05-29 05:04:36 +08:00
if(NOT TARGET spdlog)
2020-05-02 16:42:08 +08:00
# Stand-alone build
find_package(spdlog REQUIRED)
endif()
2020-05-02 16:38:14 +08:00
# ---------------------------------------------------------------------------------------
# Example of using pre-compiled library
2020-05-02 16:38:14 +08:00
# ---------------------------------------------------------------------------------------
add_executable(example example.cpp)
target_link_libraries(example PRIVATE spdlog::spdlog $<$<BOOL:${MINGW}>:ws2_32>)
2020-05-02 16:38:14 +08:00
# ---------------------------------------------------------------------------------------
# Example of using header-only library
2020-05-02 16:38:14 +08:00
# ---------------------------------------------------------------------------------------
2019-07-01 07:06:09 +08:00
if(SPDLOG_BUILD_EXAMPLE_HO)
2020-05-02 16:42:08 +08:00
add_executable(example_header_only example.cpp)
target_link_libraries(example_header_only PRIVATE spdlog::spdlog_header_only)
2019-07-01 07:06:09 +08:00
endif()