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)
|
|
|
|
|
|
|
|
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")
|
|
|
|
# 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)
|
2019-11-24 17:42:44 +08:00
|
|
|
add_definitions(/DNOMINMAX)
|
2019-11-18 22:59:06 +08:00
|
|
|
endif()
|
2019-11-22 00:07:25 +08:00
|
|
|
|
|
|
|
if(NOT APPLE)
|
|
|
|
set(CMAKE_INSTALL_RPATH $ORIGIN)
|
|
|
|
endif()
|