if(NOT EASYLOGGINGPP_PATH)
	message(SEND_ERROR "Please define EASYLOGGINGPP_PATH")
endif()


set(EASYLOGGINGPP_VERSION "9.95.3")
set(EASYLOGGINGPP_LIBRARY "easyloggingpp")
set(EASYLOGGINGPP_INCLUDE_DIRS "${EASYLOGGINGPP_PATH}/src")
set(EASYLOGGINGPP_CPP_SOURCES "${EASYLOGGINGPP_PATH}/src/easylogging++.cc")


add_library("${EASYLOGGINGPP_LIBRARY}" SHARED ${EASYLOGGINGPP_CPP_SOURCES})
set_target_properties(
	${EASYLOGGINGPP_LIBRARY}
	PROPERTIES SOVERSION
	${EASYLOGGINGPP_VERSION}
)
target_include_directories(
	${EASYLOGGINGPP_LIBRARY}
	PUBLIC
	${EASYLOGGINGPP_INCLUDE_DIRS}
)


# easylogging++ fails the Effective C++ checks (g++), so remove that flag.
set(EASYLOGGINGPP_CXX_FLAGS ${MAIN_CXX_FLAGS})
list(REMOVE_ITEM EASYLOGGINGPP_CXX_FLAGS -Weffc++)
target_compile_options(
	${EASYLOGGINGPP_LIBRARY}
	PUBLIC
	"${EASYLOGGINGPP_CXX_FLAGS}"
)
