[CMake] Cross compile + shared libs problem
Alexander Neundorf
a.neundorf-work at gmx.net
Mon Mar 24 20:19:52 EDT 2008
On Tuesday 25 March 2008, Frederik Deweerdt wrote:
> Hi,
>
> I'm trying to cross-compile static libraries for RTEMS. Our project's
> also targets Linux, where we use shared libraries. We declare the
> libraries with: add_library(libname srcs...). So STATIC or SHARED is
> omitted.
> On RTEMS there are no static libraries, so I was expecting that by
> setting BUILD_SHARED_LIBS to OFF in the toolchain file, I would get
> static libraries.
Does this value end up in the cache ?
Is it still OFF in the cmake files of your application ?
In Modules/Platform/ you can find an eCos.cmake. eCos is in general quite
similar to RTEMS (also RTOS, also one address space, also no shared libs,
etc.). It contains:
# eCos doesn't support shared libs
SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
SET(CMAKE_CXX_LINK_SHARED_LIBRARY )
SET(CMAKE_CXX_LINK_MODULE_LIBRARY )
SET(CMAKE_C_LINK_SHARED_LIBRARY )
SET(CMAKE_C_LINK_MODULE_LIBRARY )
You should also create a RTEMS.cmake (if you haven't done so yet) and use
these settings there. If you have problems with this let me know.
I'd really be happy to add that to cmake cvs.
Alex
More information about the CMake
mailing list