mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
Check and enforce CMake version
This commit is contained in:
@@ -186,6 +186,7 @@ project(px4 CXX C ASM)
|
|||||||
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.0.0)
|
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.0.0)
|
||||||
cmake_policy(SET CMP0045 NEW) # error on non-existent target in get prop
|
cmake_policy(SET CMP0045 NEW) # error on non-existent target in get prop
|
||||||
cmake_policy(SET CMP0046 NEW) # no non-existent targets as dependencies
|
cmake_policy(SET CMP0046 NEW) # no non-existent targets as dependencies
|
||||||
|
cmake_policy(SET CMP0025 OLD) # still report AppleClang as Clang
|
||||||
endif()
|
endif()
|
||||||
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.1.0)
|
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.1.0)
|
||||||
cmake_policy(SET CMP0054 NEW) # don't dereference quoted variables
|
cmake_policy(SET CMP0054 NEW) # don't dereference quoted variables
|
||||||
|
|||||||
14
Makefile
14
Makefile
@@ -36,7 +36,19 @@
|
|||||||
# We depend on our submodules, so we have to prevent attempts to
|
# We depend on our submodules, so we have to prevent attempts to
|
||||||
# compile without it being present.
|
# compile without it being present.
|
||||||
ifeq ($(wildcard .git),)
|
ifeq ($(wildcard .git),)
|
||||||
$(error YOU HAVE TO USE GIT TO DOWNLOAD THIS REPOSITORY. ABORTING.)
|
$(error YOU HAVE TO USE GIT TO DOWNLOAD THIS REPOSITORY. ABORTING.)
|
||||||
|
endif
|
||||||
|
|
||||||
|
CMAKE_VER := $(shell Tools/check_cmake.sh; echo $$?)
|
||||||
|
ifneq ($(CMAKE_VER),0)
|
||||||
|
$(warning Not a valid CMake version or CMake not installed.)
|
||||||
|
$(warning On Ubuntu, install or upgrade via:)
|
||||||
|
$(warning )
|
||||||
|
$(warning sudo add-apt-repository ppa:george-edison55/cmake-3.x -y)
|
||||||
|
$(warning sudo apt-get update)
|
||||||
|
$(warning sudo apt-get install cmake)
|
||||||
|
$(warning )
|
||||||
|
$(error Fatal)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Help
|
# Help
|
||||||
|
|||||||
14
Tools/check_cmake.sh
Executable file
14
Tools/check_cmake.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
cmake_ver=`cmake --version`
|
||||||
|
|
||||||
|
if [[ $cmake_ver == "" ]]
|
||||||
|
then
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $cmake_ver == *"2.8"* ]] || [[ $cmake_ver == *"2.9"* ]] || [[ $cmake_ver == *"3.0"* ]] || [[ $cmake_ver == *"3.1"* ]]
|
||||||
|
then
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0;
|
||||||
Reference in New Issue
Block a user