server/cmake/Modules/MSVC.cmake

20 lines
605 B
CMake
Raw Normal View History

2017-04-22 18:07:09 +02:00
MACRO (MSVC_CRT_SECURE_NO_WARNINGS)
IF (MSVC)
FOREACH (target ${ARGN})
SET_TARGET_PROPERTIES (${target} PROPERTIES
COMPILE_DEFINITIONS _CRT_SECURE_NO_WARNINGS
)
ENDFOREACH (target)
ENDIF (MSVC)
ENDMACRO (MSVC_CRT_SECURE_NO_WARNINGS)
MACRO (MSVC_SET_WARNING_LEVEL level)
IF (MSVC)
IF(CMAKE_C_FLAGS MATCHES "/W[0-4]")
STRING(REGEX REPLACE "/W[0-4]" "/W${level}" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
ELSE()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W${level}")
ENDIF()
ENDIF(MSVC)
ENDMACRO (MSVC_SET_WARNING_LEVEL)