noloader / cryptopp-cmake

CMake files for Crypto++ project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use?

MichaelVoelkel opened this issue · comments

The "how to use" issue did not make sense because it referred to the Crypto++ Wiki page that is prior to the time when this repository was created.

I use macOS Catalina with Xcode11.4.1, have cloned Crypto++ and then used this CMakeLists.txt file. It SEEMS that everything works because the config is created and when I "build" cryptopp-static, it says "successful". But I cannot find any lib/a/binary files in my build folder.

cryptopp-shared does not compile because it directly jumps to creating symlinks and then, clearly, says that it cannot find any dylib.

Any ideas?

@MichaelVoelkel,

Any ideas?

According to Travis CI, the builds are passing for CMake on OS X. Travis tests OS X 10.10/XCode 6.4, OS X 10.13/XCode 9.4 and OS X 10.14/XCode 11.2.

You can find the recipe used for Travis in .travis.yml. The recipe to build using CMake is:

script:
  # CMake is being run from .../cryptopp/cmake_build/ directory
  - cmake -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" ../
  - make -k -j 2 VERBOSE=1
  - ctest --output-on-failure
  - ./cryptest.exe v

The CMake files also tested OK on my Mac Mini with OS X 10.12 and without Xcode.

Maybe the problem is specific to Catalina/OS X 10.15.

If you can't straighten out the CMake problems on your installation, then you might try the GNUmakefile. It should build without problems.

Ping @mouse07410. Uri may have some experience with Catalina/OS X 10.15.

Hi,

I have tried again and the issue seems specific to the Xcode generator. So, having checked out your repository and cd'ed into it, what does not work is:

mkdir build && cd build
cmake -G Xcode ..
cmake --build .

The build of crypttest executable complains about no "libcryptopp.a" file, which is fair because the new Debug subdirectory is empty. If I open the whole xcodeproj file in Xcode and try to build the "libcrypt-static" project, it says "succeeded" immediately but does not create any output.

Any ideas?

Ok, I could pin it down. It seems, Xcode generator is not able to work with intermediate object file outputs. So, disabling them works fine now :)

set(USE_INTERMEDIATE_OBJECTS_TARGET OFF)

This ticket from Xcode could be related to this issue: https://gitlab.kitware.com/cmake/cmake/-/issues/17370

So, all fine and working for me now!

By the way, my use case is somewhat important for everyone who would like to develop in Xcode and use Crypto++ because mixing generators can lead to nasty issues... and the Unix generator does not generate nice project files... Xcode should just be able to work with CMakeLists.txt directly like QtCreator or Visual Studio Code but well...

I checked this in at Commit f56dba1082bf.