Many warning fixes as well as improved CMake support.
[sgt:sgt.git] / src / CMakeLists.txt
1 #add_definitions('-fpermissive')\r
2 if(MSVC)\r
3         add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DNOMINMAX -DCRT_SECURE_NO_WARNINGS)     \r
4         # disable checked iterators for msvc release builds to get maximum speed\r
5         # add here warnings which should produce an error /weXXXX\r
6         set(MSVC_W_ERROR   "/we4101 /we4189")\r
7         # add here warnings which should be disabled /wdXXXX\r
8         set(MSVC_W_DISABLE "/wd4288 /wd4355 /wd4800 /wd4996 /wd4311 /wd4312 /wd4505 /wd4267 /wd4512 /wd4245 /wd4127 /wd4180")\r
9 \r
10         set(CMAKE_CXX_FLAGS_RELEASE  "${CMAKE_CXX_FLAGS_RELEASE} /D_SECURE_SCL=0")\r
11 \r
12         set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")\r
13         set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")\r
14         set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")\r
15 \r
16 endif()\r
17 \r
18 cmake_minimum_required(VERSION 2.6)\r
19 project(sgt)\r
20 add_subdirectory(src)\r