[CMake] Object library doesn't work with CMake 2.8.10.2 Xcode generator
Bin Chen
Bin.Chen at dts.com
Thu Jan 3 15:56:50 EST 2013
Following CMakeLists.txt doesn't work with Xcode (4.5.2). Is there anyone experienced the same? Thanks!
Visual Studio 10 and Linux makefile works fine.
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 $<TARGET_OBJECTS:a_obj> )
add_library( b $<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;
}
Best regards,
Bin Chen
________________________________
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/20130103/7d7f132f/attachment-0001.htm>
More information about the CMake
mailing list