[CMake] problems when upgrading to Xcode v5

Jeff Schenck Jeff.Schenck at dts.com
Wed Oct 2 14:42:16 EDT 2013


Hello,

I recently upgraded to Xcode v5 on Mac OSX and started getting build failures.  Below is a simplified project that produces the same problem, followed by the error message generated by Xcode.  The problem occurs with version v5 but not v4.6.x of Xcode.  I'm running CMake 2.8.10.2.

::::::::::::::::
CMakeLists.txt
::::::::::::::::
cmake_minimum_required ( VERSION 2.8.8 )

project( test )

add_library( a_obj OBJECT t1.c t2.c )
add_library( b_obj OBJECT t3.c t4.c )

add_library( a dummy.c $<TARGET_OBJECTS:a_obj> )
add_library( b dummy.c $<TARGET_OBJECTS:b_obj> )

add_executable( t t.c )
target_link_libraries( t a b )


::::::::::::::
t.c
::::::::::::::
#include <stdio.h>

int func1( int a );
int func2( int a );
int func3( int a );
int func4( int a );

int main()
{
    int a = 100;
    printf( "%d %d %d %d %d\n", a, func1(a), func2(a), func3(a), func4(a) );
    return 0;
}


::::::::::::::
t1.c
::::::::::::::
int func1( int a )
{
    return a*1;
}


::::::::::::::
t2.c
::::::::::::::
int func2( int a )
{
    return a*2;
}


::::::::::::::
t3.c
::::::::::::::
int func3( int a )
{
    return a*3;
}


::::::::::::::
t4.c
::::::::::::::
int func4( int a )
{
    return a*4;
}


dummy.c is empty


When I run CMake, no errors; running xcodebuild gives:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Users/jschenck/TestBuild/test.build/Release/a_obj.build/Objects-normal/undefined_arch/t1.o (No such file or directory)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Users/jschenck/TestBuild/test.build/Release/a_obj.build/Objects-normal/undefined_arch/t2.o (No such file or directory)
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool failed with exit code 1


The .o files can instead be found here:

$ find . -name t1.o
./test.build/Release/a_obj.build/Objects-normal/x86_64/t1.o


Thanks for your help.  (Sorry for not running this on the latest version of CMake, but I rolled back Xcode to an earlier version and now will have a hard time reproducing it.  If necessary, I can "upgrade" again.)

Regards,
Jeff Schenck


________________________________

Notice:
This message and any included attachments are intended only for the use of the addressee, and may contain information that is privileged or confidential. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please destroy the original message and any copies or printouts hereof.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20131002/3476c84e/attachment-0001.htm>


More information about the CMake mailing list