[CMake] Object library doesn't work with CMake 2.8.10.2 Xcode generator
David Cole
david.cole at kitware.com
Thu Jan 3 16:26:11 EST 2013
We have a test of OBJECT_LIBRARY that does work on all our dashboards,
including ones running with Xcode.
When you say "it doesn't work" -- what do you mean? Do you get some error
output?
On Thu, Jan 3, 2013 at 3:56 PM, Bin Chen <Bin.Chen at dts.com> wrote:
> 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.
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130103/8f868858/attachment.htm>
More information about the CMake
mailing list