2015-07-13 15:49:44 +02:00
|
|
|
# g3log is a KjellKod Logger
|
|
|
|
# 2015 @author Kjell Hedström, hedstrom@kjellkod.cc
|
|
|
|
# ==================================================================
|
|
|
|
# 2015 by KjellKod.cc. This is PUBLIC DOMAIN to use at your own
|
|
|
|
# risk and comes with no warranties.
|
|
|
|
#
|
|
|
|
# This code is yours to share, use and modify with no strings attached
|
|
|
|
# and no restrictions or obligations.
|
|
|
|
# ===================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ==============================================================
|
2014-10-03 08:56:13 +02:00
|
|
|
# -DUSE_SIMPLE_EXAMPLE=OFF : to turn off the fatal examples
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Leaving it to ON will create
|
|
|
|
# g3log-FATAL-sigsegv
|
|
|
|
# g3log-FATAL-contract
|
|
|
|
#
|
|
|
|
# ==============================================================
|
|
|
|
|
2016-08-11 08:27:52 +02:00
|
|
|
IF (MSVC OR MINGW)
|
|
|
|
set(EXAMPLE_PLATFORM_LINK_LIBRIES dbghelp)
|
|
|
|
ENDIF()
|
2014-10-03 08:56:13 +02:00
|
|
|
|
|
|
|
set(DIR_EXAMPLE ${g3log_SOURCE_DIR}/example)
|
2015-07-13 15:49:44 +02:00
|
|
|
option (ADD_FATAL_EXAMPLE "Fatal (fatal-crashes/contract) examples " ON)
|
2014-10-03 08:56:13 +02:00
|
|
|
|
|
|
|
|
2015-07-13 15:49:44 +02:00
|
|
|
IF (ADD_FATAL_EXAMPLE)
|
2017-05-17 22:31:19 +02:00
|
|
|
message( STATUS "-DADD_FATAL_EXAMPLE=ON" )
|
|
|
|
message( STATUS "\t\t[contract][sigsegv][fatal choice] are examples of when g3log comes in handy\n" )
|
2014-10-03 08:56:13 +02:00
|
|
|
include_directories (${DIR_EXAMPLE})
|
|
|
|
add_executable(g3log-FATAL-contract ${DIR_EXAMPLE}/main_contract.cpp)
|
|
|
|
add_executable(g3log-FATAL-sigsegv ${DIR_EXAMPLE}/main_sigsegv.cpp)
|
2014-12-12 16:44:17 +01:00
|
|
|
add_executable(g3log-FATAL-choice ${DIR_EXAMPLE}/main_fatal_choice.cpp)
|
|
|
|
|
2016-08-11 08:27:52 +02:00
|
|
|
target_link_libraries(g3log-FATAL-contract ${G3LOG_LIBRARY} ${EXAMPLE_PLATFORM_LINK_LIBRIES})
|
|
|
|
target_link_libraries(g3log-FATAL-sigsegv ${G3LOG_LIBRARY} ${EXAMPLE_PLATFORM_LINK_LIBRIES})
|
|
|
|
target_link_libraries(g3log-FATAL-choice ${G3LOG_LIBRARY} ${EXAMPLE_PLATFORM_LINK_LIBRIES})
|
2014-10-03 08:56:13 +02:00
|
|
|
ELSE()
|
2017-05-17 22:31:19 +02:00
|
|
|
message( STATUS "-DADD_SIMPLE_EXAMPLE=OFF" )
|
2015-07-13 15:49:44 +02:00
|
|
|
ENDIF (ADD_FATAL_EXAMPLE)
|