
* Add back option to bundle CUDA kernel binaries with builds. * Disable runtime CUDA kernel compilation on Windows, couldn't get this working, since it seems to depend on visual studio being installed, even though for this particular case it shouldn't be needed. CMake only at the moment. * Runtime compilation on linux/mac should now work if nvcc is not installed in the default location, but available in PATH.
80 lines
1.8 KiB
CMake
80 lines
1.8 KiB
CMake
|
|
set(CYCLES_INSTALL_PATH "scripts/addons/cycles")
|
|
set(WITH_CYCLES_BLENDER ON)
|
|
|
|
# External Libraries
|
|
|
|
include(cmake/external_libs.cmake)
|
|
|
|
# Build Flags
|
|
|
|
set(GCC_OPTIM_FLAGS "-ffast-math -msse -msse2 -msse3 -mtune=native")
|
|
|
|
if(APPLE)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_OPTIM_FLAGS}")
|
|
set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
|
|
endif()
|
|
|
|
if(WIN32)
|
|
if(MSVC)
|
|
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")
|
|
elseif(CMAKE_COMPILER_IS_GNUCC)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_OPTIM_FLAGS}")
|
|
set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
|
|
endif()
|
|
endif()
|
|
|
|
if(UNIX AND NOT APPLE)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_OPTIM_FLAGS}")
|
|
set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
|
|
endif()
|
|
|
|
# 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()
|
|
|
|
if(WITH_CYCLES_OSL)
|
|
add_definitions(-DWITH_OSL)
|
|
endif()
|
|
|
|
if(WITH_CYCLES_PARTIO)
|
|
add_definitions(-DWITH_PARTIO)
|
|
endif()
|
|
|
|
if(WITH_CYCLES_CUDA_BINARIES)
|
|
add_definitions(-DWITH_CUDA_BINARIES)
|
|
endif()
|
|
|
|
add_definitions(-DWITH_OPENCL)
|
|
add_definitions(-DWITH_CUDA)
|
|
add_definitions(-DWITH_MULTI)
|
|
|
|
include_directories(
|
|
${BOOST_INCLUDE_DIR}
|
|
${OPENIMAGEIO_INCLUDE_DIRS}
|
|
${OPENIMAGEIO_INCLUDE_DIRS}/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)
|
|
|