diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/CMakeLists.txt | 1 | ||||
-rw-r--r-- | intern/cycles/CMakeLists.txt | 69 | ||||
-rw-r--r-- | intern/cycles/app/CMakeLists.txt | 46 | ||||
-rw-r--r-- | intern/cycles/app/cycles_test.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/blender/CMakeLists.txt | 30 | ||||
-rw-r--r-- | intern/cycles/bvh/CMakeLists.txt | 2 | ||||
-rwxr-xr-x | intern/cycles/cmake/create_dmg.py | 14 | ||||
-rw-r--r-- | intern/cycles/cmake/external_libs.cmake | 90 | ||||
-rw-r--r-- | intern/cycles/cmake/platforms.cmake | 2 | ||||
-rw-r--r-- | intern/cycles/device/CMakeLists.txt | 12 | ||||
-rw-r--r-- | intern/cycles/doc/CMakeLists.txt | 8 | ||||
-rw-r--r-- | intern/cycles/kernel/CMakeLists.txt | 22 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_types.h | 3 | ||||
-rw-r--r-- | intern/cycles/kernel/osl/nodes/CMakeLists.txt | 2 | ||||
-rw-r--r-- | intern/cycles/render/CMakeLists.txt | 2 | ||||
-rw-r--r-- | intern/cycles/subd/CMakeLists.txt | 2 | ||||
-rw-r--r-- | intern/cycles/util/CMakeLists.txt | 7 | ||||
-rw-r--r-- | intern/cycles/util/util_transform.cpp | 10 |
18 files changed, 158 insertions, 166 deletions
diff --git a/intern/CMakeLists.txt b/intern/CMakeLists.txt index 33bf9bb476c..f731b7be46c 100644 --- a/intern/CMakeLists.txt +++ b/intern/CMakeLists.txt @@ -52,3 +52,4 @@ endif() if(WITH_IK_ITASC) add_subdirectory(itasc) endif() + diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index 406b4e6732b..164f1e95297 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -1,38 +1,57 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -PROJECT(cycles) SET(CYCLES_VERSION_MAJOR 0) SET(CYCLES_VERSION_MINOR 0) SET(CYCLES_VERSION ${CYCLES_VERSION_MAJOR}.${CYCLES_VERSION_MINOR}) # Options -OPTION(WITH_OSL "Build with Open Shading Language support" OFF) -OPTION(WITH_CUDA "Build with CUDA support" OFF) -OPTION(WITH_OPENCL "Build with OpenCL support (not working)" OFF) -OPTION(WITH_BLENDER "Build Blender Python extension" OFF) -OPTION(WITH_PARTIO "Build with Partio point cloud support (unfinished)" OFF) -OPTION(WITH_NETWORK "Build with network rendering support (unfinished)" OFF) -OPTION(WITH_MULTI "Build with network rendering support (unfinished)" OFF) -OPTION(WITH_DOCS "Build html documentation" OFF) +OPTION(WITH_CYCLES_OSL "Build with Open Shading Language support" OFF) +OPTION(WITH_CYCLES_CUDA "Build with CUDA support" OFF) +OPTION(WITH_CYCLES_OPENCL "Build with OpenCL support (not working)" OFF) +OPTION(WITH_CYCLES_BLENDER "Build Blender Python extension" ON) +OPTION(WITH_CYCLES_PARTIO "Build with Partio point cloud support (unfinished)" OFF) +OPTION(WITH_CYCLES_NETWORK "Build with network rendering support (unfinished)" OFF) +OPTION(WITH_CYCLES_MULTI "Build with network rendering support (unfinished)" OFF) +OPTION(WITH_CYCLES_DOCS "Build html documentation" OFF) # Flags -SET(CUDA_ARCH sm_10 sm_11 sm_12 sm_13 sm_20 sm_21 CACHE STRING "CUDA architectures to build for") -SET(CUDA_MAXREG 24 CACHE STRING "CUDA maximum number of register to use") + +SET(CYCLES_CUDA_ARCH sm_10 sm_11 sm_12 sm_13 sm_20 sm_21 CACHE STRING "CUDA architectures to build for") +SET(CYCLES_CUDA_MAXREG 24 CACHE STRING "CUDA maximum number of register to use") # Paths -SET(OSL_PATH "" CACHE PATH "Path to OpenShadingLanguage installation") -SET(OIIO_PATH "" CACHE PATH "Path to OpenImageIO installation") -SET(BOOST_PATH "/usr" CACHE PATH "Path to Boost installation") -SET(CUDA_PATH "/usr/local/cuda" CACHE PATH "Path to CUDA installation") -SET(OPENCL_PATH "" CACHE PATH "Path to OpenCL installation") -SET(PYTHON_PATH "" CACHE PATH "Path to Python installation") -SET(BLENDER_PATH "" CACHE PATH "Path to Blender installation") -SET(PARTIO_PATH "" CACHE PATH "Path to Partio installation") -SET(GLEW_PATH "" CACHE PATH "Path to GLEW installation") -SET(GLUT_PATH "" CACHE PATH "Path to GLUT installation") -SET(INSTALL_PATH "${CMAKE_BINARY_DIR}/install" CACHE PATH "Path to install to") +SET(CYCLES_OSL "" CACHE PATH "Path to OpenShadingLanguage installation") +SET(CYCLES_OIIO "" CACHE PATH "Path to OpenImageIO installation") +SET(CYCLES_BOOST "/usr" CACHE PATH "Path to Boost installation") +SET(CYCLES_CUDA "/usr/local/cuda" CACHE PATH "Path to CUDA installation") +SET(CYCLES_OPENCL "" CACHE PATH "Path to OpenCL installation") +SET(CYCLES_PARTIO "" CACHE PATH "Path to Partio installation") +SET(CYCLES_GLEW "" CACHE PATH "Path to GLUT installation") + +# Install, todo: deduplicate install path code + +if(MSVC_IDE) + set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE}) +elseif(APPLE) + set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE}) +else() + set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}) +endif() + +if(UNIX AND NOT APPLE) + if(WITH_INSTALL_PORTABLE) + set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION}) + else() + set(TARGETDIR_VER ${CMAKE_INSTALL_PREFIX}/share/blender/${BLENDER_VERSION}) + endif() +elseif(WIN32) + set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION}) +elseif(APPLE) + set(TARGETDIR_VER ${TARGETDIR}/blender.app/Contents/MacOS/${BLENDER_VERSION}) +endif() + +SET(CYCLES_INSTALL_PATH "${TARGETDIR_VER}/scripts/addons") # External Libraries @@ -44,9 +63,9 @@ INCLUDE(cmake/platforms.cmake) # Subdirectories -IF(WITH_BLENDER) +IF(WITH_CYCLES_BLENDER) ADD_SUBDIRECTORY(blender) -ENDIF(WITH_BLENDER) +ENDIF(WITH_CYCLES_BLENDER) ADD_SUBDIRECTORY(app) ADD_SUBDIRECTORY(bvh) diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt index b1f73ed74a3..d90ebf0a8b5 100644 --- a/intern/cycles/app/CMakeLists.txt +++ b/intern/cycles/app/CMakeLists.txt @@ -1,48 +1,54 @@ -INCLUDE_DIRECTORIES(. ../device ../kernel ../kernel/svm ../bvh ../util ../render ../subd) +INCLUDE_DIRECTORIES( + . + ../device + ../kernel + ../kernel/svm + ../bvh + ../util + ../render + ../subd) SET(LIBRARIES - device - kernel - render - bvh - subd - util + cycles_device + cycles_kernel + cycles_render + cycles_bvh + cycles_subd + cycles_util ${Boost_LIBRARIES} ${OPENGL_LIBRARIES} - ${GLEW_LIBRARIES} + ${GLEW_LIBRARY} ${OPENIMAGEIO_LIBRARY} ${GLUT_LIBRARIES}) -IF(WITH_OSL) - LIST(APPEND LIBRARIES kernel_osl ${OSL_LIBRARIES}) -ENDIF(WITH_OSL) +IF(WITH_CYCLES_OSL) + LIST(APPEND LIBRARIES cycles_kernel_osl ${OSL_LIBRARIES}) +ENDIF() -IF(WITH_PARTIO) +IF(WITH_CYCLES_PARTIO) LIST(APPEND LIBRARIES ${PARTIO_LIBRARIES}) -ENDIF(WITH_PARTIO) +ENDIF() -IF(WITH_OPENCL) +IF(WITH_CYCLES_OPENCL) LIST(APPEND LIBRARIES ${OPENCL_LIBRARIES}) -ENDIF(WITH_OPENCL) +ENDIF() ADD_EXECUTABLE(cycles_test cycles_test.cpp cycles_xml.cpp cycles_xml.h) TARGET_LINK_LIBRARIES(cycles_test ${LIBRARIES}) -INSTALL(TARGETS cycles_test DESTINATION ${INSTALL_PATH}/cycles) +INSTALL(TARGETS cycles_test DESTINATION ${CYCLES_INSTALL_PATH}/cycles) IF(UNIX AND NOT APPLE) SET_TARGET_PROPERTIES(cycles_test PROPERTIES INSTALL_RPATH $ORIGIN/lib) ENDIF() -IF(WITH_NETWORK) +IF(WITH_CYCLES_NETWORK) ADD_EXECUTABLE(cycles_server cycles_server.cpp) TARGET_LINK_LIBRARIES(cycles_server ${LIBRARIES}) - INSTALL(TARGETS cycles_server DESTINATION ${INSTALL_PATH}/cycles) + INSTALL(TARGETS cycles_server DESTINATION ${CYCLES_INSTALL_PATH}/cycles) IF(UNIX AND NOT APPLE) SET_TARGET_PROPERTIES(cycles_server PROPERTIES INSTALL_RPATH $ORIGIN/lib) ENDIF() ENDIF() -INSTALL(CODE "FILE(MAKE_DIRECTORY ${INSTALL_PATH}/cycles/cache)") - diff --git a/intern/cycles/app/cycles_test.cpp b/intern/cycles/app/cycles_test.cpp index 96072ac3da6..2603458f088 100644 --- a/intern/cycles/app/cycles_test.cpp +++ b/intern/cycles/app/cycles_test.cpp @@ -185,7 +185,7 @@ static void options_parse(int argc, const char **argv) { options.width= 1024; options.height= 512; - options.filepath = path_get("../../../test/models/elephants.xml"); + options.filepath = ""; options.session = NULL; options.quiet = false; diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt index a75f7295e31..93a043a54a2 100644 --- a/intern/cycles/blender/CMakeLists.txt +++ b/intern/cycles/blender/CMakeLists.txt @@ -32,12 +32,12 @@ INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS}) SET(LIBRARIES - render - bvh - device - kernel - util - subd + cycles_render + cycles_bvh + cycles_device + cycles_kernel + cycles_util + cycles_subd ${Boost_LIBRARIES} ${OPENGL_LIBRARIES} ${OPENIMAGEIO_LIBRARY} @@ -46,25 +46,25 @@ SET(LIBRARIES ${GLEW_LIBRARIES} ${BLENDER_LIBRARIES}) -IF(WITH_OSL) - LIST(APPEND LIBRARIES kernel_osl ${OSL_LIBRARIES}) -ENDIF(WITH_OSL) +IF(WITH_CYCLES_OSL) + LIST(APPEND LIBRARIES cycles_kernel_osl ${OSL_LIBRARIES}) +ENDIF() -IF(WITH_PARTIO) +IF(WITH_CYCLES_PARTIO) LIST(APPEND LIBRARIES ${PARTIO_LIBRARIES}) -ENDIF(WITH_PARTIO) +ENDIF() -IF(WITH_OPENCL) +IF(WITH_CYCLES_OPENCL) LIST(APPEND LIBRARIES ${OPENCL_LIBRARIES}) -ENDIF(WITH_OPENCL) +ENDIF() SET(CMAKE_MODULE_LINKER_FLAGS ${PYTHON_MODULE_FLAGS}) ADD_LIBRARY(cycles_blender MODULE ${sources} ${headers}) TARGET_LINK_LIBRARIES(cycles_blender ${LIBRARIES}) -INSTALL(FILES ${addonfiles} DESTINATION ${INSTALL_PATH}/cycles) -INSTALL(TARGETS cycles_blender LIBRARY DESTINATION ${INSTALL_PATH}/cycles) +INSTALL(FILES ${addonfiles} DESTINATION ${CYCLES_INSTALL_PATH}/cycles) +INSTALL(TARGETS cycles_blender LIBRARY DESTINATION ${CYCLES_INSTALL_PATH}/cycles) IF(UNIX AND NOT APPLE) SET_TARGET_PROPERTIES(cycles_blender PROPERTIES INSTALL_RPATH $ORIGIN/lib) diff --git a/intern/cycles/bvh/CMakeLists.txt b/intern/cycles/bvh/CMakeLists.txt index c934cded6da..9ea3bc77461 100644 --- a/intern/cycles/bvh/CMakeLists.txt +++ b/intern/cycles/bvh/CMakeLists.txt @@ -14,5 +14,5 @@ SET(headers bvh_params.h bvh_sort.h) -ADD_LIBRARY(bvh ${sources} ${headers}) +ADD_LIBRARY(cycles_bvh ${sources} ${headers}) diff --git a/intern/cycles/cmake/create_dmg.py b/intern/cycles/cmake/create_dmg.py deleted file mode 100755 index bba7f8d3509..00000000000 --- a/intern/cycles/cmake/create_dmg.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/python - -import os -import string -import sys - -name = string.replace(sys.argv[1], ".zip", "") - -os.system("rm -f %s.dmg" % (name)) -os.system("mkdir -p /tmp/cycles_dmg") -os.system("rm /tmp/cycles_dmg/*") -os.system("cp %s.zip /tmp/cycles_dmg/" % (name)) -os.system("/usr/bin/hdiutil create -fs HFS+ -srcfolder /tmp/cycles_dmg -volname %s %s.dmg" % (name, name)) - diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index 6f6f00ed6bc..da2331cfe9a 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -1,8 +1,8 @@ ########################################################################### # Boost setup -MESSAGE(STATUS "BOOST_PATH ${BOOST_PATH}") -SET(BOOST_ROOT ${BOOST_PATH}) +MESSAGE(STATUS "CYCLES_BOOST ${CYCLES_BOOST}") +SET(BOOST_ROOT ${CYCLES_BOOST}) SET(Boost_ADDITIONAL_VERSIONS "1.45" "1.44" "1.43" "1.43.0" "1.42" "1.42.0" @@ -26,22 +26,22 @@ MESSAGE(STATUS "Boost libraries ${Boost_LIBRARIES}") INCLUDE_DIRECTORIES("${Boost_INCLUDE_DIRS}") LINK_DIRECTORIES("${Boost_LIBRARY_DIRS}") -IF(WITH_NETWORK) +IF(WITH_CYCLES_NETWORK) ADD_DEFINITIONS(-DWITH_NETWORK) ENDIF() -IF(WITH_MULTI) +IF(WITH_CYCLES_MULTI) ADD_DEFINITIONS(-DWITH_MULTI) ENDIF() ########################################################################### # OpenImageIO -MESSAGE(STATUS "OIIO_PATH = ${OIIO_PATH}") +MESSAGE(STATUS "CYCLES_OIIO = ${CYCLES_OIIO}") -FIND_LIBRARY(OPENIMAGEIO_LIBRARY NAMES OpenImageIO PATHS ${OIIO_PATH}/lib) -FIND_PATH(OPENIMAGEIO_INCLUDES OpenImageIO/imageio.h ${OIIO_PATH}/include) -FIND_PROGRAM(OPENIMAGEIO_IDIFF NAMES idiff PATHS ${OIIO_PATH}/bin) +FIND_LIBRARY(OPENIMAGEIO_LIBRARY NAMES OpenImageIO PATHS ${CYCLES_OIIO}/lib) +FIND_PATH(OPENIMAGEIO_INCLUDES OpenImageIO/imageio.h ${CYCLES_OIIO}/include) +FIND_PROGRAM(OPENIMAGEIO_IDIFF NAMES idiff PATHS ${CYCLES_OIIO}/bin) IF(OPENIMAGEIO_INCLUDES AND OPENIMAGEIO_LIBRARY) SET(OPENIMAGEIO_FOUND TRUE) @@ -55,17 +55,9 @@ ADD_DEFINITIONS(-DWITH_OIIO) INCLUDE_DIRECTORIES(${OPENIMAGEIO_INCLUDES} ${OPENIMAGEIO_INCLUDES}/OpenImageIO) ########################################################################### -# OpenGL - -FIND_PACKAGE(OpenGL) -MESSAGE(STATUS "OPENGL_FOUND=${OPENGL_FOUND}") - -INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) - -########################################################################### # GLUT -SET(GLUT_ROOT_PATH ${GLUT_PATH}) +SET(GLUT_ROOT_PATH ${CYCLES_GLUT}) FIND_PACKAGE(GLUT) MESSAGE(STATUS "GLUT_FOUND=${GLUT_FOUND}") @@ -73,31 +65,15 @@ MESSAGE(STATUS "GLUT_FOUND=${GLUT_FOUND}") INCLUDE_DIRECTORIES(${GLUT_INCLUDE_DIR}) ########################################################################### -# GLEW - -SET(GLEW_VERSION 1.5.1) -FIND_LIBRARY(GLEW_LIBRARIES NAMES GLEW PATHS ${GLEW_PATH}/lib) -FIND_PATH(GLEW_INCLUDES NAMES glew.h PATH_SUFFIXES GL PATHS ${GLEW_PATH}/include) - -IF(GLEW_INCLUDES AND GLEW_LIBRARIES) - MESSAGE(STATUS "GLEW includes = ${GLEW_INCLUDES}") - MESSAGE(STATUS "GLEW library = ${GLEW_LIBRARIES}") -ELSE() - MESSAGE(STATUS "GLEW not found") -ENDIF() - -INCLUDE_DIRECTORIES("${GLEW_INCLUDES}") - -########################################################################### # OpenShadingLanguage -IF(WITH_OSL) +IF(WITH_CYCLES_OSL) - MESSAGE(STATUS "OSL_PATH = ${OSL_PATH}") + MESSAGE(STATUS "CYCLES_OSL = ${CYCLES_OSL}") - FIND_LIBRARY(OSL_LIBRARIES NAMES oslexec oslcomp oslquery PATHS ${OSL_PATH}/lib) - FIND_PATH(OSL_INCLUDES OSL/oslclosure.h ${OSL_PATH}/include) - FIND_PROGRAM(OSL_COMPILER NAMES oslc PATHS ${OSL_PATH}/bin) + FIND_LIBRARY(OSL_LIBRARIES NAMES oslexec oslcomp oslquery PATHS ${CYCLES_OSL}/lib) + FIND_PATH(OSL_INCLUDES OSL/oslclosure.h ${CYCLES_OSL}/include) + FIND_PROGRAM(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin) IF(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER) SET(OSL_FOUND TRUE) @@ -116,12 +92,12 @@ ENDIF() ########################################################################### # Partio -IF(WITH_PARTIO) +IF(WITH_CYCLES_PARTIO) - MESSAGE(STATUS "PARTIO_PATH = ${PARTIO_PATH}") + MESSAGE(STATUS "CYCLES_PARTIO = ${CYCLES_PARTIO}") - FIND_LIBRARY(PARTIO_LIBRARIES NAMES partio PATHS ${PARTIO_PATH}/lib) - FIND_PATH(PARTIO_INCLUDES Partio.h ${PARTIO_PATH}/include) + FIND_LIBRARY(PARTIO_LIBRARIES NAMES partio PATHS ${CYCLES_PARTIO}/lib) + FIND_PATH(PARTIO_INCLUDES Partio.h ${CYCLES_PARTIO}/include) FIND_PACKAGE(ZLIB) @@ -140,35 +116,23 @@ IF(WITH_PARTIO) ENDIF() ########################################################################### -# Python - -IF(WITH_BLENDER) - - FIND_PATH(PYTHON_INCLUDE_DIRS Python.h PATHS ${PYTHON_PATH} ${PYTHON_PATH}/include ${PYTHON_PATH}/include/python3.1 ${PYTHON_PATH}/include/python3.2 NO_DEFAULT_PATH) - IF(WIN32) - FIND_LIBRARY(PYTHON_LIBRARIES NAMES python31 PATHS ${PYTHON_PATH}/lib) - ENDIF() - -ENDIF() - -########################################################################### # Blender -IF(WITH_BLENDER) - FIND_PATH(BLENDER_INCLUDE_DIRS RNA_blender.h PATHS ${BLENDER_PATH}/include) +IF(WITH_CYCLES_BLENDER) + FIND_PATH(BLENDER_INCLUDE_DIRS RNA_blender.h PATHS ${CMAKE_BINARY_DIR}/include) IF(WIN32) - SET(BLENDER_LIBRARIES ${BLENDER_PATH}/bin/Release/blender.lib) + SET(BLENDER_LIBRARIES ${CMAKE_BINARY_DIR}/bin/Release/blender.lib) ENDIF() ENDIF() ########################################################################### # CUDA -IF(WITH_CUDA) +IF(WITH_CYCLES_CUDA) - FIND_LIBRARY(CUDA_LIBRARIES NAMES cuda PATHS ${CUDA_PATH}/lib ${CUDA_PATH}/lib/Win32 NO_DEFAULT_PATH) - FIND_PATH(CUDA_INCLUDES cuda.h ${CUDA_PATH}/include NO_DEFAULT_PATH) - FIND_PROGRAM(CUDA_NVCC NAMES nvcc PATHS ${CUDA_PATH}/bin NO_DEFAULT_PATH) + FIND_LIBRARY(CUDA_LIBRARIES NAMES cuda PATHS ${CYCLES_CUDA}/lib ${CYCLES_CUDA}/lib/Win32 NO_DEFAULT_PATH) + FIND_PATH(CUDA_INCLUDES cuda.h ${CYCLES_CUDA}/include NO_DEFAULT_PATH) + FIND_PROGRAM(CUDA_NVCC NAMES nvcc PATHS ${CYCLES_CUDA}/bin NO_DEFAULT_PATH) IF(CUDA_INCLUDES AND CUDA_LIBRARIES AND CUDA_NVCC) MESSAGE(STATUS "CUDA includes = ${CUDA_INCLUDES}") @@ -186,7 +150,7 @@ ENDIF() ########################################################################### # OpenCL -IF(WITH_OPENCL) +IF(WITH_CYCLES_OPENCL) IF(APPLE) SET(OPENCL_INCLUDES "/System/Library/Frameworks/OpenCL.framework/Headers") @@ -199,7 +163,7 @@ IF(WITH_OPENCL) ENDIF() IF(UNIX AND NOT APPLE) - SET(OPENCL_INCLUDES ${OPENCL_PATH}) + SET(OPENCL_INCLUDES ${CYCLES_OPENCL}) SET(OPENCL_LIRBARIES "OpenCL") ENDIF() diff --git a/intern/cycles/cmake/platforms.cmake b/intern/cycles/cmake/platforms.cmake index ebc4b01edbc..075b4761a85 100644 --- a/intern/cycles/cmake/platforms.cmake +++ b/intern/cycles/cmake/platforms.cmake @@ -1,7 +1,7 @@ # Platform specific build flags -SET(GCC_WARNING_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-long-long") # -pedantic +SET(GCC_WARNING_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-long-long") SET(GCC_OPTIM_FLAGS "-ffast-math -fPIC -msse -msse2 -msse3 -mtune=native") IF(APPLE) diff --git a/intern/cycles/device/CMakeLists.txt b/intern/cycles/device/CMakeLists.txt index ab72548fc4f..0885cd6fc20 100644 --- a/intern/cycles/device/CMakeLists.txt +++ b/intern/cycles/device/CMakeLists.txt @@ -1,5 +1,13 @@ -INCLUDE_DIRECTORIES(. ../kernel ../kernel/svm ../kernel/osl ../util ../render) +INCLUDE_DIRECTORIES( + . + ../kernel + ../kernel/svm + ../kernel/osl + ../util + ../render + ${OPENGL_INCLUDE_DIR} + ${GLEW_INCLUDE_DIR}) SET(sources device.cpp @@ -14,5 +22,5 @@ SET(headers device_intern.h device_network.h) -ADD_LIBRARY(device ${sources} ${headers}) +ADD_LIBRARY(cycles_device ${sources} ${headers}) diff --git a/intern/cycles/doc/CMakeLists.txt b/intern/cycles/doc/CMakeLists.txt index 116ca5e5b9f..d6e487663c3 100644 --- a/intern/cycles/doc/CMakeLists.txt +++ b/intern/cycles/doc/CMakeLists.txt @@ -1,5 +1,5 @@ -INSTALL(DIRECTORY license DESTINATION ${INSTALL_PATH}/cycles) +INSTALL(DIRECTORY license DESTINATION ${CYCLES_INSTALL_PATH}/cycles PATTERN ".svn" EXCLUDE) SET(doc_sources index.html @@ -76,12 +76,12 @@ SET(doc_templates templates/nodes.html templates/reference.html) -IF(WITH_DOCS) +IF(WITH_CYCLES_DOCS) MACRO(install_doc_file source_file html_file) GET_FILENAME_COMPONENT(subdir ${source_file} PATH) INSTALL( FILES ${html_file} - DESTINATION ${INSTALL_PATH}/cycles/doc/${subdir}) + DESTINATION ${CYCLES_INSTALL_PATH}/cycles/doc/${subdir}) ENDMACRO() FOREACH(_file ${doc_sources}) @@ -100,6 +100,6 @@ IF(WITH_DOCS) install_doc_file(${_file} ${_file}) ENDFOREACH() - ADD_CUSTOM_TARGET(doc ALL DEPENDS ${html_files}) + ADD_CUSTOM_TARGET(cycles_doc ALL DEPENDS ${html_files}) ENDIF() diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index 30b618eb1ad..6c247a9a645 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -71,34 +71,38 @@ SET(headers # CUDA module -IF(WITH_CUDA) +IF(WITH_CYCLES_CUDA) SET(cuda_sources kernel.cu ${headers}) SET(cuda_cubins) - FOREACH(arch ${CUDA_ARCH}) + FOREACH(arch ${CYCLES_CUDA_ARCH}) SET(cuda_cubin kernel_${arch}.cubin) ADD_CUSTOM_COMMAND( OUTPUT ${cuda_cubin} - COMMAND ${CUDA_NVCC} -arch=${arch} -m64 --cubin ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cu --use_fast_math -o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin} --ptxas-options="-v" --maxrregcount=${CUDA_MAXREG} --opencc-options -OPT:Olimit=0 -I${CMAKE_CURRENT_SOURCE_DIR}/../util -I${CMAKE_CURRENT_SOURCE_DIR}/svm -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= + COMMAND ${CUDA_NVCC} -arch=${arch} -m64 --cubin ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cu --use_fast_math -o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin} --ptxas-options="-v" --maxrregcount=${CYCLES_CUDA_MAXREG} --opencc-options -OPT:Olimit=0 -I${CMAKE_CURRENT_SOURCE_DIR}/../util -I${CMAKE_CURRENT_SOURCE_DIR}/svm -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= DEPENDS ${cuda_sources}) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin} DESTINATION ${INSTALL_PATH}/cycles/lib) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin} DESTINATION ${CYCLES_INSTALL_PATH}/cycles/lib) LIST(APPEND cuda_cubins ${cuda_cubin}) ENDFOREACH() - ADD_CUSTOM_TARGET(kernel_cuda ALL DEPENDS ${cuda_cubins}) -ENDIF(WITH_CUDA) + ADD_CUSTOM_TARGET(cycles_kernel_cuda ALL DEPENDS ${cuda_cubins}) +ENDIF() # OSL module -IF(WITH_OSL) +IF(WITH_CYCLES_OSL) ADD_SUBDIRECTORY(osl) -ENDIF(WITH_OSL) +ENDIF() # CPU module INCLUDE_DIRECTORIES(. ../util osl svm) -ADD_LIBRARY(kernel ${sources} ${headers}) +ADD_LIBRARY(cycles_kernel ${sources} ${headers}) + +IF(WITH_CYCLES_CUDA) + add_dependencies(cycles_kernel cycles_kernel_cuda) +ENDIF() diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index 8e378d2871b..bd337eb95e1 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -217,8 +217,7 @@ typedef struct ShaderData { /* primitive id if there is one, ~0 otherwise */ int prim; /* parametric coordinates - * - barycentric weights for triangles - * - latlong coordinates for background */ + * - barycentric weights for triangles */ float u, v; /* object id if there is one, ~0 otherwise */ int object; diff --git a/intern/cycles/kernel/osl/nodes/CMakeLists.txt b/intern/cycles/kernel/osl/nodes/CMakeLists.txt index 435acc5f680..56e8ba0b5b6 100644 --- a/intern/cycles/kernel/osl/nodes/CMakeLists.txt +++ b/intern/cycles/kernel/osl/nodes/CMakeLists.txt @@ -65,5 +65,5 @@ ENDFOREACH() ADD_CUSTOM_TARGET(shader ALL DEPENDS ${oso_sources} ${osl_headers}) -INSTALL(FILES ${oso_sources} DESTINATION ${INSTALL_PATH}/cycles/shader) +INSTALL(FILES ${oso_sources} DESTINATION ${CYCLES_INSTALL_PATH}/cycles/shader) diff --git a/intern/cycles/render/CMakeLists.txt b/intern/cycles/render/CMakeLists.txt index f31e9bfbcb2..f2342c9032a 100644 --- a/intern/cycles/render/CMakeLists.txt +++ b/intern/cycles/render/CMakeLists.txt @@ -50,5 +50,5 @@ SET(headers SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RTTI_DISABLE_FLAGS}") -ADD_LIBRARY(render ${sources} ${headers}) +ADD_LIBRARY(cycles_render ${sources} ${headers}) diff --git a/intern/cycles/subd/CMakeLists.txt b/intern/cycles/subd/CMakeLists.txt index a14bf7896d8..5357df4fab7 100644 --- a/intern/cycles/subd/CMakeLists.txt +++ b/intern/cycles/subd/CMakeLists.txt @@ -22,5 +22,5 @@ SET(headers subd_stencil.h subd_vert.h) -ADD_LIBRARY(subd ${sources} ${headers}) +ADD_LIBRARY(cycles_subd ${sources} ${headers}) diff --git a/intern/cycles/util/CMakeLists.txt b/intern/cycles/util/CMakeLists.txt index 3fea6182a97..4137c73a39a 100644 --- a/intern/cycles/util/CMakeLists.txt +++ b/intern/cycles/util/CMakeLists.txt @@ -1,5 +1,8 @@ -INCLUDE_DIRECTORIES(.) +INCLUDE_DIRECTORIES( + . + ${GLEW_INCLUDE_PATH} + ${OPENGL_INCLUDE_DIR}) SET(sources util_cache.cpp @@ -43,5 +46,5 @@ SET(headers util_vector.h util_xml.h) -ADD_LIBRARY(util ${sources} ${headers}) +ADD_LIBRARY(cycles_util ${sources} ${headers}) diff --git a/intern/cycles/util/util_transform.cpp b/intern/cycles/util/util_transform.cpp index 5c2f28af318..8c5eac2cbb9 100644 --- a/intern/cycles/util/util_transform.cpp +++ b/intern/cycles/util/util_transform.cpp @@ -129,13 +129,15 @@ static bool transform_matrix4_gj_inverse(float R[][4], float M[][4]) Transform transform_inverse(const Transform& tfm) { - Transform R = transform_identity(); - Transform M = tfm; + union { Transform T; float M[4][4]; } R, M; + + R.T = transform_identity(); + M.T = tfm; - if(!transform_matrix4_gj_inverse((float(*)[4])&R, (float(*)[4])&M)) + if(!transform_matrix4_gj_inverse(R.M, M.M)) return transform_identity(); - return R; + return R.T; } CCL_NAMESPACE_END |