invitation: try compiling kdelibs using cmake

William A. Hoffman billlist at nycap.rr.com
Fri Jan 27 23:30:31 CET 2006


At 05:24 PM 1/27/2006, Benjamin Reed wrote:
>On 1/27/06, Alexander Neundorf <neundorf at kde.org> wrote:
>
>> Can you please commit these changes to svn ?
>
>done.
>
>Ran into another issue while building stuff, it should probably be
>handled at the cmake level itself, but for now I'm definining it in
>flags in the FindKDE4.cmake...
>
>First, does cmake have an equivalent to libtool's -no-undefined?  ie,
>kde has some places where they can say, in the LDFLAGS for a target,
>"this library should build without any missing or indirect symbols".
>
>Second, I would like to set some options based on the OS version; for
>example, the apple linker behaves differently depending on the
>MACOSX_DEPLOYMENT_TARGET environment variable.  I'd like to set it
>based on the OS (ie, if you're building on 10.2.9, set it to 10.2, if
>you're building on 10.3.2, set it to 10.3, etc.) and then depending on
>that number, also add options to the LDFLAGS like "-undefined
>dynamic_lookup" or "-flat_namespace" and so on.  I tried:
>
>  SET(ENV{MACOSX_DEPLOYMENT_TARGET} 10.3)
>
>...just as a stopgap for now, but it didn't seem to take effect during
>the linker stage, it still complained that I was using options that
>are not available for 10.1 (the default when the env var isn't set).
>_________________________

Since cmake generates makefiles, the environment variables set in a cmakefile
are not available at compile time.  That would have to be in the users
environment.   In VTK, we handle the flat_namespace issue like this:

IF(APPLE)
  SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -Wl,-flat_namespace,-U,_environ")
  SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -Wl,-flat_namespace,-U,_environ")
ENDIF(APPLE) 

-Bill



More information about the Kde-buildsystem mailing list