2019-05-19 17:17:58 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Copyright(c) 2019 spdlog authors
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Distributed under the MIT License (http://opensource.org/licenses/MIT)
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-11 20:45:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-11 21:16:15 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								cmake_minimum_required(VERSION 3.1)
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-11 20:45:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								project(SpdlogExamples CXX)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-17 23:15:08 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								if(TARGET spdlog)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # If we're running this example as part of the primary spdlog applciation
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # then add an alias. This allows us to use the same "spdlog::spdlog"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # below that a user would use (with the namespace)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    add_library(spdlog::spdlog ALIAS spdlog)
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-19 16:34:38 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    add_library(spdlog::spdlog_header_only ALIAS spdlog_header_only)
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-17 23:15:08 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								else()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # Stand-alone build
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    find_package(spdlog REQUIRED)
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-11 20:45:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								endif()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-19 16:34:38 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#---------------------------------------------------------------------------------------
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-17 23:20:30 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Example of using pre-compiled library
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-19 16:34:38 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#---------------------------------------------------------------------------------------
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-11 20:45:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								add_executable(example example.cpp)
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-17 23:23:51 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								target_link_libraries(example spdlog::spdlog)
							 | 
						
					
						
							
								
									
										
										
										
											2018-10-03 10:10:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-19 16:34:38 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#---------------------------------------------------------------------------------------
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-17 23:20:30 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Example of using header-only library
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-19 16:34:38 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#---------------------------------------------------------------------------------------
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-17 23:20:30 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								add_executable(example_header_only example.cpp)
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-19 16:34:38 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								target_link_libraries(example_header_only spdlog::spdlog_header_only)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-19 17:16:22 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Create logs directory
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-11 20:45:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
							 |