[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36837] trunk/blender: CMake changes

Campbell Barton ideasman42 at gmail.com
Sun Jun 26 08:06:15 CEST 2011


corrected r37819, now checks for symlinks too.

On Sun, Jun 26, 2011 at 5:35 AM, Mitchell Stokes <mogurijin at gmail.com> wrote:
> It looks like replacing:
>
> if(NOT IS_DIRECTORY "${LIBDIR}")
>
> with
>
> if(NOT EXISTS "${LIBDIR}/")
>
> Allows the check to pass if a symlink is used. I'm not sure if this is
> really "correct" though.
>
> Cheers,
> Mitchell
>
>
> On Sat, Jun 25, 2011 at 10:30 PM, Mitchell Stokes <mogurijin at gmail.com> wrote:
>> This commit seems to break setups where the lib directories are
>> reached with a symlink. My blender/../lib is a symlink to the
>> directory where I actually keep my libs so I can avoid multiple lib
>> checkouts, but still organize my working copies the way I want. If I
>> comment out the check, things build just fine, so the symlink is
>> working properly. I just don't know if IS_DIRECTORY can correctly
>> follow it.
>>
>> Operating System: Windows 7 Pro 64bit
>> Compiler: MSVC 2010
>>
>> Cheers,
>> Mitchell
>>
>> On Mon, May 23, 2011 at 7:56 AM, Campbell Barton <ideasman42 at gmail.com> wrote:
>>> Revision: 36837
>>>          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36837
>>> Author:   campbellbarton
>>> Date:     2011-05-23 14:56:14 +0000 (Mon, 23 May 2011)
>>> Log Message:
>>> -----------
>>> CMake changes
>>> - don't allow building if the LIBDIR is not found on mac/windows.
>>> - by default use -O2 rather then -O3 for GCC release flags, was crashing some GCC versions and blender releases are supposed to use -O2.
>>>
>>> Modified Paths:
>>> --------------
>>>    trunk/blender/CMakeLists.txt
>>>    trunk/blender/build_files/cmake/macros.cmake
>>>
>>> Modified: trunk/blender/CMakeLists.txt
>>> ===================================================================
>>> --- trunk/blender/CMakeLists.txt        2011-05-23 14:51:31 UTC (rev 36836)
>>> +++ trunk/blender/CMakeLists.txt        2011-05-23 14:56:14 UTC (rev 36837)
>>> @@ -55,33 +55,19 @@
>>>  # quiet output for Makefiles, 'make -s' helps too
>>>  # set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
>>>
>>> -# ignore system set flag, use our own
>>> -# must be before project(...)
>>> -# if the user wants to add their own its ok after first run.
>>> -if(DEFINED CMAKE_C_STANDARD_LIBRARIES)
>>> -       set(_reset_standard_libraries OFF)
>>> -else()
>>> -       set(_reset_standard_libraries ON)
>>> -endif()
>>> +#-----------------------------------------------------------------------------
>>> +# Load some macros.
>>> +include(build_files/cmake/macros.cmake)
>>>
>>>
>>> -project(Blender)
>>> +#-----------------------------------------------------------------------------
>>> +# Initialize project.
>>>
>>> +blender_project_hack_pre()
>>>
>>> -if (_reset_standard_libraries)
>>> -       # Must come after project(...)
>>> -       #
>>> -       # MINGW workaround for -ladvapi32 being included which surprisingly causes
>>> -       # string formatting of floats, eg: printf("%.*f", 3, value). to crash blender
>>> -       # with a meaningless stack trace. by overriding this flag we ensure we only
>>> -       # have libs we define and that cmake & scons builds match.
>>> -       set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
>>> -       set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
>>> -       mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
>>> -       mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
>>> -endif()
>>> -unset(_reset_standard_libraries)
>>> +project(Blender)
>>>
>>> +blender_project_hack_post()
>>>
>>>  enable_testing()
>>>
>>> @@ -92,10 +78,6 @@
>>>  set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE )
>>>
>>>  #-----------------------------------------------------------------------------
>>> -# Load some macros.
>>> -include(build_files/cmake/macros.cmake)
>>> -
>>> -#-----------------------------------------------------------------------------
>>>  # Set default config options
>>>
>>>  get_blender_version()
>>> @@ -984,6 +966,12 @@
>>>  #-----------------------------------------------------------------------------
>>>  # Common.
>>>
>>> +if(APPLE OR WIN32)
>>> +       if(NOT IS_DIRECTORY "${LIBDIR}")
>>> +               message(FATAL_ERROR "Apple and Windows require pre-compiled libs at: '${LIBDIR}'")
>>> +       endif()
>>> +endif()
>>> +
>>>  if(WITH_RAYOPTIMIZATION)
>>>        if(CMAKE_COMPILER_IS_GNUCC)
>>>                if(SUPPORT_SSE_BUILD)
>>>
>>> Modified: trunk/blender/build_files/cmake/macros.cmake
>>> ===================================================================
>>> --- trunk/blender/build_files/cmake/macros.cmake        2011-05-23 14:51:31 UTC (rev 36836)
>>> +++ trunk/blender/build_files/cmake/macros.cmake        2011-05-23 14:56:14 UTC (rev 36837)
>>> @@ -388,3 +388,71 @@
>>>
>>>        # message(STATUS "Version (Internal): ${BLENDER_VERSION}.${BLENDER_SUBVERSION}, Version (external): ${BLENDER_VERSION}${BLENDER_VERSION_CHAR}-${BLENDER_VERSION_CYCLE}")
>>>  endmacro()
>>> +
>>> +
>>> +# hacks to override initial project settings
>>> +# these macros must be called directly before/after project(Blender)
>>> +macro(blender_project_hack_pre)
>>> +       # ----------------
>>> +       # MINGW HACK START
>>> +       # ignore system set flag, use our own
>>> +       # must be before project(...)
>>> +       # if the user wants to add their own its ok after first run.
>>> +       if(DEFINED CMAKE_C_STANDARD_LIBRARIES)
>>> +               set(_reset_standard_libraries OFF)
>>> +       else()
>>> +               set(_reset_standard_libraries ON)
>>> +       endif()
>>> +
>>> +       # ------------------
>>> +       # GCC -O3 HACK START
>>> +       # needed because O3 can cause problems but
>>> +       # allow the builder to set O3 manually after.
>>> +       if(DEFINED CMAKE_C_FLAGS_RELEASE)
>>> +               set(_reset_standard_cflags_rel OFF)
>>> +       else()
>>> +               set(_reset_standard_cflags_rel ON)
>>> +       endif()
>>> +       if(DEFINED CMAKE_CXX_FLAGS_RELEASE)
>>> +               set(_reset_standard_cxxflags_rel OFF)
>>> +       else()
>>> +               set(_reset_standard_cxxflags_rel ON)
>>> +       endif()
>>> +endmacro()
>>> +
>>> +
>>> +macro(blender_project_hack_post)
>>> +       # --------------
>>> +       # MINGW HACK END
>>> +       if (_reset_standard_libraries)
>>> +               # Must come after project(...)
>>> +               #
>>> +               # MINGW workaround for -ladvapi32 being included which surprisingly causes
>>> +               # string formatting of floats, eg: printf("%.*f", 3, value). to crash blender
>>> +               # with a meaningless stack trace. by overriding this flag we ensure we only
>>> +               # have libs we define and that cmake & scons builds match.
>>> +               set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
>>> +               set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
>>> +               mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
>>> +               mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
>>> +       endif()
>>> +       unset(_reset_standard_libraries)
>>> +
>>> +
>>> +       # ----------------
>>> +       # GCC -O3 HACK END
>>> +       if(_reset_standard_cflags_rel)
>>> +               string(REGEX REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
>>> +               set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "" FORCE)
>>> +               mark_as_advanced(CMAKE_C_FLAGS_RELEASE)
>>> +       endif()
>>> +
>>> +       if(_reset_standard_cxxflags_rel)
>>> +               string(REGEX REPLACE "-O3" "-O2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
>>> +               set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "" FORCE)
>>> +               mark_as_advanced(CMAKE_CXX_FLAGS_RELEASE)
>>> +       endif()
>>> +
>>> +       unset(_reset_standard_cflags_rel)
>>> +       unset(_reset_standard_cxxflags_rel)
>>> +endmacro()
>>>
>>> _______________________________________________
>>> Bf-blender-cvs mailing list
>>> Bf-blender-cvs at blender.org
>>> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>>>
>>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
- Campbell


More information about the Bf-committers mailing list