2011-04-27 11:58:34 +00:00
|
|
|
|
2014-01-20 19:41:54 +00:00
|
|
|
# Standalone or with Blender
|
|
|
|
if(NOT WITH_BLENDER AND WITH_CYCLES_STANDALONE)
|
|
|
|
set(CYCLES_INSTALL_PATH "")
|
|
|
|
else()
|
|
|
|
set(WITH_CYCLES_BLENDER ON)
|
|
|
|
set(CYCLES_INSTALL_PATH "scripts/addons/cycles")
|
|
|
|
endif()
|
2011-08-16 16:15:34 +00:00
|
|
|
|
|
|
|
# External Libraries
|
|
|
|
|
|
|
|
include(cmake/external_libs.cmake)
|
|
|
|
|
|
|
|
# Build Flags
|
|
|
|
|
2011-12-01 16:33:21 +00:00
|
|
|
if(WIN32 AND MSVC)
|
2013-06-18 13:19:16 +00:00
|
|
|
# there is no /arch:SSE3, but intrinsics are available anyway
|
2013-08-31 03:18:55 +00:00
|
|
|
if(CMAKE_CL_64)
|
|
|
|
set(CYCLES_SSE2_KERNEL_FLAGS "/fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
|
|
|
|
set(CYCLES_SSE3_KERNEL_FLAGS "/fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
|
2013-11-22 13:16:47 +00:00
|
|
|
set(CYCLES_SSE41_KERNEL_FLAGS "/fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
|
2014-01-16 16:04:11 +00:00
|
|
|
set(CYCLES_AVX_KERNEL_FLAGS "/fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-") #/arch:AVX for VC2012 and above
|
2013-08-31 03:18:55 +00:00
|
|
|
else()
|
|
|
|
set(CYCLES_SSE2_KERNEL_FLAGS "/arch:SSE2 /fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
|
|
|
|
set(CYCLES_SSE3_KERNEL_FLAGS "/arch:SSE2 /fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
|
2013-11-22 13:16:47 +00:00
|
|
|
set(CYCLES_SSE41_KERNEL_FLAGS "/arch:SSE2 /fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
|
2014-01-16 16:04:11 +00:00
|
|
|
set(CYCLES_AVX_KERNEL_FLAGS "/arch:SSE2 /fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-") #/arch:AVX for VC2012 and above
|
2013-08-31 03:18:55 +00:00
|
|
|
endif()
|
2013-06-19 17:54:26 +00:00
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
|
2013-06-19 17:17:51 +00:00
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ox")
|
2013-08-05 12:02:43 +00:00
|
|
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Ox")
|
|
|
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /Ox")
|
2011-12-01 16:33:21 +00:00
|
|
|
elseif(CMAKE_COMPILER_IS_GNUCC)
|
2013-02-04 16:12:37 +00:00
|
|
|
set(CYCLES_SSE2_KERNEL_FLAGS "-ffast-math -msse -msse2 -mfpmath=sse")
|
2013-06-18 10:05:47 +00:00
|
|
|
set(CYCLES_SSE3_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3 -mfpmath=sse")
|
2013-11-22 13:16:47 +00:00
|
|
|
set(CYCLES_SSE41_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3 -msse4.1 -mfpmath=sse")
|
2014-01-16 16:04:11 +00:00
|
|
|
set(CYCLES_AVX_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3 -msse4.1 -mavx -mfpmath=sse")
|
2011-12-01 16:33:21 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
|
2013-07-07 18:29:57 +00:00
|
|
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
set(CYCLES_SSE2_KERNEL_FLAGS "-ffast-math -msse -msse2")
|
|
|
|
set(CYCLES_SSE3_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3")
|
2013-11-22 13:16:47 +00:00
|
|
|
set(CYCLES_SSE41_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3 -msse4.1")
|
2014-01-16 17:32:39 +00:00
|
|
|
set(CYCLES_AVX_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3 -msse4.1 -mavx")
|
2013-07-07 18:29:57 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
|
2011-11-08 20:27:37 +00:00
|
|
|
endif()
|
2011-04-28 13:47:27 +00:00
|
|
|
|
2012-09-03 11:38:20 +00:00
|
|
|
# for OSL
|
2012-11-26 13:48:48 +00:00
|
|
|
if(WIN32 AND MSVC)
|
|
|
|
set(RTTI_DISABLE_FLAGS "/GR- -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
|
2012-11-29 12:22:07 +00:00
|
|
|
elseif(CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
2012-11-26 13:48:48 +00:00
|
|
|
set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
|
|
|
|
endif()
|
2011-11-10 14:32:16 +00:00
|
|
|
|
2011-08-16 16:15:34 +00:00
|
|
|
# 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)
|
2011-12-29 01:46:58 +00:00
|
|
|
add_definitions(-DWITH_NETWORK)
|
2011-04-28 13:47:27 +00:00
|
|
|
endif()
|
|
|
|
|
2014-01-20 20:12:28 +00:00
|
|
|
if(WITH_CYCLES_STANDALONE_GUI)
|
|
|
|
add_definitions(-DWITH_CYCLES_STANDALONE_GUI)
|
|
|
|
endif()
|
|
|
|
|
2013-11-28 00:38:23 +00:00
|
|
|
if(WITH_CYCLES_PTEX)
|
|
|
|
add_definitions(-DWITH_PTEX)
|
|
|
|
endif()
|
|
|
|
|
2013-11-28 01:10:02 +00:00
|
|
|
if(WITH_CYCLES_OPENSUBDIV)
|
|
|
|
add_definitions(-DWITH_OPENSUBDIV)
|
|
|
|
endif()
|
|
|
|
|
2011-08-16 16:15:34 +00:00
|
|
|
if(WITH_CYCLES_OSL)
|
2011-12-29 01:46:58 +00:00
|
|
|
add_definitions(-DWITH_OSL)
|
2013-01-30 21:58:47 +00:00
|
|
|
add_definitions(-DOSL_STATIC_LIBRARY)
|
2012-10-20 12:17:45 +00:00
|
|
|
include_directories(${OSL_INCLUDES})
|
2011-08-16 16:15:34 +00:00
|
|
|
endif()
|
|
|
|
|
2011-09-02 14:55:06 +00:00
|
|
|
add_definitions(-DWITH_OPENCL)
|
2011-09-09 12:04:39 +00:00
|
|
|
add_definitions(-DWITH_CUDA)
|
2011-09-12 13:13:56 +00:00
|
|
|
add_definitions(-DWITH_MULTI)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-16 16:15:34 +00:00
|
|
|
include_directories(
|
2012-09-20 09:04:43 +00:00
|
|
|
SYSTEM
|
2011-08-16 16:15:34 +00:00
|
|
|
${BOOST_INCLUDE_DIR}
|
2011-09-18 04:55:22 +00:00
|
|
|
${OPENIMAGEIO_INCLUDE_DIRS}
|
2012-09-24 19:06:28 +00:00
|
|
|
${OPENIMAGEIO_INCLUDE_DIRS}/OpenImageIO
|
2014-01-27 18:11:36 +00:00
|
|
|
${OPENEXR_INCLUDE_DIR}
|
2014-01-27 14:25:22 +00:00
|
|
|
${OPENEXR_INCLUDE_DIRS})
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
# Subdirectories
|
|
|
|
|
2011-08-16 16:15:34 +00:00
|
|
|
if(WITH_CYCLES_BLENDER)
|
2011-11-18 21:06:36 +00:00
|
|
|
add_subdirectory(blender)
|
2012-06-01 14:59:06 +00:00
|
|
|
endif()
|
2011-08-16 16:15:34 +00:00
|
|
|
|
2013-08-27 02:37:48 +00:00
|
|
|
if(WITH_CYCLES_STANDALONE OR WITH_CYCLES_NETWORK)
|
2012-11-09 18:31:04 +00:00
|
|
|
add_subdirectory(app)
|
|
|
|
endif()
|
|
|
|
|
2011-08-16 16:15:34 +00:00
|
|
|
add_subdirectory(bvh)
|
|
|
|
add_subdirectory(device)
|
|
|
|
add_subdirectory(doc)
|
|
|
|
add_subdirectory(kernel)
|
|
|
|
add_subdirectory(render)
|
|
|
|
add_subdirectory(subd)
|
|
|
|
add_subdirectory(util)
|
2011-11-10 12:52:17 +00:00
|
|
|
|
2014-01-20 19:41:54 +00:00
|
|
|
if(NOT WITH_BLENDER AND WITH_CYCLES_STANDALONE)
|
|
|
|
delayed_do_install(${CMAKE_BINARY_DIR}/bin)
|
|
|
|
endif()
|
|
|
|
|