2011-04-27 11:58:34 +00:00
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
set(INC
|
2011-04-28 13:47:27 +00:00
|
|
|
.
|
|
|
|
../device
|
|
|
|
../kernel
|
|
|
|
../kernel/svm
|
|
|
|
../bvh
|
|
|
|
../util
|
|
|
|
../render
|
2011-11-08 20:27:37 +00:00
|
|
|
../subd
|
|
|
|
)
|
2012-09-20 09:04:43 +00:00
|
|
|
set(INC_SYS
|
|
|
|
)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2014-12-07 13:11:11 +00:00
|
|
|
# NOTE: LIBRARIES contains all the libraries which are common
|
|
|
|
# across release and debug build types, stored in a linking order.
|
2011-08-16 16:15:34 +00:00
|
|
|
set(LIBRARIES
|
2011-04-28 13:47:27 +00:00
|
|
|
cycles_device
|
|
|
|
cycles_kernel
|
|
|
|
cycles_render
|
|
|
|
cycles_bvh
|
|
|
|
cycles_subd
|
|
|
|
cycles_util
|
2014-10-07 20:46:19 +00:00
|
|
|
${BLENDER_GL_LIBRARIES}
|
|
|
|
${CYCLES_APP_GLEW_LIBRARY}
|
2013-08-31 02:56:03 +00:00
|
|
|
${PNG_LIBRARIES}
|
|
|
|
${JPEG_LIBRARIES}
|
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
${TIFF_LIBRARY}
|
2014-11-15 18:03:45 +00:00
|
|
|
${PTHREADS_LIBRARIES}
|
2014-08-05 07:57:50 +00:00
|
|
|
extern_clew
|
|
|
|
extern_cuew
|
2011-11-08 20:27:37 +00:00
|
|
|
)
|
2011-05-01 10:00:21 +00:00
|
|
|
|
2014-12-07 13:11:11 +00:00
|
|
|
if(WITH_CYCLES_OSL)
|
|
|
|
list(APPEND LIBRARIES cycles_kernel_osl)
|
2014-11-15 17:56:22 +00:00
|
|
|
endif()
|
|
|
|
|
2014-11-15 20:12:19 +00:00
|
|
|
if(CYCLES_STANDALONE_REPOSITORY)
|
|
|
|
if(WITH_CYCLES_LOGGING)
|
|
|
|
list(APPEND LIBRARIES
|
|
|
|
${GLOG_LIBRARIES}
|
|
|
|
${GFLAGS_LIBRARIES}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
else()
|
2014-12-29 09:48:21 +00:00
|
|
|
list(APPEND LIBRARIES bf_intern_glew_mx)
|
2015-02-14 16:32:38 +00:00
|
|
|
if(WITH_CYCLES_LOGGING)
|
|
|
|
list(APPEND LIBRARIES extern_glog)
|
|
|
|
endif()
|
2014-12-29 09:48:21 +00:00
|
|
|
endif()
|
|
|
|
|
2014-12-07 13:11:11 +00:00
|
|
|
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
|
|
|
|
list(APPEND LIBRARIES ${GLUT_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Common configuration.
|
2014-10-07 20:46:19 +00:00
|
|
|
|
2014-12-29 09:48:21 +00:00
|
|
|
link_directories(${OPENIMAGEIO_LIBPATH}
|
|
|
|
${BOOST_LIBPATH}
|
|
|
|
${PNG_LIBPATH}
|
|
|
|
${JPEG_LIBPATH}
|
|
|
|
${ZLIB_LIBPATH}
|
|
|
|
${TIFF_LIBPATH}
|
|
|
|
${OPENEXR_LIBPATH})
|
2011-08-16 16:15:34 +00:00
|
|
|
|
2014-12-07 13:11:11 +00:00
|
|
|
add_definitions(${GL_DEFINITIONS})
|
2011-08-16 16:15:34 +00:00
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
include_directories(${INC})
|
2012-09-20 09:04:43 +00:00
|
|
|
include_directories(SYSTEM ${INC_SYS})
|
2011-11-08 20:27:37 +00:00
|
|
|
|
2014-12-07 13:11:11 +00:00
|
|
|
# Make sure given target is linked against proper libraries
|
|
|
|
# which varies across debug and release build types.
|
|
|
|
#
|
|
|
|
# This will also make sure dependencies of that libraries
|
|
|
|
# are sent to the linker after them.
|
|
|
|
#
|
|
|
|
# TODO(sergey): Think of a better place for this?
|
|
|
|
macro(cycles_target_link_libraries target)
|
|
|
|
target_link_libraries(${target} ${LIBRARIES})
|
|
|
|
if(WITH_CYCLES_OSL)
|
|
|
|
target_link_libraries_decoupled(${target} OSL_LIBRARIES)
|
|
|
|
if(MSVC)
|
|
|
|
target_link_libraries_debug(${target} "${LLVM_LIBRARIES_DEBUG}")
|
|
|
|
target_link_libraries_optimized(${target} "${LLVM_LIBRARIES}")
|
|
|
|
else()
|
|
|
|
target_link_libraries(${target} ${LLVM_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
target_link_libraries_decoupled(${target} OPENIMAGEIO_LIBRARIES)
|
|
|
|
target_link_libraries_decoupled(${target} OPENEXR_LIBRARIES)
|
|
|
|
target_link_libraries(
|
|
|
|
${target}
|
|
|
|
${PUGIXML_LIBRARIES}
|
|
|
|
${BOOST_LIBRARIES}
|
|
|
|
${CMAKE_DL_LIBS}
|
|
|
|
${PLATFORM_LINKLIBS}
|
|
|
|
)
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
# Application build targets
|
|
|
|
|
2013-08-27 02:37:48 +00:00
|
|
|
if(WITH_CYCLES_STANDALONE)
|
2011-11-08 20:27:37 +00:00
|
|
|
set(SRC
|
2013-08-27 02:37:48 +00:00
|
|
|
cycles_standalone.cpp
|
2011-11-08 20:27:37 +00:00
|
|
|
cycles_xml.cpp
|
|
|
|
cycles_xml.h
|
|
|
|
)
|
2013-08-27 02:37:48 +00:00
|
|
|
add_executable(cycles ${SRC})
|
2014-12-07 10:04:02 +00:00
|
|
|
cycles_target_link_libraries(cycles)
|
2011-08-16 16:15:34 +00:00
|
|
|
|
|
|
|
if(UNIX AND NOT APPLE)
|
2013-08-27 02:37:48 +00:00
|
|
|
set_target_properties(cycles PROPERTIES INSTALL_RPATH $ORIGIN/lib)
|
2011-08-16 16:15:34 +00:00
|
|
|
endif()
|
2011-11-08 20:27:37 +00:00
|
|
|
unset(SRC)
|
2011-08-16 16:15:34 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_CYCLES_NETWORK)
|
2011-11-08 20:27:37 +00:00
|
|
|
set(SRC
|
|
|
|
cycles_server.cpp
|
|
|
|
)
|
|
|
|
add_executable(cycles_server ${SRC})
|
2014-12-07 10:04:02 +00:00
|
|
|
cycles_target_link_libraries(cycles_server)
|
2011-08-16 16:15:34 +00:00
|
|
|
|
|
|
|
if(UNIX AND NOT APPLE)
|
|
|
|
set_target_properties(cycles_server PROPERTIES INSTALL_RPATH $ORIGIN/lib)
|
|
|
|
endif()
|
2011-11-08 20:27:37 +00:00
|
|
|
unset(SRC)
|
2011-08-16 16:15:34 +00:00
|
|
|
endif()
|