From 83491ddd43fb4733940c92e9d7d7647f66f49bbe Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Sun, 21 Aug 2022 06:18:13 +0400 Subject: =?UTF-8?q?Build:=20`add=5Fdefinitions()`=20=E2=86=92=20`add=5Fcom?= =?UTF-8?q?pile=5Fdefinitions()`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 2 +- CompileFlags.cmake | 4 ++-- Source/CMakeLists.txt | 4 ++-- Source/QtDialog/CMakeLists.txt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54ff7e2..a50e222 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -595,7 +595,7 @@ macro(CMAKE_BUILD_UTILITIES) set(EXPAT_LIBRARY ${CMAKE_EXPAT_LIBRARIES}) set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES}) set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES}) - add_definitions(-DLIBARCHIVE_STATIC) + add_compile_definitions(LIBARCHIVE_STATIC) set(ENABLE_MBEDTLS OFF) set(ENABLE_NETTLE OFF) if(DEFINED CMAKE_USE_OPENSSL) diff --git a/CompileFlags.cmake b/CompileFlags.cmake index acfa29f..bf8a082 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -18,7 +18,7 @@ endif() # not hurt other versions, and this will work into the # future if(MSVC OR _INTEL_WINDOWS OR _CLANG_MSVC_WINDOWS) - add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) + add_compile_definitions(_CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE) else() endif() @@ -62,7 +62,7 @@ endif() # Use 64-bit off_t on 32-bit Linux if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SIZEOF_VOID_P EQUAL 4) # ensure 64bit offsets are used for filesystem accesses for 32bit compilation - add_definitions(-D_FILE_OFFSET_BITS=64) + add_compile_definitions(_FILE_OFFSET_BITS=64) endif() # Workaround for TOC Overflow on ppc64 diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 1182483..2645b7b 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -48,10 +48,10 @@ set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR}) if(WIN32) # ensure Unicode friendly APIs are used on Windows - add_definitions(-DUNICODE -D_UNICODE) + add_compile_definitions(UNICODE _UNICODE) # minimize windows.h content - add_definitions(-DWIN32_LEAN_AND_MEAN) + add_compile_definitions(WIN32_LEAN_AND_MEAN) endif() # configure the .dox.in file diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 4f56919..f3859e1 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -42,7 +42,7 @@ set(CMake_QT_EXTRA_LIBRARIES) if(WIN32) find_package(Qt${INSTALLED_QT_VERSION}WinExtras QUIET) if(Qt${INSTALLED_QT_VERSION}WinExtras_FOUND) - add_definitions(-DQT_WINEXTRAS) + add_compile_definitions(QT_WINEXTRAS) list(APPEND CMake_QT_EXTRA_LIBRARIES Qt${INSTALLED_QT_VERSION}::WinExtras) list(APPEND QT_COMPONENTS WinExtras) endif() -- cgit v0.12