mdbx-cmake: синхронизация утилит между проектами.
This commit is contained in:
parent
f2dc60aa53
commit
513518ca5e
|
@ -31,9 +31,11 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.9)
|
|||
cmake_policy(SET CMP0069 NEW)
|
||||
endif()
|
||||
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
|
||||
if(CMAKE_VERSION MATCHES ".*MSVC.*" AND CMAKE_VERSION VERSION_LESS 3.16)
|
||||
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()
|
||||
|
||||
if(NOT (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED))
|
||||
|
|
|
@ -12,6 +12,21 @@ endif()
|
|||
cmake_policy(PUSH)
|
||||
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)
|
||||
foreach(_lang ${languages})
|
||||
string(REPLACE ";" " " _flags "${ARGN}")
|
||||
|
|
Loading…
Reference in New Issue