Hello Pere,

On 09/03/15 12:59, Pere Mato Vila wrote:
   I am using cmake version 3.1.3 on MacOSX 10.10.2. I want to build a
SHARED  library made exclusively of OBJECT libraries. This works well
with the Makefile generator but fails with the Xcode generator.

   To reproduce the problem is very simple:
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)

add_library(FooObjs OBJECT foo.cxx)
add_library(Foo SHARED $<TARGET_OBJECTS:FooObjs>)
add_executable(FooMain main.cxx)
target_link_libraries(FooMain Foo)


The library libFoo.dylib is never build. I can bypass the problem by
adding a dummy.cxx file to the SHARED library, but I am not convinced
this is the right solution.

It looks like you did everything right:

From http://www.cmake.org/cmake/help/v3.1/command/add_library.html
Some native build systems may not like targets that have only object files, so 
consider adding at least one real source file to any target that references 
$<TARGET_OBJECTS:objlib>.

Thanks,
Gregor
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to