diff options
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/CMakeLists.txt | 6 | ||||
-rw-r--r-- | intern/cycles/bvh/CMakeLists.txt | 7 | ||||
-rw-r--r-- | intern/cycles/cmake/macros.cmake | 60 | ||||
-rw-r--r-- | intern/cycles/device/CMakeLists.txt | 4 | ||||
-rw-r--r-- | intern/cycles/graph/CMakeLists.txt | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/osl/CMakeLists.txt | 4 | ||||
-rw-r--r-- | intern/cycles/render/CMakeLists.txt | 3 |
7 files changed, 81 insertions, 5 deletions
diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt index 09379bf2017..b6ecab28555 100644 --- a/intern/cycles/blender/CMakeLists.txt +++ b/intern/cycles/blender/CMakeLists.txt @@ -49,11 +49,15 @@ set(LIB cycles_render cycles_subd cycles_util + + ${PYTHON_LINKFLAGS} + ${PYTHON_LIBRARIES} ) if(WITH_CYCLES_LOGGING) list(APPEND LIB - extern_glog + ${GLOG_LIBRARIES} + ${GFLAGS_LIBRARIES} ) endif() diff --git a/intern/cycles/bvh/CMakeLists.txt b/intern/cycles/bvh/CMakeLists.txt index 27a7f604e1c..fb724704a84 100644 --- a/intern/cycles/bvh/CMakeLists.txt +++ b/intern/cycles/bvh/CMakeLists.txt @@ -39,9 +39,16 @@ set(SRC_HEADERS set(LIB cycles_render + cycles_util ) include_directories(${INC}) include_directories(SYSTEM ${INC_SYS}) +if(WITH_CYCLES_EMBREE) + list(APPEND LIB + ${EMBREE_LIBRARIES} + ) +endif() + cycles_add_library(cycles_bvh "${LIB}" ${SRC} ${SRC_HEADERS}) diff --git a/intern/cycles/cmake/macros.cmake b/intern/cycles/cmake/macros.cmake index 0efd8bb7ea8..13328a8b6bf 100644 --- a/intern/cycles/cmake/macros.cmake +++ b/intern/cycles/cmake/macros.cmake @@ -8,8 +8,64 @@ endfunction() macro(cycles_add_library target library_deps) add_library(${target} ${ARGN}) - if(NOT ("${library_deps}" STREQUAL "")) - target_link_libraries(${target} "${library_deps}") + + # On Windows certain libraries have two sets of binaries: one for debug builds and one for + # release builds. The root of this requirement goes into ABI, I believe, but that's outside + # of a scope of this comment. + # + # CMake have a native way of dealing with this, which is specifying what build type the + # libraries are provided for: + # + # target_link_libraries(tagret optimized|debug|general <libraries>) + # + # The build type is to be provided as a separate argument to the function. + # + # CMake's variables for libraries will contain build type in such cases. For example: + # + # set(FOO_LIBRARIES optimized libfoo.lib debug libfoo_d.lib) + # + # Complications starts with a single argument for library_deps: all the elements are being + # put to a list: "${FOO_LIBRARIES}" will become "optimized;libfoo.lib;debug;libfoo_d.lib". + # This makes it impossible to pass it as-is to target_link_libraries sine it will treat + # this argument as a list of libraries to be linked against, causing missing libraries + # for optimized.lib. + # + # What this code does it traverses library_deps and extracts information about whether + # library is to provided as general, debug or optimized. This is a little state machine which + # keeps track of whiuch build type library is to provided for: + # + # - If "debug" or "optimized" word is found, the next element in the list is expected to be + # a library which will be passed to target_link_libraries() under corresponding build type. + # + # - If there is no "debug" or "optimized" used library is specified for all build types. + # + # NOTE: If separated libraries for debug and release ar eneeded every library is the list are + # to be prefixed explicitly. + # + # Use: "optimized libfoo optimized libbar debug libfoo_d debug libbar_d" + # NOT: "optimized libfoo libbar debug libfoo_d libbar_d" + # + # TODO(sergey): This is the same as Blender's side CMake. Find a way to avoid duplication + # somehow in a way which allows to have Cycles standalone. + if(NOT "${library_deps}" STREQUAL "") + set(next_library_mode "") + foreach(library ${library_deps}) + string(TOLOWER "${library}" library_lower) + if(("${library_lower}" STREQUAL "optimized") OR + ("${library_lower}" STREQUAL "debug")) + set(next_library_mode "${library_lower}") + else() + if("${next_library_mode}" STREQUAL "optimized") + target_link_libraries(${target} optimized ${library}) + elseif("${next_library_mode}" STREQUAL "debug") + target_link_libraries(${target} debug ${library}) + else() + target_link_libraries(${target} ${library}) + endif() + set(next_library_mode "") + endif() + endforeach() endif() + cycles_set_solution_folder(${target}) endmacro() diff --git a/intern/cycles/device/CMakeLists.txt b/intern/cycles/device/CMakeLists.txt index a8c4949ad07..35a79356957 100644 --- a/intern/cycles/device/CMakeLists.txt +++ b/intern/cycles/device/CMakeLists.txt @@ -60,7 +60,9 @@ set(SRC_HEADERS ) set(LIB - + cycles_render + cycles_kernel + cycles_util ) if(WITH_CUDA_DYNLOAD) diff --git a/intern/cycles/graph/CMakeLists.txt b/intern/cycles/graph/CMakeLists.txt index c6c46941598..9ff1c5b98c6 100644 --- a/intern/cycles/graph/CMakeLists.txt +++ b/intern/cycles/graph/CMakeLists.txt @@ -17,7 +17,7 @@ set(SRC_HEADERS ) set(LIB - + cycles_util ) include_directories(${INC}) diff --git a/intern/cycles/kernel/osl/CMakeLists.txt b/intern/cycles/kernel/osl/CMakeLists.txt index 35cca2da8ad..5be5bd181ec 100644 --- a/intern/cycles/kernel/osl/CMakeLists.txt +++ b/intern/cycles/kernel/osl/CMakeLists.txt @@ -27,6 +27,10 @@ set(HEADER_SRC set(LIB cycles_render + + ${OSL_LIBRARIES} + ${OPENIMAGEIO_LIBRARIES} + ${LLVM_LIBRARY} ) include_directories(${INC}) diff --git a/intern/cycles/render/CMakeLists.txt b/intern/cycles/render/CMakeLists.txt index 53196b013f6..92578b888a6 100644 --- a/intern/cycles/render/CMakeLists.txt +++ b/intern/cycles/render/CMakeLists.txt @@ -77,6 +77,9 @@ set(SRC_HEADERS set(LIB cycles_bvh + cycles_device + cycles_subd + cycles_util ) if(WITH_CYCLES_OSL) |