Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on CMake 3.5.1 fails due to policy CMP0066 #33

Closed
mebeim opened this issue Jul 10, 2017 · 2 comments
Closed

Building on CMake 3.5.1 fails due to policy CMP0066 #33

mebeim opened this issue Jul 10, 2017 · 2 comments

Comments

@mebeim
Copy link

mebeim commented Jul 10, 2017

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
Copy link
Owner

rurban commented Jul 10, 2017

Thanks. Care for a patch?

@rurban rurban closed this as completed in 3d18d82 Jul 10, 2017
@mebeim
Copy link
Author

mebeim commented Jul 10, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants