- 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.
This commit is contained in:
Campbell Barton 2011-09-14 01:02:57 +00:00
parent 1741269d30
commit 21253def7c
3 changed files with 69 additions and 87 deletions

@ -119,8 +119,8 @@ FOREACH(COMPONENT ${_opencollada_FIND_STATIC_COMPONENTS})
# Ubuntu ppa needs this. # Ubuntu ppa needs this.
lib64/opencollada lib/opencollada lib64/opencollada lib/opencollada
) )
MARK_AS_ADVANCED(OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY)
IF(OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY) IF(OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY)
MARK_AS_ADVANCED(OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY)
LIST(APPEND _opencollada_LIBRARIES "${OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY}") LIST(APPEND _opencollada_LIBRARIES "${OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY}")
ENDIF() ENDIF()
ENDFOREACH() ENDFOREACH()

@ -1,88 +1,68 @@
# - Try to find XML2 # - Find XML2 library
# Once done this will define # Find the native XML2 includes and library
# # This module defines
# XML2_FOUND - system has XML2 # XML2_INCLUDE_DIRS, where to find xml2.h, Set when
# XML2_INCLUDE_DIRS - the XML2 include directory # XML2_INCLUDE_DIR is found.
# XML2_LIBRARIES - Link these to use XML2 # XML2_LIBRARIES, libraries to link against to use XML2.
# XML2_DEFINITIONS - Compiler switches required for using XML2 # XML2_ROOT_DIR, The base directory to search for XML2.
# # This can also be an environment variable.
# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org> # XML2_FOUND, If false, do not try to use XML2.
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# #
# also defined, but not for general use are
# XML2_LIBRARY, where to find the XML2 library.
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# 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_LIBRARIES AND XML2_INCLUDE_DIRS) # If XML2_ROOT_DIR was defined in the environment, use it.
# in cache already IF(NOT XML2_ROOT_DIR AND NOT $ENV{XML2_ROOT_DIR} STREQUAL "")
set(XML2_FOUND TRUE) SET(XML2_ROOT_DIR $ENV{XML2_ROOT_DIR})
else (XML2_LIBRARIES AND XML2_INCLUDE_DIRS) ENDIF()
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls SET(_xml2_SEARCH_DIRS
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) ${XML2_ROOT_DIR}
include(UsePkgConfig) /usr/local
pkgconfig(libxml-2.0 _XML2_INCLUDEDIR _XML2_LIBDIR _XML2_LDFLAGS _XML2_CFLAGS) /sw # Fink
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) /opt/local # DarwinPorts
find_package(PkgConfig) /opt/csw # Blastwave
if (PKG_CONFIG_FOUND) )
pkg_check_modules(_XML2 libxml-2.0)
endif (PKG_CONFIG_FOUND) FIND_PATH(XML2_INCLUDE_DIR libxml2/libxml/xpath.h
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) HINTS
find_path(XML2_INCLUDE_DIR ${_xml2_SEARCH_DIRS}
NAMES PATH_SUFFIXES
libxml/xpath.h include
PATHS )
${_XML2_INCLUDEDIR}
/usr/include FIND_LIBRARY(XML2_LIBRARY
/usr/local/include NAMES
/opt/local/include xml2
/sw/include HINTS
PATH_SUFFIXES ${_xml2_SEARCH_DIRS}
libxml2 PATH_SUFFIXES
lib64 lib
) )
find_library(XML2_LIBRARY # handle the QUIETLY and REQUIRED arguments and set XML2_FOUND to TRUE if
NAMES # all listed variables are TRUE
xml2 INCLUDE(FindPackageHandleStandardArgs)
PATHS FIND_PACKAGE_HANDLE_STANDARD_ARGS(XML2 DEFAULT_MSG
${_XML2_LIBDIR} XML2_LIBRARY XML2_INCLUDE_DIR)
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
if (XML2_LIBRARY) IF(XML2_FOUND)
set(XML2_FOUND TRUE) SET(XML2_LIBRARIES ${XML2_LIBRARY})
endif (XML2_LIBRARY) SET(XML2_INCLUDE_DIRS ${XML2_INCLUDE_DIR})
ENDIF(XML2_FOUND)
set(XML2_INCLUDE_DIRS
${XML2_INCLUDE_DIR}
)
if (XML2_FOUND)
set(XML2_LIBRARIES
${XML2_LIBRARIES}
${XML2_LIBRARY}
)
endif (XML2_FOUND)
if (XML2_INCLUDE_DIRS AND XML2_LIBRARIES)
set(XML2_FOUND TRUE)
endif (XML2_INCLUDE_DIRS AND XML2_LIBRARIES)
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
)

@ -712,7 +712,12 @@ add_dependencies(blender makesdna)
get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS) 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) if(WITH_MOD_FLUID)
list(APPEND BLENDER_LINK_LIBS bf_intern_elbeem) list(APPEND BLENDER_LINK_LIBS bf_intern_elbeem)
@ -797,8 +802,8 @@ endif()
bf_intern_smoke bf_intern_smoke
extern_minilzo extern_minilzo
extern_lzma extern_lzma
extern_recastnavigation
ge_logic_ketsji ge_logic_ketsji
extern_recastnavigation
ge_phys_common ge_phys_common
ge_logic ge_logic
ge_rasterizer ge_rasterizer
@ -806,7 +811,6 @@ endif()
ge_logic_expressions ge_logic_expressions
ge_scenegraph ge_scenegraph
ge_logic_network ge_logic_network
bf_python # duplicate for BPY_driver_exec
ge_logic_ngnetwork ge_logic_ngnetwork
extern_bullet extern_bullet
ge_logic_loopbacknetwork ge_logic_loopbacknetwork
@ -819,8 +823,6 @@ endif()
bf_blenfont bf_blenfont
bf_intern_audaspace bf_intern_audaspace
bf_intern_mikktspace bf_intern_mikktspace
extern_recastnavigation
bf_editor_util # --- BAD LEVEL CALL HERE --- XXX, this should be removed before release!
) )
if(WITH_MOD_CLOTH_ELTOPO) if(WITH_MOD_CLOTH_ELTOPO)