diff options
Diffstat (limited to 'intern/cycles/CMakeLists.txt')
-rw-r--r-- | intern/cycles/CMakeLists.txt | 135 |
1 files changed, 67 insertions, 68 deletions
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index 413952e8791..77ae0486d16 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -1,81 +1,80 @@ -SET(CYCLES_VERSION_MAJOR 0) -SET(CYCLES_VERSION_MINOR 0) -SET(CYCLES_VERSION ${CYCLES_VERSION_MAJOR}.${CYCLES_VERSION_MINOR}) - -# Options - -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_TEST "Build cycles test application" OFF) - -# Flags - -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 - -IF(UNIX AND NOT APPLE) - SET(CYCLES_OIIO "" CACHE PATH "Path to OpenImageIO installation") - SET(CYCLES_BOOST "/usr" CACHE PATH "Path to Boost installation") -ENDIF() - -SET(CYCLES_OSL "" CACHE PATH "Path to OpenShadingLanguage 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 GLEW 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() +set(CYCLES_INSTALL_PATH "scripts/addons/cycles") + +# External Libraries + +include(cmake/external_libs.cmake) + +# Build Flags + +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) + set(CMAKE_CXX_FLAGS "${GCC_WARNING_FLAGS} ${GCC_OPTIM_FLAGS}") + set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID") +endif(APPLE) + +if(WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Ox /Ot /arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /EHsc /fp:fast") + set(RTTI_DISABLE_FLAGS "/GR- -DBOOST_NO_RTTI -DBOOST_NO_TYPEID") +endif(WIN32) 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}) + set(CMAKE_CXX_FLAGS "${GCC_WARNING_FLAGS} ${GCC_OPTIM_FLAGS}") + set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID") +endif(UNIX AND NOT APPLE) + +# Definitions and Includes + +add_definitions(${BOOST_DEFINITIONS} ${OPENIMAGEIO_DEFINITIONS}) + +add_definitions(-DCCL_NAMESPACE_BEGIN=namespace\ ccl\ {) +add_definitions(-DCCL_NAMESPACE_END=}) + +if(WITH_CYCLES_NETWORK) + add_definitions(-DWITH_NETWORK) endif() -SET(CYCLES_INSTALL_PATH "${TARGETDIR_VER}/scripts/addons") +if(WITH_CYCLES_MULTI) + add_definitions(-DWITH_MULTI) +endif() -# External Libraries +if(WITH_CYCLES_CUDA) + add_definitions(-DWITH_CUDA) +endif() -INCLUDE(cmake/external_libs.cmake) +if(WITH_CYCLES_OSL) + add_definitions(-DWITH_OSL) +endif() + +if(WITH_CYCLES_PARTIO) + add_definitions(-DWITH_PARTIO) +endif() -# Platforms +if(WITH_CYCLES_OPENCL) + add_definitions(-DWITH_OPENCL) + include_directories(${OPENCL_INCLUDE_DIR}) + +endif() -INCLUDE(cmake/platforms.cmake) +include_directories( + ${BOOST_INCLUDE_DIR} + ${OPENIMAGEIO_INCLUDE_DIR} + ${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO) # Subdirectories -IF(WITH_CYCLES_BLENDER) - ADD_SUBDIRECTORY(blender) -ENDIF(WITH_CYCLES_BLENDER) - -ADD_SUBDIRECTORY(app) -ADD_SUBDIRECTORY(bvh) -ADD_SUBDIRECTORY(device) -ADD_SUBDIRECTORY(doc) -ADD_SUBDIRECTORY(kernel) -ADD_SUBDIRECTORY(render) -ADD_SUBDIRECTORY(subd) -ADD_SUBDIRECTORY(util) +if(WITH_CYCLES_BLENDER) + add_subdirectory(blender) +endif(WITH_CYCLES_BLENDER) + +add_subdirectory(app) +add_subdirectory(bvh) +add_subdirectory(device) +add_subdirectory(doc) +add_subdirectory(kernel) +add_subdirectory(render) +add_subdirectory(subd) +add_subdirectory(util) |