[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40194] trunk/blender: - removed some duplicate library links from cmake ( which were needed because of bad level calls)

Campbell Barton ideasman42 at gmail.com
Wed Sep 14 03:03:02 CEST 2011


Revision: 40194
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40194
Author:   campbellbarton
Date:     2011-09-14 01:02:57 +0000 (Wed, 14 Sep 2011)
Log Message:
-----------
- removed some duplicate library links from cmake (which were needed because of bad level calls)
- FindXML2 we had copied from another project was always running and not using cached value, rewrote based on template used for most of our other find modules which makes use of 'FindPackageHandleStandardArgs'
- mark statuc collada libs as advanced.

Modified Paths:
--------------
    trunk/blender/build_files/cmake/Modules/FindOpenCOLLADA.cmake
    trunk/blender/build_files/cmake/Modules/FindXML2.cmake
    trunk/blender/source/creator/CMakeLists.txt

Modified: trunk/blender/build_files/cmake/Modules/FindOpenCOLLADA.cmake
===================================================================
--- trunk/blender/build_files/cmake/Modules/FindOpenCOLLADA.cmake	2011-09-14 00:37:27 UTC (rev 40193)
+++ trunk/blender/build_files/cmake/Modules/FindOpenCOLLADA.cmake	2011-09-14 01:02:57 UTC (rev 40194)
@@ -119,8 +119,8 @@
       # Ubuntu ppa needs this.
       lib64/opencollada lib/opencollada
     )
+  MARK_AS_ADVANCED(OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY)
   IF(OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY)
-    MARK_AS_ADVANCED(OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY)
     LIST(APPEND _opencollada_LIBRARIES "${OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY}")
   ENDIF()
 ENDFOREACH()

Modified: trunk/blender/build_files/cmake/Modules/FindXML2.cmake
===================================================================
--- trunk/blender/build_files/cmake/Modules/FindXML2.cmake	2011-09-14 00:37:27 UTC (rev 40193)
+++ trunk/blender/build_files/cmake/Modules/FindXML2.cmake	2011-09-14 01:02:57 UTC (rev 40194)
@@ -1,88 +1,68 @@
-# - Try to find XML2
-# Once done this will define
+# - Find XML2 library
+# Find the native XML2 includes and library
+# This module defines
+#  XML2_INCLUDE_DIRS, where to find xml2.h, Set when
+#                     XML2_INCLUDE_DIR is found.
+#  XML2_LIBRARIES, libraries to link against to use XML2.
+#  XML2_ROOT_DIR, The base directory to search for XML2.
+#                 This can also be an environment variable.
+#  XML2_FOUND, If false, do not try to use XML2.
 #
-#  XML2_FOUND - system has XML2
-#  XML2_INCLUDE_DIRS - the XML2 include directory
-#  XML2_LIBRARIES - Link these to use XML2
-#  XML2_DEFINITIONS - Compiler switches required for using XML2
+# also defined, but not for general use are
+#  XML2_LIBRARY, where to find the XML2 library.
+
+#=============================================================================
+# Copyright 2011 Blender Foundation.
 #
-#  Copyright (c) 2008 Andreas Schneider <mail at cynapses.org>
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
 #
-#  Redistribution and use is allowed according to the terms of the New
-#  BSD license.
-#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
 
+# If XML2_ROOT_DIR was defined in the environment, use it.
+IF(NOT XML2_ROOT_DIR AND NOT $ENV{XML2_ROOT_DIR} STREQUAL "")
+  SET(XML2_ROOT_DIR $ENV{XML2_ROOT_DIR})
+ENDIF()
 
-if (XML2_LIBRARIES AND XML2_INCLUDE_DIRS)
-  # in cache already
-  set(XML2_FOUND TRUE)
-else (XML2_LIBRARIES AND XML2_INCLUDE_DIRS)
-  # use pkg-config to get the directories and then use these values
-  # in the FIND_PATH() and FIND_LIBRARY() calls
-  if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-    include(UsePkgConfig)
-    pkgconfig(libxml-2.0 _XML2_INCLUDEDIR _XML2_LIBDIR _XML2_LDFLAGS _XML2_CFLAGS)
-  else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-    find_package(PkgConfig)
-    if (PKG_CONFIG_FOUND)
-      pkg_check_modules(_XML2 libxml-2.0)
-    endif (PKG_CONFIG_FOUND)
-  endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-  find_path(XML2_INCLUDE_DIR
-    NAMES
-      libxml/xpath.h
-    PATHS
-      ${_XML2_INCLUDEDIR}
-      /usr/include
-      /usr/local/include
-      /opt/local/include
-      /sw/include
-    PATH_SUFFIXES
-      libxml2
-  )
+SET(_xml2_SEARCH_DIRS
+  ${XML2_ROOT_DIR}
+  /usr/local
+  /sw # Fink
+  /opt/local # DarwinPorts
+  /opt/csw # Blastwave
+)
 
