2019-11-18 22:59:06 +08:00
|
|
|
cmake_minimum_required(VERSION 3.1)
|
|
|
|
|
|
|
|
# configure compiler
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED on)
|
2019-11-22 01:34:09 +08:00
|
|
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS on)
|
2019-11-18 22:59:06 +08:00
|
|
|
|
|
|
|
if(MINGW)
|
|
|
|
# COMPILER-SETTINGS FOR MINGW
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
|
|
|
|
elseif(MSVC)
|
|
|
|
# COMPILER-SETTINGS FOR MS VISUAL C++
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
|
2019-11-21 15:01:17 +08:00
|
|
|
# To enable M_PI, M_E,...
|
2019-11-18 22:59:06 +08:00
|
|
|
add_definitions(/D_USE_MATH_DEFINES)
|
2019-11-21 15:01:17 +08:00
|
|
|
# To Prevent Errors with min() and max()
|
|
|
|
add_definitions(/DNOMINMAX)
|
2019-11-18 22:59:06 +08:00
|
|
|
# To fix error: C2338: va_start argument must not
|
|
|
|
# have reference type and must not be parenthesized
|
|
|
|
add_definitions(/D_CRT_NO_VA_START_VALIDATION)
|
|
|
|
endif()
|