diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-04-07 21:27:23 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-04-29 20:03:06 +0300 |
commit | 060a50a5f72a0ccdb754bf155aa2ed394a1bcda5 (patch) | |
tree | 813b0d519df9f4bed79f5e267664204e874db2ee /intern/cycles/CMakeLists.txt | |
parent | 074a8558b7b320d7be78d436ab5473fd5b53ff56 (diff) |
Cycles: refactor Hydra render delegate building
* Leave code for building the render delegate against other applications and
their USD libraries to the Cycles repository, since this is not a great fit.
In the Blender repository, always use Blender's USD libraries now that they
include Hydra support.
* Hide non-USD symbols from the hdCycles shared library, to avoid library
version conflicts.
* Share Apple framework linking between the standalone app and plugin.
* Add cycles_hydra module, to be shared between the standalone app and plugin.
* Bring external libs code in sync with standalone repo, adding various missing
libraries.
* Move some cmake include directories to the top level cycles source folder
because we need to control their global order, to ensure we link against the
correct headers with mixed Blender libraries and external USD libraries.
Diffstat (limited to 'intern/cycles/CMakeLists.txt')
-rw-r--r-- | intern/cycles/CMakeLists.txt | 70 |
1 files changed, 51 insertions, 19 deletions
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index 003f75267ce..f5d717e70fc 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -18,8 +18,10 @@ endif() # External Libraries -include(cmake/external_libs.cmake) -include(cmake/macros.cmake) +if(NOT CYCLES_STANDALONE_REPOSITORY) + include(cmake/external_libs.cmake) + include(cmake/macros.cmake) +endif() # Build Flags # todo: this code could be refactored a bit to avoid duplication @@ -221,7 +223,6 @@ include_directories( ${OPENIMAGEIO_INCLUDE_DIRS} ${OPENEXR_INCLUDE_DIRS} ${PUGIXML_INCLUDE_DIR} - ${TBB_INCLUDE_DIRS} ) if(WITH_CYCLES_DEBUG) @@ -270,6 +271,49 @@ if(WITH_CYCLES_EMBREE) ) endif() +if(WITH_OPENIMAGEDENOISE) + add_definitions(-DWITH_OPENIMAGEDENOISE) + include_directories( + SYSTEM + ${OPENIMAGEDENOISE_INCLUDE_DIRS} + ) +endif() + +# Logging capabilities using GLog library. +if(WITH_CYCLES_LOGGING) + add_definitions(-DWITH_CYCLES_LOGGING) + add_definitions(${GLOG_DEFINES}) + add_definitions(-DCYCLES_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE}) + include_directories( + SYSTEM + ${GLOG_INCLUDE_DIRS} + ${GFLAGS_INCLUDE_DIRS} + ) +endif() + +if(WITH_ALEMBIC) + add_definitions(-DWITH_ALEMBIC) + include_directories( + SYSTEM + ${ALEMBIC_INCLUDE_DIRS} + ) +endif() + +# Includes that might be overrides by USD last, to avoid compiling +# against the wrong versions of other libraries. +include_directories( + SYSTEM + ${TBB_INCLUDE_DIRS} +) + +if(WITH_OPENVDB) + add_definitions(-DWITH_OPENVDB ${OPENVDB_DEFINITIONS}) + include_directories( + SYSTEM + ${OPENVDB_INCLUDE_DIRS} + ) +endif() + if(WITH_NANOVDB) add_definitions(-DWITH_NANOVDB) include_directories( @@ -286,23 +330,11 @@ if(WITH_OPENSUBDIV) ) endif() -if(WITH_OPENIMAGEDENOISE) - add_definitions(-DWITH_OPENIMAGEDENOISE) - include_directories( - SYSTEM - ${OPENIMAGEDENOISE_INCLUDE_DIRS} - ) -endif() - -# Logging capabilities using GLog library. -if(WITH_CYCLES_LOGGING) - add_definitions(-DWITH_CYCLES_LOGGING) - add_definitions(${GLOG_DEFINES}) - add_definitions(-DCYCLES_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE}) +if(WITH_OPENCOLORIO) + add_definitions(-DWITH_OCIO) include_directories( SYSTEM - ${GLOG_INCLUDE_DIRS} - ${GFLAGS_INCLUDE_DIRS} + ${OPENCOLORIO_INCLUDE_DIRS} ) endif() @@ -395,7 +427,7 @@ if(WITH_GTESTS) add_subdirectory(test) endif() -if(WITH_CYCLES_HYDRA_RENDER_DELEGATE) +if(WITH_CYCLES_HYDRA_RENDER_DELEGATE OR (WITH_CYCLES_STANDALONE AND WITH_USD)) add_subdirectory(hydra) endif() |