@ -11,17 +11,22 @@ endif()
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# E x a m p l e o f u s i n g s h a r e d l i b r a r i e s
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ( SPDLOG_BUILD_SHARED OR BUILD_SHARED_LIBS )
add_library ( mylibrary SHARED mylibrary.cpp mylibrary.h )
target_link_libraries ( mylibrary PRIVATE spdlog::spdlog )
target_compile_definitions ( mylibrary PUBLIC SPDLOG_SHARED_LIB )
target_compile_definitions ( mylibrary PUBLIC SPDLOG_COMPILED_LIB )
add_executable ( library_example library_example.cpp )
target_link_libraries ( library_example PRIVATE spdlog::spdlog mylibrary )
target_compile_definitions ( library_example PUBLIC SPDLOG_SHARED_LIB )
target_compile_definitions ( library_example PUBLIC SPDLOG_COMPILED_LIB )
else ( )
add_library ( mylibrary SHARED mylibrary.cpp mylibrary.h )
target_link_libraries ( mylibrary PRIVATE spdlog::spdlog_header_only )
if ( SPDLOG_BUILD_SHARED OR BUILD_SHARED_LIBS )
target_compile_definitions ( mylibrary PUBLIC SPDLOG_SHARED_LIB )
target_compile_definitions ( library_example PUBLIC SPDLOG_SHARED_LIB )
add_executable ( library_example library_example.cpp )
target_link_libraries ( library_example PRIVATE spdlog::spdlog_header_only mylibrary )
endif ( )
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -