noloader / cryptopp-cmake

CMake files for Crypto++ project
BSD 3-Clause "New" or "Revised" License
92 stars 68 forks source link

Make git optional #100

Closed chausner closed 2 years ago

chausner commented 2 years ago

It appears git is currently mandatory, only to get the git revision: https://github.com/noloader/cryptopp-cmake/blob/db1fa356ce62d03d5883a7deaf23c5d27d21371f/CMakeLists.txt#L23

For git cloning, find_package(Git) is called without the REQUIRE: https://github.com/noloader/cryptopp-cmake/blob/db1fa356ce62d03d5883a7deaf23c5d27d21371f/CMakeLists.txt#L103

I suggest to remove the REQUIRE in the first call to find_package, and set GIT_REV to "0" if git is not available.

abdes commented 2 years ago

I suggest to remove the REQUIRE in the first call to find_package, and set GIT_REV to "0" if git is not available.

The first call should be completely deleted as the check for git is done within the module itself and the fallback behavior is implemented within the module as well.