aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaweł Bylica <chfast@gmail.com>2018-07-24 23:07:11 +0800
committerPaweł Bylica <chfast@gmail.com>2018-07-24 23:07:11 +0800
commit1a64dd1d71d0f75becaccc44ad3cd68a45bef510 (patch)
treeac7ba54bb17bdb9f3ecabaa6dcaeafef1e524a44
parentcfef5ec6b2852fce5c8bad63bde31ede5f2ec2f7 (diff)
downloaddexon-solidity-1a64dd1d71d0f75becaccc44ad3cd68a45bef510.tar
dexon-solidity-1a64dd1d71d0f75becaccc44ad3cd68a45bef510.tar.gz
dexon-solidity-1a64dd1d71d0f75becaccc44ad3cd68a45bef510.tar.bz2
dexon-solidity-1a64dd1d71d0f75becaccc44ad3cd68a45bef510.tar.lz
dexon-solidity-1a64dd1d71d0f75becaccc44ad3cd68a45bef510.tar.xz
dexon-solidity-1a64dd1d71d0f75becaccc44ad3cd68a45bef510.tar.zst
dexon-solidity-1a64dd1d71d0f75becaccc44ad3cd68a45bef510.zip
CMake: Better policy availability checking
It's better to use if(POLICY ...) and we don't have to check for CMake 3.0 because this is the minimal required version.
-rw-r--r--cmake/EthPolicy.cmake19
1 files changed, 6 insertions, 13 deletions
diff --git a/cmake/EthPolicy.cmake b/cmake/EthPolicy.cmake
index 7a0b2335..4e29898c 100644
--- a/cmake/EthPolicy.cmake
+++ b/cmake/EthPolicy.cmake
@@ -4,23 +4,16 @@ macro (eth_policy)
# link_directories() treats paths relative to the source dir.
cmake_policy(SET CMP0015 NEW)
- if (${CMAKE_VERSION} VERSION_GREATER 3.0)
+ # Avoid warnings in CMake 3.0.2:
+ cmake_policy(SET CMP0042 NEW)
+ cmake_policy(SET CMP0043 NEW)
- # Avoid warnings in CMake 3.0.2:
- cmake_policy(SET CMP0042 NEW)
- cmake_policy(SET CMP0043 NEW)
+ # allow VERSION argument in project()
+ cmake_policy(SET CMP0048 NEW)
- # allow VERSION argument in project()
- cmake_policy(SET CMP0048 NEW)
-
- endif()
-
- if (${CMAKE_VERSION} VERSION_GREATER 3.1)
-
+ if (POLICY CMP0054)
# do not interpret if() arguments as variables!
cmake_policy(SET CMP0054 NEW)
-
endif()
-
endmacro()