CMakeLists.txt: MSVC-options are defined twice and wrongly
With MR da29b078 Microsoft Visual C defines are added to CMakeLists.txt:
add_compile_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
a.) This CMake definition leads to wrong MSVC definitions.
b.) This CMake definitions are not compliant for CMake before 3.12 (see MR 0d8a2092)
c.) One of those three definitions are defined twice within CMakeLists.txt and cmake/WindowsSupport.cmake. It is CRT_SECURE_NO_WARNINGS. There, the definition syntax is correct.
Either use "add_compile_definition(_CRT_SECURE_NO_DEPRECATE)" or "add_definitions(-D_CRT_SECURE_NO_DEPRECATE)".
IMHO, the MSVC compile definition in CMakeLists.txt should read:
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
and all MSVC compile definitions should be defined only at one place, preferrable within cmake/WindowsSupport.cmake, which is included in CMakeLists.txt.
@rleigh: Would you mind checking that.
Steps to reproduce
Visual Studio 2022 compiler issues warnings about:
Not valid macro definition: -D_CRT_SECURE_NO_DEPRECATE
Version: libtiff version 4.4.0
Platform: Windows 10 x64, Visual Studio 2022 with CMake