diff options
Diffstat (limited to 'build_files/cmake/Modules')
-rw-r--r-- | build_files/cmake/Modules/FindEmbree.cmake | 108 | ||||
-rw-r--r-- | build_files/cmake/Modules/FindJeMalloc.cmake | 9 | ||||
-rw-r--r-- | build_files/cmake/Modules/FindOpenColorIO.cmake | 2 | ||||
-rw-r--r-- | build_files/cmake/Modules/FindPCRE.cmake | 7 | ||||
-rw-r--r-- | build_files/cmake/Modules/FindPythonLibsUnix.cmake | 4 |
5 files changed, 126 insertions, 4 deletions
diff --git a/build_files/cmake/Modules/FindEmbree.cmake b/build_files/cmake/Modules/FindEmbree.cmake new file mode 100644 index 00000000000..d3ef8c6eb4c --- /dev/null +++ b/build_files/cmake/Modules/FindEmbree.cmake @@ -0,0 +1,108 @@ +# - Find Embree library +# Find the native Embree includes and library +# This module defines +# EMBREE_INCLUDE_DIRS, where to find rtcore.h, Set when +# EMBREE_INCLUDE_DIR is found. +# EMBREE_LIBRARIES, libraries to link against to use Embree. +# EMBREE_ROOT_DIR, The base directory to search for Embree. +# This can also be an environment variable. +# EMBREEFOUND, If false, do not try to use Embree. +# +# also defined, but not for general use are +# EMBREE_LIBRARY, where to find the Embree library. + +#============================================================================= +# Copyright 2018 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 EMBREE_ROOT_DIR was defined in the environment, use it. +IF(NOT EMBREE_ROOT_DIR AND NOT $ENV{EMBREE_ROOT_DIR} STREQUAL "") + SET(EMBREE_ROOT_DIR $ENV{EMBREE_ROOT_DIR}) +ENDIF() + +SET(_embree_SEARCH_DIRS + ${EMBREE_ROOT_DIR} + /usr/local + /sw # Fink + /opt/local # DarwinPorts + /opt/embree + /opt/lib/embree +) + +FIND_PATH(EMBREE_INCLUDE_DIR + NAMES + embree3/rtcore.h + HINTS + ${_embree_SEARCH_DIRS} + PATH_SUFFIXES + include +) + + +SET(_embree_FIND_COMPONENTS + embree_avx + embree_avx2 + embree_sse42 + embree3 + lexers + math + simd + sys + tasking +) + +SET(_embree_LIBRARIES) +FOREACH(COMPONENT ${_embree_FIND_COMPONENTS}) + STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) + + FIND_LIBRARY(EMBREE_${UPPERCOMPONENT}_LIBRARY + NAMES + ${COMPONENT} + HINTS + ${_embree_SEARCH_DIRS} + PATH_SUFFIXES + lib64 lib + ) + LIST(APPEND _embree_LIBRARIES "${EMBREE_${UPPERCOMPONENT}_LIBRARY}") +ENDFOREACH() + + +FIND_LIBRARY(EMBREE_LIBRARY + NAMES + libembree3 + HINTS + ${_embree_SEARCH_DIRS} + PATH_SUFFIXES + lib64 lib +) + +# handle the QUIETLY and REQUIRED arguments and set EMBREE_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(EMBREE DEFAULT_MSG + _embree_LIBRARIES EMBREE_INCLUDE_DIR) + +IF(EMBREE_FOUND) + SET(EMBREE_LIBRARIES ${_embree_LIBRARIES}) + SET(EMBREE_INCLUDE_DIRS ${EMBREE_INCLUDE_DIR}) +ENDIF(EMBREE_FOUND) + +MARK_AS_ADVANCED( + EMBREE_INCLUDE_DIR +) + +FOREACH(COMPONENT ${_embree_FIND_COMPONENTS}) + STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) + MARK_AS_ADVANCED(EMBREE_${UPPERCOMPONENT}_LIBRARY) +ENDFOREACH() + +UNSET(_embree_SEARCH_DIRS) +UNSET(_embree_FIND_COMPONENTS) +UNSET(_embree_LIBRARIES) diff --git a/build_files/cmake/Modules/FindJeMalloc.cmake b/build_files/cmake/Modules/FindJeMalloc.cmake index 506892b34ba..0abe103cd2e 100644 --- a/build_files/cmake/Modules/FindJeMalloc.cmake +++ b/build_files/cmake/Modules/FindJeMalloc.cmake @@ -53,6 +53,15 @@ FIND_LIBRARY(JEMALLOC_LIBRARY lib64 lib ) +if(JEMALLOC_INCLUDE_DIR) + SET(_version_regex "^#define[ \t]+JEMALLOC_VERSION[ \t]+\"([^\"]+)\".*") + file(STRINGS "${JEMALLOC_INCLUDE_DIR}/jemalloc.h" + JEMALLOC_VERSION REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" + JEMALLOC_VERSION "${JEMALLOC_VERSION}") + unset(_version_regex) +endif() + # handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE if # all listed variables are TRUE INCLUDE(FindPackageHandleStandardArgs) diff --git a/build_files/cmake/Modules/FindOpenColorIO.cmake b/build_files/cmake/Modules/FindOpenColorIO.cmake index 1d26d6b0f86..218b5f721bc 100644 --- a/build_files/cmake/Modules/FindOpenColorIO.cmake +++ b/build_files/cmake/Modules/FindOpenColorIO.cmake @@ -60,7 +60,7 @@ FOREACH(COMPONENT ${_opencolorio_FIND_COMPONENTS}) HINTS ${_opencolorio_SEARCH_DIRS} PATH_SUFFIXES - lib64 lib + lib64 lib lib64/static lib/static ) IF(OPENCOLORIO_${UPPERCOMPONENT}_LIBRARY) LIST(APPEND _opencolorio_LIBRARIES "${OPENCOLORIO_${UPPERCOMPONENT}_LIBRARY}") diff --git a/build_files/cmake/Modules/FindPCRE.cmake b/build_files/cmake/Modules/FindPCRE.cmake index 20b5c1d5c28..1fd56dc1234 100644 --- a/build_files/cmake/Modules/FindPCRE.cmake +++ b/build_files/cmake/Modules/FindPCRE.cmake @@ -56,8 +56,13 @@ INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARY PCRE_INCLUDE_DIR) +# With 'make deps' precompiled libs, opencollada ships with a copy of libpcre +# but not the headers, ${PCRE_LIBRARY} will be valid in this case +# but PCRE_FOUND will be FALSE. So we set this variable outside of +# the IF(PCRE_FOUND) below to allow blender to successfully link. +SET(PCRE_LIBRARIES ${PCRE_LIBRARY}) + IF(PCRE_FOUND) - SET(PCRE_LIBRARIES ${PCRE_LIBRARY}) SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR}) ENDIF(PCRE_FOUND) diff --git a/build_files/cmake/Modules/FindPythonLibsUnix.cmake b/build_files/cmake/Modules/FindPythonLibsUnix.cmake index 140f8be048a..84e1fbdb35c 100644 --- a/build_files/cmake/Modules/FindPythonLibsUnix.cmake +++ b/build_files/cmake/Modules/FindPythonLibsUnix.cmake @@ -38,7 +38,7 @@ IF(NOT PYTHON_ROOT_DIR AND NOT $ENV{PYTHON_ROOT_DIR} STREQUAL "") SET(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR}) ENDIF() -SET(PYTHON_VERSION 3.6 CACHE STRING "Python Version (major and minor only)") +SET(PYTHON_VERSION 3.7 CACHE STRING "Python Version (major and minor only)") MARK_AS_ADVANCED(PYTHON_VERSION) @@ -75,7 +75,7 @@ SET(_python_SEARCH_DIRS "/opt/lib/python-${PYTHON_VERSION}" ) -# only search for the dirs if we havn't already +# only search for the dirs if we haven't already IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_LIB_PATH_DEF)) SET(_PYTHON_ABI_FLAGS_TEST "m;mu;u; " # release |