mdbx-cmake: синхронизация утилит между проектами.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2024-12-12 13:06:44 +03:00
parent f2dc60aa53
commit 513518ca5e
2 changed files with 18 additions and 1 deletions

View File

@ -31,9 +31,11 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.9)
cmake_policy(SET CMP0069 NEW) cmake_policy(SET CMP0069 NEW)
endif() endif()
cmake_policy(SET CMP0054 NEW)
if(CMAKE_VERSION MATCHES ".*MSVC.*" AND CMAKE_VERSION VERSION_LESS 3.16) if(CMAKE_VERSION MATCHES ".*MSVC.*" AND CMAKE_VERSION VERSION_LESS 3.16)
message(FATAL_ERROR "CMake from MSVC kit is unfit! " message(FATAL_ERROR "CMake from MSVC kit is unfit! "
"Please use MSVC2019 with modern CMake the original CMake from https://cmake.org/download/") "Please use MSVC-2019 with modern CMake the original CMake from https://cmake.org/download/")
endif() endif()
if(NOT (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED)) if(NOT (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED))

View File

@ -12,6 +12,21 @@ endif()
cmake_policy(PUSH) cmake_policy(PUSH)
cmake_policy(VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION}) cmake_policy(VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION})
macro(add_option HIVE NAME DESCRIPTION DEFAULT)
list(APPEND ${HIVE}_BUILD_OPTIONS ${HIVE}_${NAME})
if(NOT ${DEFAULT} STREQUAL "AUTO")
option(${HIVE}_${NAME} "${DESCRIPTION}" ${DEFAULT})
elseif(NOT DEFINED ${HIVE}_${NAME})
set(${HIVE}_${NAME}_AUTO ON)
endif()
endmacro()
macro(set_if_undefined VARNAME)
if(NOT DEFINED "${VARNAME}")
set("${VARNAME}" ${ARGN})
endif()
endmacro()
macro(add_compile_flags languages) macro(add_compile_flags languages)
foreach(_lang ${languages}) foreach(_lang ${languages})
string(REPLACE ";" " " _flags "${ARGN}") string(REPLACE ";" " " _flags "${ARGN}")