noloader / cryptopp-cmake

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

can not build static lib with Xcode generator #6

Closed beemaster closed 2 years ago

beemaster commented 6 years ago
mkdir cryptopp-build
cd cryptopp-build
cmake ../cryptopp-CRYPTOPP_7_0_0 -G Xcode

When I build cryptopp-static target, there is no libcryptopp.a file. Because of this:

echo "Depend check for xcode"
Depend check for xcode
cd /Users/beemaster/dev/test/cryptopp-build && make -C /Users/beemaster/dev/test/cryptopp-build -f /Users/beemaster/dev/test/cryptopp-build/CMakeScripts/XCODE_DEPEND_HELPER.make PostBuild.cryptopp-object.Debug
/bin/rm -f /Users/beemaster/dev/test/cryptopp-build/Debug/libcryptopp.dylib
/bin/rm -f /Users/beemaster/dev/test/cryptopp-build/Debug/libcryptopp.a

Looked inside XCODE_DEPEND_HELPER.make

# Rules to remove targets that are older than anything to which they
# link.  This forces Xcode to relink the targets from scratch.  It
# does not seem to check these dependencies itself.
PostBuild.cryptest.Debug:
PostBuild.cryptopp-static.Debug: /Users/beemaster/dev/test/cryptopp-build/Debug/cryptest.exe
/Users/beemaster/dev/test/cryptopp-build/Debug/cryptest.exe:\
    /Users/beemaster/dev/test/cryptopp-build/Debug/libcryptopp.a
    /bin/rm -f /Users/beemaster/dev/test/cryptopp-build/Debug/cryptest.exe

PostBuild.cryptopp-object.Debug:
PostBuild.cryptopp-shared.Debug:
PostBuild.cryptopp-object.Debug: /Users/beemaster/dev/test/cryptopp-build/Debug/libcryptopp.dylib
/Users/beemaster/dev/test/cryptopp-build/Debug/libcryptopp.dylib:\
    /Users/beemaster/dev/test/cryptopp-build/cryptopp.build/Debug/cryptopp-object.build/Objects-normal/libcryptopp-object.a
    /bin/rm -f /Users/beemaster/dev/test/cryptopp-build/Debug/libcryptopp.dylib

PostBuild.cryptopp-static.Debug:
PostBuild.cryptopp-object.Debug: /Users/beemaster/dev/test/cryptopp-build/Debug/libcryptopp.a
/Users/beemaster/dev/test/cryptopp-build/Debug/libcryptopp.a:\
    /Users/beemaster/dev/test/cryptopp-build/cryptopp.build/Debug/cryptopp-object.build/Objects-normal/libcryptopp-object.a
    /bin/rm -f /Users/beemaster/dev/test/cryptopp-build/Debug/libcryptopp.a

Any idea why cmake generated such a stupid postbuild?

noloader commented 6 years ago

Yeah, we have seen this (or similar) problem in the past. CMake is broke when it comes to the Xcode generator.

Can you file a bug against CMake?

noloader commented 2 years ago

Also see GH #56. I checked-in Michael's fix at Commit f56dba1082bf.