[Bf-committers] cmake vs scons
Ken Hughes
khughes at pacific.edu
Fri Jan 15 02:29:02 CET 2010
Paul Fitzpatrick wrote:
> On 01/14/2010 07:56 PM, Campbell Barton wrote:
>
>> re: output try..
>> make -s
>> or...
>> make VERBOSE=0
>>
>>
>
> That gives quiet output, I think Ken may have wanted the opposite, to
> inhibit quiet output:
> make VERBOSE=1
> This should show the full compile and link commands, rather than just
> the pretty summaries.
>
>
>
Yeah, that was what I wanted.
>> Im not sure about static linking, though even on scons this is a pain,
>>
>>
>
> One way I've done this in the past (for official releases of other
> programs, not blender) is to make a collection of all the libraries I
> wanted linked statically in a subdirectory of my build directory, say
> "static_libs",and then added this at the beginning of the main
> CMakeLists.txt file:
>
> SET (STATLIB "${CMAKE_BINARY_DIR}/static_libs")
> IF (EXISTS ${STATLIB})
> MESSAGE(STATUS "static_libs directory present: ${STATLIB}")
> LINK_DIRECTORIES(${STATLIB})
> FILE(GLOB statlibs ${STATLIB}/*.a)
> LINK_LIBRARIES(${statlibs})
> # Optional: statically link gcc library.
> # Make sure you link libstdc++.a too for C++ code.
> ADD_DEFINITIONS(-static-libgcc)
> SET(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE}
> -static-libgcc")
> ENDIF (EXISTS ${STATLIB})
>
> There's probably a more elegant way, but this seems to work - the static
> versions of the libraries get picked up for linking.
> Cheers,
> Paul
>
I just hacked something to make it find libpng.a, so yeah it's just a
matter of hacking away to get it.
Ken
More information about the Bf-committers
mailing list