-  find_library(XML2_LIBRARY
-    NAMES
-      xml2
-    PATHS
-      ${_XML2_LIBDIR}
-      /usr/lib
-      /usr/local/lib
-      /opt/local/lib
-      /sw/lib
-  )
+FIND_PATH(XML2_INCLUDE_DIR libxml2/libxml/xpath.h
+  HINTS
+    ${_xml2_SEARCH_DIRS}
+  PATH_SUFFIXES
+    include
+)
 
-  if (XML2_LIBRARY)
-    set(XML2_FOUND TRUE)
-  endif (XML2_LIBRARY)
-
-  set(XML2_INCLUDE_DIRS
-    ${XML2_INCLUDE_DIR}
+FIND_LIBRARY(XML2_LIBRARY
+  NAMES
+    xml2
+  HINTS
+    ${_xml2_SEARCH_DIRS}
+  PATH_SUFFIXES
+    lib64 lib
   )
 
-  if (XML2_FOUND)
-    set(XML2_LIBRARIES
-      ${XML2_LIBRARIES}
-      ${XML2_LIBRARY}
-    )
-  endif (XML2_FOUND)
+# handle the QUIETLY and REQUIRED arguments and set XML2_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(XML2 DEFAULT_MSG
+    XML2_LIBRARY XML2_INCLUDE_DIR)
 
-  if (XML2_INCLUDE_DIRS AND XML2_LIBRARIES)
-     set(XML2_FOUND TRUE)
-  endif (XML2_INCLUDE_DIRS AND XML2_LIBRARIES)
+IF(XML2_FOUND)
+  SET(XML2_LIBRARIES ${XML2_LIBRARY})
+  SET(XML2_INCLUDE_DIRS ${XML2_INCLUDE_DIR})
+ENDIF(XML2_FOUND)
 
-  if (XML2_FOUND)
-    if (NOT XML2_FIND_QUIETLY)
-      message(STATUS "Found XML2: ${XML2_LIBRARIES}")
-    endif (NOT XML2_FIND_QUIETLY)
-  else (XML2_FOUND)
-    if (XML2_FIND_REQUIRED)
-      message(FATAL_ERROR "Could not find XML2")
-    endif (XML2_FIND_REQUIRED)
-  endif (XML2_FOUND)
-
-  # show the XML2_INCLUDE_DIRS and XML2_LIBRARIES variables only in the advanced view
-  mark_as_advanced(XML2_INCLUDE_DIRS XML2_LIBRARIES)
-
-endif (XML2_LIBRARIES AND XML2_INCLUDE_DIRS)
-
+MARK_AS_ADVANCED(
+  XML2_INCLUDE_DIR
+  XML2_LIBRARY
+)

Modified: trunk/blender/source/creator/CMakeLists.txt
===================================================================
--- trunk/blender/source/creator/CMakeLists.txt	2011-09-14 00:37:27 UTC (rev 40193)
+++ trunk/blender/source/creator/CMakeLists.txt	2011-09-14 01:02:57 UTC (rev 40194)
@@ -712,7 +712,12 @@
 
 get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS)
 
-set(BLENDER_LINK_LIBS bf_nodes ${BLENDER_LINK_LIBS} bf_windowmanager bf_render)
+set(BLENDER_LINK_LIBS
+	bf_nodes
+	${BLENDER_LINK_LIBS}
+	bf_windowmanager
+	bf_render
+)
 
 if(WITH_MOD_FLUID)
 	list(APPEND BLENDER_LINK_LIBS bf_intern_elbeem)
@@ -797,8 +802,8 @@
 		bf_intern_smoke
 		extern_minilzo
 		extern_lzma
+		ge_logic_ketsji
 		extern_recastnavigation
-		ge_logic_ketsji
 		ge_phys_common
 		ge_logic
 		ge_rasterizer
@@ -806,7 +811,6 @@
 		ge_logic_expressions
 		ge_scenegraph
 		ge_logic_network
-		bf_python # duplicate for BPY_driver_exec
 		ge_logic_ngnetwork
 		extern_bullet
 		ge_logic_loopbacknetwork
@@ -819,8 +823,6 @@
 		bf_blenfont
 		bf_intern_audaspace
 		bf_intern_mikktspace
-		extern_recastnavigation
-		bf_editor_util          # --- BAD LEVEL CALL HERE --- XXX, this should be removed before release!
 	)
 
 	if(WITH_MOD_CLOTH_ELTOPO)




More information about the Bf-blender-cvs mailing list