2020-09-04 16:41:10 +00:00
|
|
|
# Copyright 2011-2020 Blender Foundation
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
# Cycles standalone executable
|
|
|
|
#####################################################################
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
set(INC
|
2017-03-29 14:53:46 +00:00
|
|
|
..
|
2011-11-08 20:27:37 +00:00
|
|
|
)
|
2012-09-20 09:04:43 +00:00
|
|
|
set(INC_SYS
|
|
|
|
)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
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
|
2016-05-07 17:47:37 +00:00
|
|
|
cycles_graph
|
2011-04-28 13:47:27 +00:00
|
|
|
cycles_util
|
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()
|
|
|
|
|
2020-09-04 16:41:10 +00:00
|
|
|
if(CYCLES_STANDALONE_REPOSITORY)
|
|
|
|
list(APPEND LIBRARIES extern_sky)
|
|
|
|
else()
|
|
|
|
list(APPEND LIBRARIES bf_intern_sky)
|
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()
|
|
|
|
|
2020-09-04 16:41:10 +00:00
|
|
|
list(APPEND LIBRARIES ${CYCLES_GL_LIBRARIES})
|
2014-10-07 20:46:19 +00:00
|
|
|
|
2020-09-04 16:41:10 +00:00
|
|
|
# Common configuration.
|
2011-08-16 16:15:34 +00:00
|
|
|
|
2020-09-04 16:41:10 +00:00
|
|
|
cycles_link_directories()
|
2018-07-09 14:25:22 +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
|
|
|
# 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
|
|
|
|
)
|
2020-09-04 16:41:10 +00:00
|
|
|
add_executable(cycles ${SRC} ${INC} ${INC_SYS})
|
|
|
|
unset(SRC)
|
|
|
|
|
|
|
|
target_link_libraries(cycles ${LIBRARIES})
|
2014-12-07 10:04:02 +00:00
|
|
|
cycles_target_link_libraries(cycles)
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2021-05-03 20:07:09 +00:00
|
|
|
if(APPLE)
|
|
|
|
if(WITH_OPENCOLORIO)
|
|
|
|
set_property(TARGET cycles APPEND_STRING PROPERTY LINK_FLAGS " -framework IOKit")
|
|
|
|
endif()
|
|
|
|
if(WITH_OPENIMAGEDENOISE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
|
|
|
|
# OpenImageDenoise uses BNNS from the Accelerate framework.
|
|
|
|
set_property(TARGET cycles APPEND_STRING PROPERTY LINK_FLAGS " -framework Accelerate")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
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()
|
2020-09-04 16:41:10 +00:00
|
|
|
|
|
|
|
if(CYCLES_STANDALONE_REPOSITORY)
|
|
|
|
cycles_install_libraries(cycles)
|
|
|
|
endif()
|
2011-08-16 16:15:34 +00:00
|
|
|
endif()
|
|
|
|
|
2020-09-04 16:41:10 +00:00
|
|
|
#####################################################################
|
|
|
|
# Cycles network server executable
|
|
|
|
#####################################################################
|
|
|
|
|
2011-08-16 16:15:34 +00:00
|
|
|
if(WITH_CYCLES_NETWORK)
|
2011-11-08 20:27:37 +00:00
|
|
|
set(SRC
|
|
|
|
cycles_server.cpp
|
|
|
|
)
|
|
|
|
add_executable(cycles_server ${SRC})
|
2020-09-04 16:41:10 +00:00
|
|
|
target_link_libraries(cycles_server ${LIBRARIES})
|
2014-12-07 10:04:02 +00:00
|
|
|
cycles_target_link_libraries(cycles_server)
|
2019-04-17 04:17:24 +00:00
|
|
|
|
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()
|
2018-02-03 17:59:09 +00:00
|
|
|
|
2020-09-04 16:41:10 +00:00
|
|
|
#####################################################################
|
|
|
|
# Cycles cubin compiler executable
|
|
|
|
#####################################################################
|
|
|
|
|
2018-02-03 17:59:09 +00:00
|
|
|
if(WITH_CYCLES_CUBIN_COMPILER)
|
|
|
|
# 32 bit windows is special, nvrtc is not supported on x86, so even
|
|
|
|
# though we are building 32 bit blender a 64 bit cubin_cc will have
|
|
|
|
# to be build to compile the cubins.
|
|
|
|
if(MSVC AND NOT CMAKE_CL_64)
|
2018-02-06 14:19:25 +00:00
|
|
|
message("Building with CUDA not supported on 32 bit, skipped")
|
2018-09-04 22:58:41 +00:00
|
|
|
set(WITH_CYCLES_CUDA_BINARIES OFF CACHE BOOL "" FORCE)
|
2018-02-03 17:59:09 +00:00
|
|
|
else()
|
2018-02-09 02:48:34 +00:00
|
|
|
set(SRC
|
|
|
|
cycles_cubin_cc.cpp
|
|
|
|
)
|
|
|
|
set(INC
|
|
|
|
../../../extern/cuew/include
|
|
|
|
)
|
2018-02-03 17:59:09 +00:00
|
|
|
add_executable(cycles_cubin_cc ${SRC})
|
|
|
|
include_directories(${INC})
|
2020-09-04 16:41:10 +00:00
|
|
|
cycles_target_link_libraries(cycles_cubin_cc)
|
2018-02-03 17:59:09 +00:00
|
|
|
unset(SRC)
|
|
|
|
unset(INC)
|
|
|
|
endif()
|
|
|
|
endif()
|