[Bf-committers] cmake vs scons
Paul Fitzpatrick
paulfitz at alum.mit.edu
Fri Jan 15 02:20:09 CET 2010
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.
> 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 think we should move to including libs and start blender with a
> shell script, also since some libraries make it fairly hard to static
> link with them (no option to build static by default for eg.)
> Nevertheless We can probably get cmake to link statically link libraries too.
>
> On Fri, Jan 15, 2010 at 1:17 AM, Ken Hughes<khughes at pacific.edu> wrote:
>
>> Since this discussion has come up, I've been trying cmake to see what it
>> does. I admit I used to use make for projects all the time, but as my
>> code time has wained and I've only been working with Blender, I've been
>> using scons exclusively and have forgotten how to do many thing using make.
>>
>> Having said that, I was able to get blender to build today using cmake.
>> It has a little bit of a leaning curve, but then again so did scons when
>> I started working with it. One thing I haven't figured out yet is the
>> equivalent of "scons BF_QUIET=0" for when I want to see exactly what
>> make is telling the compiler to do. I hit the gcc/openmp/fluid bug, but
>> wasn't able to see exactly what was crashing.
>>
>> Another thing; for the linux release builds, lots of libraries have to
>> be linked statically, which you normally don't need to do for your own
>> personal build. But reading through the cmake documentation and
>> CMakeLists.txt, I can't see where we are supporting this. If I'm wrong,
>> then I'd appreciate someone pointing me in the right direction.
>> Otherwise, it's a deal-breaker for me.
>>
>> Ken
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-committers
>>
>>
>
>
>
More information about the Bf-committers
mailing list