[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36374] branches/cycles: Cycles: hook up the CMake build system.
Brecht Van Lommel
brechtvanlommel at pandora.be
Thu Apr 28 15:47:28 CEST 2011
Revision: 36374
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36374
Author: blendix
Date: 2011-04-28 13:47:27 +0000 (Thu, 28 Apr 2011)
Log Message:
-----------
Cycles: hook up the CMake build system.
New build instructions for Ubuntu Linux in the wiki:
http://wiki.blender.org/index.php/Dev:2.5/Source/Cycles
Modified Paths:
--------------
branches/cycles/CMakeLists.txt
branches/cycles/intern/CMakeLists.txt
branches/cycles/intern/cycles/CMakeLists.txt
branches/cycles/intern/cycles/app/CMakeLists.txt
branches/cycles/intern/cycles/app/cycles_test.cpp
branches/cycles/intern/cycles/blender/CMakeLists.txt
branches/cycles/intern/cycles/bvh/CMakeLists.txt
branches/cycles/intern/cycles/cmake/external_libs.cmake
branches/cycles/intern/cycles/cmake/platforms.cmake
branches/cycles/intern/cycles/device/CMakeLists.txt
branches/cycles/intern/cycles/doc/CMakeLists.txt
branches/cycles/intern/cycles/kernel/CMakeLists.txt
branches/cycles/intern/cycles/kernel/kernel_types.h
branches/cycles/intern/cycles/kernel/osl/nodes/CMakeLists.txt
branches/cycles/intern/cycles/render/CMakeLists.txt
branches/cycles/intern/cycles/subd/CMakeLists.txt
branches/cycles/intern/cycles/util/CMakeLists.txt
branches/cycles/intern/cycles/util/util_transform.cpp
Removed Paths:
-------------
branches/cycles/intern/cycles/cmake/create_dmg.py
Modified: branches/cycles/CMakeLists.txt
===================================================================
--- branches/cycles/CMakeLists.txt 2011-04-28 13:01:29 UTC (rev 36373)
+++ branches/cycles/CMakeLists.txt 2011-04-28 13:47:27 UTC (rev 36374)
@@ -173,6 +173,9 @@
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
option(WITH_API_INSTALL "Copy API header files into the blender install folder" ON)
+# Cycles
+option(WITH_CYCLES "Enable Cycles Render Engine" ON)
+
# Debug
option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF)
mark_as_advanced(WITH_CXX_GUARDEDALLOC)
@@ -1177,7 +1180,6 @@
# Blender Application
add_subdirectory(source/creator)
-
#-----------------------------------------------------------------------------
# Blender Player
if(WITH_PLAYER)
@@ -1185,5 +1187,12 @@
endif()
#-----------------------------------------------------------------------------
+# Cycles
+
+if(WITH_CYCLES)
+ add_subdirectory(intern/cycles)
+endif()
+
+#-----------------------------------------------------------------------------
# CPack for generating packages
include(build_files/cmake/packaging.cmake)
Modified: branches/cycles/intern/CMakeLists.txt
===================================================================
--- branches/cycles/intern/CMakeLists.txt 2011-04-28 13:01:29 UTC (rev 36373)
+++ branches/cycles/intern/CMakeLists.txt 2011-04-28 13:47:27 UTC (rev 36374)
@@ -52,3 +52,4 @@
if(WITH_IK_ITASC)
add_subdirectory(itasc)
endif()
+
Modified: branches/cycles/intern/cycles/CMakeLists.txt
===================================================================
--- branches/cycles/intern/cycles/CMakeLists.txt 2011-04-28 13:01:29 UTC (rev 36373)
+++ branches/cycles/intern/cycles/CMakeLists.txt 2011-04-28 13:47:27 UTC (rev 36374)
@@ -1,39 +1,58 @@
-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
INCLUDE(cmake/external_libs.cmake)
@@ -44,9 +63,9 @@
# Subdirectories
-IF(WITH_BLENDER)
+IF(WITH_CYCLES_BLENDER)
ADD_SUBDIRECTORY(blender)
-ENDIF(WITH_BLENDER)
+ENDIF(WITH_CYCLES_BLENDER)
ADD_SUBDIRECTORY(app)
ADD_SUBDIRECTORY(bvh)
Modified: branches/cycles/intern/cycles/app/CMakeLists.txt
===================================================================
--- branches/cycles/intern/cycles/app/CMakeLists.txt 2011-04-28 13:01:29 UTC (rev 36373)
+++ branches/cycles/intern/cycles/app/CMakeLists.txt 2011-04-28 13:47:27 UTC (rev 36374)
@@ -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)")
-
Modified: branches/cycles/intern/cycles/app/cycles_test.cpp
===================================================================
--- branches/cycles/intern/cycles/app/cycles_test.cpp 2011-04-28 13:01:29 UTC (rev 36373)
+++ branches/cycles/intern/cycles/app/cycles_test.cpp 2011-04-28 13:47:27 UTC (rev 36374)
@@ -185,7 +185,7 @@
{
options.width= 1024;
options.height= 512;
- options.filepath = path_get("../../../test/models/elephants.xml");
+ options.filepath = "";
options.session = NULL;
options.quiet = false;
Modified: branches/cycles/intern/cycles/blender/CMakeLists.txt
===================================================================
--- branches/cycles/intern/cycles/blender/CMakeLists.txt 2011-04-28 13:01:29 UTC (rev 36373)
+++ branches/cycles/intern/cycles/blender/CMakeLists.txt 2011-04-28 13:47:27 UTC (rev 36374)
@@ -32,12 +32,12 @@
${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 @@
${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)
Modified: branches/cycles/intern/cycles/bvh/CMakeLists.txt
===================================================================
--- branches/cycles/intern/cycles/bvh/CMakeLists.txt 2011-04-28 13:01:29 UTC (rev 36373)
+++ branches/cycles/intern/cycles/bvh/CMakeLists.txt 2011-04-28 13:47:27 UTC (rev 36374)
@@ -14,5 +14,5 @@
bvh_params.h
bvh_sort.h)
-ADD_LIBRARY(bvh ${sources} ${headers})
+ADD_LIBRARY(cycles_bvh ${sources} ${headers})
Deleted: branches/cycles/intern/cycles/cmake/create_dmg.py
===================================================================
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list