Medical Imaging Interaction Toolkit  2018.4.99-c4b6bb11
Medical Imaging Interaction Toolkit
mitkFunctionSuppressWarnings.cmake
Go to the documentation of this file.
1 
2 # suppress some warnings in VC8 about using unsafe/deprecated c functions
4  if(MSVC)
5  add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS)
6  endif()
7 endfunction()
8 
9 function(SUPPRESS_ALL_WARNINGS)
10  if(MSVC)
11  string(REGEX REPLACE "/W[0-9]" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
12  string(REGEX REPLACE "/W[0-9]" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
13  add_definitions(/W0)
14  # suppress also poco linker warnings
15  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /ignore:4217")
16  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /ignore:4217")
17  elseif(CMAKE_COMPILER_IS_GNUCXX)
18  add_definitions(-w)
19  endif()
20 endfunction(SUPPRESS_ALL_WARNINGS)
21 
SUPPRESS_ALL_WARNINGS()
SUPPRESS_VC_DEPRECATED_WARNINGS()