CMake: decouple WITH_CYCLES_OPENSUBDIV from WITH_OPENSUBDIV, and enable on OS X.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 13 Sep 2016 20:55:18 +0000 (22:55 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 14 Sep 2016 10:02:44 +0000 (12:02 +0200)
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D2227

CMakeLists.txt
build_files/cmake/config/blender_full.cmake
build_files/cmake/config/blender_lite.cmake
build_files/cmake/macros.cmake
build_files/cmake/platform/platform_apple.cmake
build_files/cmake/platform/platform_unix.cmake
build_files/cmake/platform/platform_win32_msvc.cmake

index 352712e5ca93e7ca8a75f16441a4be27d1f73e1b..e061fab6b52ee75411c25f6f05f728616358565b 100644 (file)
@@ -155,6 +155,7 @@ option_defaults_init(
        _init_BUILDINFO
        _init_CODEC_FFMPEG
        _init_CYCLES_OSL
+       _init_CYCLES_OPENSUBDIV
        _init_IMAGE_OPENEXR
        _init_INPUT_NDOF
        _init_JACK
@@ -172,6 +173,7 @@ if(UNIX AND NOT APPLE)
        # disable less important dependencies by default
        set(_init_CODEC_FFMPEG                   OFF)
        set(_init_CYCLES_OSL                     OFF)
+       set(_init_CYCLES_OPENSUBDIV              OFF)
        set(_init_IMAGE_OPENEXR                  OFF)
        set(_init_JACK                           OFF)
        set(_init_OPENCOLLADA                    OFF)
@@ -400,7 +402,7 @@ option(WITH_CYCLES                                  "Enable Cycles Render Engine" ON)
 option(WITH_CYCLES_STANDALONE          "Build Cycles standalone application" OFF)
 option(WITH_CYCLES_STANDALONE_GUI      "Build Cycles standalone with GUI" OFF)
 option(WITH_CYCLES_OSL                         "Build Cycles with OSL support" ${_init_CYCLES_OSL})
-option(WITH_CYCLES_OPENSUBDIV          "Build Cycles with OpenSubdiv support" ON)
+option(WITH_CYCLES_OPENSUBDIV          "Build Cycles with OpenSubdiv support" ${_init_CYCLES_OPENSUBDIV})
 option(WITH_CYCLES_CUDA_BINARIES       "Build Cycles CUDA binaries" OFF)
 set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_37 sm_50 sm_52 CACHE STRING "CUDA architectures to build binaries for")
 mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
@@ -952,11 +954,6 @@ if(WITH_CYCLES)
                        )
                endif()
        endif()
-
-       if(WITH_CYCLES_OPENSUBDIV AND NOT WITH_OPENSUBDIV)
-               message(STATUS "WITH_CYCLES_OPENSUBDIV requires WITH_OPENSUBDIV to be ON, turning OFF")
-               set(WITH_CYCLES_OPENSUBDIV OFF)
-       endif()
 endif()
 
 if(WITH_INTERNATIONAL)
index 634d4f431d4200222367a7903a47190fce8e451e..cb18500c7ca4726d7a85c3e75d57654db1a37e71 100644 (file)
@@ -12,6 +12,7 @@ set(WITH_CODEC_FFMPEG        ON  CACHE BOOL "" FORCE)
 set(WITH_CODEC_SNDFILE       ON  CACHE BOOL "" FORCE)
 set(WITH_CYCLES              ON  CACHE BOOL "" FORCE)
 set(WITH_CYCLES_OSL          ON  CACHE BOOL "" FORCE)
+set(WITH_CYCLES_OPENSUBDIV   ON  CACHE BOOL "" FORCE)
 set(WITH_FFTW3               ON  CACHE BOOL "" FORCE)
 set(WITH_LIBMV               ON  CACHE BOOL "" FORCE)
 set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
index 46b7d48b494c793749580a3f3efd2a0e43290e1c..537134eb3573663cc935fd3a87551f21b04067c7 100644 (file)
@@ -16,6 +16,7 @@ set(WITH_CODEC_FFMPEG        OFF CACHE BOOL "" FORCE)
 set(WITH_CODEC_SNDFILE       OFF CACHE BOOL "" FORCE)
 set(WITH_CYCLES              OFF CACHE BOOL "" FORCE)
 set(WITH_CYCLES_OSL          OFF CACHE BOOL "" FORCE)
+set(WITH_CYCLES_OPENSUBDIV   OFF CACHE BOOL "" FORCE)
 set(WITH_FFTW3               OFF CACHE BOOL "" FORCE)
 set(WITH_LIBMV               OFF CACHE BOOL "" FORCE)
 set(WITH_LLVM                OFF CACHE BOOL "" FORCE)
@@ -48,6 +49,7 @@ set(WITH_OPENCOLLADA         OFF CACHE BOOL "" FORCE)
 set(WITH_OPENCOLORIO         OFF CACHE BOOL "" FORCE)
 set(WITH_OPENIMAGEIO         OFF CACHE BOOL "" FORCE)
 set(WITH_OPENMP              OFF CACHE BOOL "" FORCE)
