Skip to content

CMake XCode build on macOS fails #374

@romanp-nexusgroup

Description

@romanp-nexusgroup

I am trying to build latest crypto++ with CMake generated XCode project

macOS 10.12.3
XCode 8.2.1
cmake version 3.7.2
mkdir build
cd build
cmake -G Xcode ..
open cryptopp.xcodeproj
build

Getting following error:

echo "Creating symlinks"
Creating symlinks
/usr/local/Cellar/cmake/3.7.2/bin/cmake -E cmake_symlink_library /Users/user1/dev/cryptopp/build/Debug/libcryptopp.5.7.dylib /Users/user1/dev/cryptopp/build/Debug/libcryptopp.5.7.dylib /Users/user1/dev/cryptopp/build/Debug/libcryptopp.dylib
CMake Error: cmake_symlink_library: System Error: No such file or directory

I commented out a part of makefile that sets SOVERSION, this helped

-       if (BUILD_SHARED)
-               set_target_properties(cryptopp-shared
-                               PROPERTIES
-                               SOVERSION ${COMPAT_VERSION}
-                               OUTPUT_NAME cryptopp)
-       endif()
+       #if (BUILD_SHARED)
+       #       set_target_properties(cryptopp-shared
+       #                       PROPERTIES
+       #                       SOVERSION ${COMPAT_VERSION}
+       #                       OUTPUT_NAME cryptopp)
+       #endif()

But not for long, then I got this:

Ld build/Debug/cryptest.exe normal x86_64
    cd /Users/user1/dev/cryptopp
    export MACOSX_DEPLOYMENT_TARGET=10.12
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -L/Users/user1/dev/cryptopp/build/Debug -F/Users/user1/dev/cryptopp/build/Debug -filelist /Users/user1/dev/cryptopp/build/cryptopp.build/Debug/cryptest.build/Objects-normal/x86_64/cryptest.exe.LinkFileList -mmacosx-version-min=10.12 -Xlinker -object_path_lto -Xlinker /Users/user1/dev/cryptopp/build/cryptopp.build/Debug/cryptest.build/Objects-normal/x86_64/cryptest.exe_lto.o -Xlinker -no_deduplicate -march=native /Users/user1/dev/cryptopp/build/Debug/libcryptopp.a -Xlinker -dependency_info -Xlinker /Users/user1/dev/cryptopp/build/cryptopp.build/Debug/cryptest.build/Objects-normal/x86_64/cryptest.exe_dependency_info.dat -o /Users/user1/dev/cryptopp/build/Debug/cryptest.exe

clang: error: no such file or directory: '/Users/user1/dev/cryptopp/build/Debug/libcryptopp.a'

cryptest wants to link to static library and it wants it to be named libcryptopp.a, but XCode thinks otherwise. XCode produces a file build/cryptopp.build/Debug/cryptopp-object.build/Objects-normal/libcryptopp-object.a

At this point I am not sure what I need to change to make it work, the makefile looks too complicated for me

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions