rurban / smhasher

Hash function quality and speed tests
https://rurban.github.io/smhasher/
Other
1.85k stars 178 forks source link

Building on CMake 3.5.1 fails due to policy CMP0066 #33

Closed mebeim closed 7 years ago

mebeim commented 7 years ago

As mentioned in the title, the build fails with CMake 3.5.1 due to the CMP0066 policy (CMakeLists.txt:17), which was introduced in CMake 3.7. I assume that this will also cause the build to fail on any 3.x < 3.7 version since that the only check you are doing is IF (CMAKE_MAJOR_VERSION GREATER 2). You should check for major version >= 3 and minor version >= 7 before setting the policy. The same goes for the policy CMP0065 (introduced in version 3.4) and policy CMP00056 (introduced in version 3.2).

Here is the output from CMake 3.5.1 I get on my computer:

marco:~/prog/github/smhasher$ mkdir build && cd build
marco:~/prog/github/smhasher/build$ cmake ..
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:17 (cmake_policy):
  Policy "CMP0066" is not known to this version of CMake.

-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Configuring incomplete, errors occurred!
See also "/home/marco/prog/github/smhasher/build/CMakeFiles/CMakeOutput.log".
See also "/home/marco/prog/github/smhasher/build/CMakeFiles/CMakeError.log".
rurban commented 7 years ago

Thanks. Care for a patch?

mebeim commented 7 years ago

Sorry, would have patched it myself but didn't have time today. Looks like you were faster than me, keep up the good work!