+set(WITH_OPENSUBDIV          OFF CACHE BOOL "" FORCE)
 set(WITH_OPENVDB             OFF CACHE BOOL "" FORCE)
 set(WITH_RAYOPTIMIZATION     OFF CACHE BOOL "" FORCE)
 set(WITH_SDL                 OFF CACHE BOOL "" FORCE)
index fabb35c539e922ac4f24318b4ab8e97f4333ec14..5a67ac981a35a03e810b3b613a2265721fc17d7e 100644 (file)
@@ -415,7 +415,7 @@ function(setup_liblinks
        if(WITH_OPENCOLORIO)
                target_link_libraries(${target} ${OPENCOLORIO_LIBRARIES})
        endif()
-       if(WITH_OPENSUBDIV)
+       if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)
                if(WIN32 AND NOT UNIX)
                        file_list_suffix(OPENSUBDIV_LIBRARIES_DEBUG "${OPENSUBDIV_LIBRARIES}" "_d")
                        target_link_libraries_debug(${target} "${OPENSUBDIV_LIBRARIES_DEBUG}")
@@ -745,7 +745,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
                list(APPEND BLENDER_SORTED_LIBS bf_intern_gpudirect)
        endif()
 
-       if(WITH_OPENSUBDIV)
+       if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)
                list(APPEND BLENDER_SORTED_LIBS bf_intern_opensubdiv)
        endif()
 
@@ -1600,4 +1600,4 @@ MACRO(WINDOWS_SIGN_TARGET target)
                                )
                endif()
        endif()
-ENDMACRO()
\ No newline at end of file
+ENDMACRO()
index b28b74804d3601980c4359f63a3b2c6d1e36e0ca..0298f2229f81332a551f708f587d28ce646c1ae4 100644 (file)
@@ -50,15 +50,14 @@ if(WITH_ALEMBIC)
        set(ALEMBIC_LIBRARIES Alembic)
 endif()
 
-if(WITH_OPENSUBDIV)
+if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)
        set(OPENSUBDIV ${LIBDIR}/opensubdiv)
        set(OPENSUBDIV_LIBPATH ${OPENSUBDIV}/lib)
-       find_library(OSL_LIB_UTIL NAMES osdutil PATHS ${OPENSUBDIV_LIBPATH})
-       find_library(OSL_LIB_CPU NAMES osdCPU PATHS ${OPENSUBDIV_LIBPATH})
-       find_library(OSL_LIB_GPU NAMES osdGPU PATHS ${OPENSUBDIV_LIBPATH})
+       find_library(OSD_LIB_CPU NAMES osdCPU PATHS ${OPENSUBDIV_LIBPATH})
+       find_library(OSD_LIB_GPU NAMES osdGPU PATHS ${OPENSUBDIV_LIBPATH})
        set(OPENSUBDIV_INCLUDE_DIR ${OPENSUBDIV}/include)
        set(OPENSUBDIV_INCLUDE_DIRS ${OPENSUBDIV_INCLUDE_DIR})
-       list(APPEND OPENSUBDIV_LIBRARIES ${OSL_LIB_UTIL} ${OSL_LIB_CPU} ${OSL_LIB_GPU})
+       list(APPEND OPENSUBDIV_LIBRARIES ${OSD_LIB_CPU} ${OSD_LIB_GPU})
 endif()
 
 if(WITH_JACK)
index 1ec9b00d4cab75cece76594bcb8a33943012b5af..e33141f80122e56306d3276c5e32354847e342da 100644 (file)
@@ -344,7 +344,7 @@ if(WITH_LLVM OR WITH_SDL_DYNLOAD)
        )
 endif()
 
-if(WITH_OPENSUBDIV)
+if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)
        find_package_wrapper(OpenSubdiv)
 
        set(OPENSUBDIV_LIBRARIES ${OPENSUBDIV_LIBRARIES})
@@ -352,6 +352,7 @@ if(WITH_OPENSUBDIV)
 
        if(NOT OPENSUBDIV_FOUND)
                set(WITH_OPENSUBDIV OFF)
+               set(WITH_CYCLES_OPENSUBDIV OFF)
                message(STATUS "OpenSubdiv not found")
        endif()
 endif()
index 4ba6f4477e6f3ecbea367c7e29fa462c6492384b..5efda52b2c58d3ce8a403fd5bab4095161d36f20 100644 (file)
@@ -442,7 +442,7 @@ if(WITH_MOD_CLOTH_ELTOPO)
        )
 endif()
 
-if(WITH_OPENSUBDIV)
+if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)
        set(OPENSUBDIV_INCLUDE_DIR ${LIBDIR}/opensubdiv/include)
        set(OPENSUBDIV_LIBPATH ${LIBDIR}/opensubdiv/lib)
        set(OPENSUBDIV_LIBRARIES ${OPENSUBDIV_LIBPATH}/osdCPU.lib ${OPENSUBDIV_LIBPATH}/osdGPU.lib)