Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile fails with Xcode CMake generator #728

Closed
jasonhorsburgh opened this issue Dec 26, 2015 · 2 comments
Closed

Compile fails with Xcode CMake generator #728

jasonhorsburgh opened this issue Dec 26, 2015 · 2 comments

Comments

@jasonhorsburgh
Copy link

If I'm using the Xcode generator when building assimp I will get a compile failure trying to link against the gtest library due to the file being in the wrong location.

I believe the issue is caused by the fact that Xcode puts the built libraries into a folder with the configuration name (similar to MSVC) whereas assimp is expecting them to be placed in the root build folder.
What I suspect to be the offending code:
AddGTest.cmake

if (MSVC)
  set(RELEASE_LIB_DIR ReleaseLibs)
  set(DEBUG_LIB_DIR DebugLibs)
else()
  set(RELEASE_LIB_DIR "")
  set(DEBUG_LIB_DIR "")
endif()

I think that this can be fixed by testing to see if XCODE_VERSION is set and setting the appropriate directories but I'm not sure what else would need to change.

OS X version: 10.11.2
Xcode version: 7.2
CMake version: 3.3.2

Xcode error output from cmake -G Xcode .. && cmake --build .

Ld build/test/Debug/unit normal x86_64
cd /tmp/assimp
export MACOSX_DEPLOYMENT_TARGET=10.11
/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.11.sdk -L/tmp/assimp/build/test/Debug -L/tmp/assimp/build/test/gtest/src/gtest-build/Debug -L/tmp/assimp/build/test/gtest/src/gtest-build -L/tmp/assimp/build/Debug -L/tmp/assimp/build -F/tmp/assimp/build/test/Debug -filelist /tmp/assimp/build/test/Assimp.build/Debug/unit.build/Objects-normal/x86_64/unit.LinkFileList -Xlinker -rpath -Xlinker /tmp/assimp/build/test/gtest/src/gtest-build -Xlinker -rpath -Xlinker /tmp/assimp/build -mmacosx-version-min=10.11 -Wl,-search_paths_first -Wl,-headerpad_max_install_names /tmp/assimp/build/code/Debug/libassimpd.3.2.0.dylib /tmp/assimp/build/test/gtest/src/gtest-build//libgtest.a /usr/lib/libz.dylib -Xlinker -dependency_info -Xlinker /tmp/assimp/build/test/Assimp.build/Debug/unit.build/Objects-normal/x86_64/unit_dependency_info.dat -o /tmp/assimp/build/test/Debug/unit
clang: error: no such file or directory: '/tmp/assimp/build/test/gtest/src/gtest-build//libgtest.a'

kimkulling added a commit that referenced this issue Dec 26, 2015
@kimkulling
Copy link
Member

Thank you very much for the hint. I tried to fix it. Please try it again with the latest master and give some feedback. Unfortunately I don't have any mac-systems to test the cmake-environment there.

@kimkulling
Copy link
Member

When the issue still exists please just open the issue again.

Thanks a lot!
Kimmi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants