g3log/example/Example.cmake
Kjell Hedström 33ed100f91 Colorer build and loglevel improvements (#161)
* static build with MS libs; remove vc11 support from cmake
* support AMD processor on winXp
* mingw build
* support older versions
* removed cmake warnings

* fix cmake >= 3.1 warnings (CMP0054)
* add target_include_directories - in projects that depend on g3log, do not need to specify include_directories
* Improved CPackage installation
* cleanup of build and test scripts
* c++14 gives for cleaner syntax
* build cleanup libg3logger.so will be a link to the actual libg3logger.so.<major><minor><build>. Only shared libraries from now on



* disableAll for log levels
* new setLogLevel impl
* cleaned up levels, now it should be easy for the user to understand how to add custom levels
2017-03-30 22:52:09 -06:00

47 lines
1.8 KiB
CMake

# 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.
# ===================================================================
# ==============================================================
# -DUSE_SIMPLE_EXAMPLE=OFF : to turn off the fatal examples
#
#
# Leaving it to ON will create
# g3log-FATAL-sigsegv
# g3log-FATAL-contract
#
# ==============================================================
IF (MSVC OR MINGW)
set(EXAMPLE_PLATFORM_LINK_LIBRIES dbghelp)
ENDIF()
set(DIR_EXAMPLE ${g3log_SOURCE_DIR}/example)
option (ADD_FATAL_EXAMPLE "Fatal (fatal-crashes/contract) examples " ON)
IF (ADD_FATAL_EXAMPLE)
MESSAGE("-DADD_FATAL_EXAMPLE=ON")
MESSAGE("\t\t[contract][sigsegv][fatal choice] are examples of when g3log comes in handy\n")
include_directories (${DIR_EXAMPLE})
add_executable(g3log-FATAL-contract ${DIR_EXAMPLE}/main_contract.cpp)
add_executable(g3log-FATAL-sigsegv ${DIR_EXAMPLE}/main_sigsegv.cpp)
add_executable(g3log-FATAL-choice ${DIR_EXAMPLE}/main_fatal_choice.cpp)
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})
ELSE()
MESSAGE("-DADD_SIMPLE_EXAMPLE=OFF")
ENDIF (ADD_FATAL_EXAMPLE)