Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'build_files/cmake/Modules')
-rw-r--r--build_files/cmake/Modules/FindEigen3.cmake56
-rw-r--r--build_files/cmake/Modules/FindLLVM.cmake94
-rw-r--r--build_files/cmake/Modules/FindOpenImageIO.cmake3
-rw-r--r--build_files/cmake/Modules/FindPCRE.cmake1
-rw-r--r--build_files/cmake/Modules/FindPythonLibsUnix.cmake46
5 files changed, 188 insertions, 12 deletions
diff --git a/build_files/cmake/Modules/FindEigen3.cmake b/build_files/cmake/Modules/FindEigen3.cmake
new file mode 100644
index 00000000000..400e8eb047d
--- /dev/null
+++ b/build_files/cmake/Modules/FindEigen3.cmake
@@ -0,0 +1,56 @@
+# - Find Eigen3 library
+# Find the native Eigen3 includes and library
+# This module defines
+# EIGEN3_INCLUDE_DIRS, where to find spnav.h, Set when
+# EIGEN3_INCLUDE_DIR is found.
+# EIGEN3_ROOT_DIR, The base directory to search for Eigen3.
+# This can also be an environment variable.
+# EIGEN3_FOUND, If false, do not try to use Eigen3.
+#
+#=============================================================================
+# Copyright 2015 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 EIGEN3_ROOT_DIR was defined in the environment, use it.
+IF(NOT EIGEN3_ROOT_DIR AND NOT $ENV{EIGEN3_ROOT_DIR} STREQUAL "")
+ SET(EIGEN3_ROOT_DIR $ENV{EIGEN3_ROOT_DIR})
+ENDIF()
+
+SET(_eigen3_SEARCH_DIRS
+ ${EIGEN3_ROOT_DIR}
+ /usr/local
+ /sw # Fink
+ /opt/local # DarwinPorts
+ /opt/csw # Blastwave
+)
+
+FIND_PATH(EIGEN3_INCLUDE_DIR
+ NAMES
+ # header has no '.h' suffix
+ Eigen/Eigen
+ HINTS
+ ${_eigen3_SEARCH_DIRS}
+ PATH_SUFFIXES
+ include/eigen3
+)
+
+# handle the QUIETLY and REQUIRED arguments and set EIGEN3_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Eigen3 DEFAULT_MSG
+ EIGEN3_INCLUDE_DIR)
+
+IF(EIGEN3_FOUND)
+ SET(EIGEN3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
+ENDIF(EIGEN3_FOUND)
+
+MARK_AS_ADVANCED(
+ EIGEN3_INCLUDE_DIR
+)
diff --git a/build_files/cmake/Modules/FindLLVM.cmake b/build_files/cmake/Modules/FindLLVM.cmake
new file mode 100644
index 00000000000..43791c8df8c
--- /dev/null
+++ b/build_files/cmake/Modules/FindLLVM.cmake
@@ -0,0 +1,94 @@
+# - Find LLVM library
+# Find the native LLVM includes and library
+# This module defines
+# LLVM_INCLUDE_DIRS, where to find LLVM.h, Set when LLVM_INCLUDE_DIR is found.
+# LLVM_LIBRARIES, libraries to link against to use LLVM.
+# LLVM_ROOT_DIR, The base directory to search for LLVM.
+# This can also be an environment variable.
+# LLVM_FOUND, If false, do not try to use LLVM.
+#
+# also defined, but not for general use are
+# LLVM_LIBRARY, where to find the LLVM library.
+
+#=============================================================================
+# Copyright 2015 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(LLVM_ROOT_DIR)
+ if(DEFINED LLVM_VERSION)
+ find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION} HINTS ${LLVM_ROOT_DIR}/bin NO_CMAKE_PATH)
+ endif()
+ if(NOT LLVM_CONFIG)
+ find_program(LLVM_CONFIG llvm-config HINTS ${LLVM_ROOT_DIR}/bin NO_CMAKE_PATH)
+ endif()
+else()
+ if(DEFINED LLVM_VERSION)
+ message(running llvm-config-${LLVM_VERSION})
+ find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION})
+ endif()
+ if(NOT LLVM_CONFIG)
+ find_program(LLVM_CONFIG llvm-config)
+ endif()
+endif()
+
+if(NOT DEFINED LLVM_VERSION)
+ execute_process(COMMAND ${LLVM_CONFIG} --version
+ OUTPUT_VARIABLE LLVM_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(LLVM_VERSION ${LLVM_VERSION} CACHE STRING "Version of LLVM to use")
+endif()
+if(NOT LLVM_ROOT_DIR)
+ execute_process(COMMAND ${LLVM_CONFIG} --prefix
+ OUTPUT_VARIABLE LLVM_ROOT_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(LLVM_ROOT_DIR ${LLVM_ROOT_DIR} CACHE PATH "Path to the LLVM installation")
+endif()
+if(NOT LLVM_LIBPATH)
+ execute_process(COMMAND ${LLVM_CONFIG} --libdir
+ OUTPUT_VARIABLE LLVM_LIBPATH
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(LLVM_LIBPATH ${LLVM_LIBPATH} CACHE PATH "Path to the LLVM library path")
+ mark_as_advanced(LLVM_LIBPATH)
+endif()
+
+if(LLVM_STATIC)
+ find_library(LLVM_LIBRARY
+ NAMES LLVMAnalysis # first of a whole bunch of libs to get
+ PATHS ${LLVM_LIBPATH})
+else()
+ find_library(LLVM_LIBRARY
+ NAMES LLVM-${LLVM_VERSION}
+ PATHS ${LLVM_LIBPATH})
+endif()
+
+
+if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
+ if(LLVM_STATIC)
+ # if static LLVM libraries were requested, use llvm-config to generate
+ # the list of what libraries we need, and substitute that in the right
+ # way for LLVM_LIBRARY.
+ execute_process(COMMAND ${LLVM_CONFIG} --libfiles
+ OUTPUT_VARIABLE LLVM_LIBRARY
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ string(REPLACE " " ";" LLVM_LIBRARY "${LLVM_LIBRARY}")
+ endif()
+endif()
+
+
+# handle the QUIETLY and REQUIRED arguments and set SDL2_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LLVM DEFAULT_MSG
+ LLVM_LIBRARY)
+
+MARK_AS_ADVANCED(
+ LLVM_LIBRARY
+)
+
diff --git a/build_files/cmake/Modules/FindOpenImageIO.cmake b/build_files/cmake/Modules/FindOpenImageIO.cmake
index 5e454b6e5cd..789097dfd51 100644
--- a/build_files/cmake/Modules/FindOpenImageIO.cmake
+++ b/build_files/cmake/Modules/FindOpenImageIO.cmake
@@ -59,7 +59,8 @@ FIND_LIBRARY(OPENIMAGEIO_LIBRARY
FIND_FILE(OPENIMAGEIO_IDIFF
NAMES
idiff
- ${OPENIMAGEIO_ROOT_DIR}
+ HINTS
+ ${OPENIMAGEIO_ROOT_DIR}
PATH_SUFFIXES
bin
)
diff --git a/build_files/cmake/Modules/FindPCRE.cmake b/build_files/cmake/Modules/FindPCRE.cmake
index 9d73e9200d9..ff4b7261555 100644
--- a/build_files/cmake/Modules/FindPCRE.cmake
+++ b/build_files/cmake/Modules/FindPCRE.cmake
@@ -40,7 +40,6 @@ FIND_PATH(PCRE_INCLUDE_DIR pcre.h
${_pcre_SEARCH_DIRS}
PATH_SUFFIXES
include
- include
)
FIND_LIBRARY(PCRE_LIBRARY
diff --git a/build_files/cmake/Modules/FindPythonLibsUnix.cmake b/build_files/cmake/Modules/FindPythonLibsUnix.cmake
index 1fb27e7898c..e4236fb4c24 100644
--- a/build_files/cmake/Modules/FindPythonLibsUnix.cmake
+++ b/build_files/cmake/Modules/FindPythonLibsUnix.cmake
@@ -14,6 +14,7 @@
# PYTHON_INCLUDE_CONFIG_DIRS
# PYTHON_LIBRARIES
# PYTHON_LIBPATH, Used for installation
+# PYTHON_SITE_PACKAGES, Used for installation (as a Python module)
# PYTHON_LINKFLAGS
# PYTHON_ROOT_DIR, The base directory to search for Python.
# This can also be an environment variable.
@@ -65,6 +66,14 @@ IF(DEFINED PYTHON_LIBPATH)
SET(_IS_LIB_PATH_DEF ON)
ENDIF()
+STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
+
+SET(_python_SEARCH_DIRS
+ ${PYTHON_ROOT_DIR}
+ "$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
+ "/opt/py${_PYTHON_VERSION_NO_DOTS}"
+ "/opt/lib/python-${PYTHON_VERSION}"
+)
# only search for the dirs if we havn't already
IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_LIB_PATH_DEF))
@@ -74,14 +83,7 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
"dm;dmu;du;d" # debug
)
- STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
- SET(_python_SEARCH_DIRS
- ${PYTHON_ROOT_DIR}
- "$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
- "/opt/py${_PYTHON_VERSION_NO_DOTS}"
- "/opt/lib/python-${PYTHON_VERSION}"
- )
FOREACH(_CURRENT_ABI_FLAGS ${_python_ABI_FLAGS})
#IF(CMAKE_BUILD_TYPE STREQUAL Debug)
@@ -146,6 +148,7 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
ENDIF()
IF(PYTHON_LIBRARY AND PYTHON_LIBPATH AND PYTHON_INCLUDE_DIR AND PYTHON_INCLUDE_CONFIG_DIR)
+ SET(_PYTHON_ABI_FLAGS "${_CURRENT_ABI_FLAGS}")
break()
ELSE()
# ensure we dont find values from 2 different ABI versions
@@ -168,7 +171,6 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
UNSET(_CURRENT_PATH)
UNSET(_python_ABI_FLAGS)
- UNSET(_python_SEARCH_DIRS)
ENDIF()
UNSET(_IS_INC_DEF)
@@ -187,17 +189,41 @@ IF(PYTHONLIBSUNIX_FOUND)
SET(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR} ${PYTHON_INCLUDE_CONFIG_DIR})
SET(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
+ FIND_FILE(PYTHON_SITE_PACKAGES
+ NAMES
+ # debian specific
+ dist-packages
+ site-packages
+ HINTS
+ ${PYTHON_LIBPATH}/python${PYTHON_VERSION}
+ )
+
# we need this for installation
# XXX No more valid with debian-like py3.4 packages...
# GET_FILENAME_COMPONENT(PYTHON_LIBPATH ${PYTHON_LIBRARY} PATH)
- # not used
- # SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
+ # not required for build, just used when bundling Python.
+ FIND_PROGRAM(
+ PYTHON_EXECUTABLE
+ NAMES
+ "python${PYTHON_VERSION}${_PYTHON_ABI_FLAGS}"
+ "python${PYTHON_VERSION}"
+ "python"
+ HINTS
+ ${_python_SEARCH_DIRS}
+ PATH_SUFFIXES bin
+ )
ENDIF()
+UNSET(_PYTHON_VERSION_NO_DOTS)
+UNSET(_PYTHON_ABI_FLAGS)
+UNSET(_python_SEARCH_DIRS)
+
MARK_AS_ADVANCED(
PYTHON_INCLUDE_DIR
PYTHON_INCLUDE_CONFIG_DIR
PYTHON_LIBRARY
PYTHON_LIBPATH
+ PYTHON_SITE_PACKAGES
+ PYTHON_EXECUTABLE
)