vitalif / grive2

Google Drive client with support for new Drive REST API and partial sync
http://yourcmc.ru/wiki/Grive2
GNU General Public License v2.0
1.52k stars 141 forks source link

CMake error according to policy CMP0004 #370

Closed Simbi0z closed 1 year ago

Simbi0z commented 2 years ago
-- Found libgcrypt: fgrep: warning: fgrep is obsolescent; using grep -F
fgrep: warning: fgrep is obsolescent; using grep -F
-lgcrypt -lgpg-error
-- Found Boost: /usr/lib64/cmake/Boost-1.79.0/BoostConfig.cmake (found suitable version "1.79.0", minimum required is "1.40.0") found components: program_options filesystem unit_test_framework regex system 
-- Found libbfd: /usr/lib/libbfd.so
-- Found CppUnit: /usr/lib/libcppunit.so
-- Found libiberty: /usr/lib/libiberty.a
-- Building unitary tests along with the library and the binary
-- Found Boost: /usr/lib64/cmake/Boost-1.79.0/BoostConfig.cmake (found version "1.79.0") found components: program_options 
-- Configuring done
CMake Warning:
  Value of grive_LIB_DEPENDS contained a newline; truncating

CMake Error at libgrive/CMakeLists.txt:75 (add_library):
  Target "grive" links to item " using grep -F

  fgrep: warning: fgrep is obsolescent" which has leading or trailing
  whitespace.  This is now an error according to policy CMP0004.

CMake Error at libgrive/CMakeLists.txt:75 (add_library):
  Target "grive" links to item " using grep -F

  -lgcrypt -lgpg-error" which has leading or trailing whitespace.  This is
  now an error according to policy CMP0004.

cmake --version cmake version 3.24.2

eric-minassian commented 2 years ago

Seems to be an issue where fgrep is used in the source code and as of grep 3.8, fgrep raises a warning which is what I believe is causing this issue. My fix was to just downgrade to grep 3.7 and build the program, then upgrade. Not a proper fix but it works.

Simbi0z commented 2 years ago

Seems to be an issue where fgrep is used in the source code

However grep -r fgrep does not show any results.

eric-minassian commented 2 years ago

However grep -r fgrep does not show any results.

Yes you are correct. I'm not to sure where the issue is coming from, but I know it has to do with fgrep throwing a warning ever since grep 3.8. I'm not too familiar but the solution that worked for me was to downgrade grep to 3.7, build grive2, then update back to grep 3.8.

jasper1378 commented 2 years ago

Seems like it might actually a bug in libgcrypt-config. Take a look a this gentoo bug report: https://bugs.gentoo.org/868384

davama commented 1 year ago

Can confirm that downgrading grep made it work.

You can download 3.7 from here: https://www.gnu.org/software/grep/