Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2020-09-04 19:41:10 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2020-09-04 18:10:50 +0300
commitf04260d8c679851be6a267214daacae44126156f (patch)
tree41ea1fca782f0e1f9fab299fe8d77f3b48a34295 /intern/cycles/app
parent417695e4a8bff7927a936797ca01c6461ce0eaf7 (diff)
CMake: refresh building and external library handling of Cycles standalone
* Support precompiled libraries on Linux * Add license headers * Refactoring to deduplicate code Includes work by Ray Molenkamp and Grische for precompiled libraries. Ref D8769
Diffstat (limited to 'intern/cycles/app')
-rw-r--r--intern/cycles/app/CMakeLists.txt128
1 files changed, 42 insertions, 86 deletions
diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt
index a2b0ed03925..67b852013f3 100644
--- a/intern/cycles/app/CMakeLists.txt
+++ b/intern/cycles/app/CMakeLists.txt
@@ -1,3 +1,20 @@
+# 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
+#####################################################################
set(INC
..
@@ -5,8 +22,6 @@ set(INC
set(INC_SYS
)
-# NOTE: LIBRARIES contains all the libraries which are common
-# across release and debug build types, stored in a linking order.
set(LIBRARIES
cycles_device
cycles_kernel
@@ -15,96 +30,33 @@ set(LIBRARIES
cycles_subd
cycles_graph
cycles_util
- ${BLENDER_GL_LIBRARIES}
- ${CYCLES_APP_GLEW_LIBRARY}
- ${PNG_LIBRARIES}
- ${JPEG_LIBRARIES}
- ${ZLIB_LIBRARIES}
- ${TIFF_LIBRARY}
- ${PTHREADS_LIBRARIES}
)
-if(WITH_CUDA_DYNLOAD)
- list(APPEND LIBRARIES extern_cuew)
-else()
- list(APPEND LIBRARIES ${CUDA_CUDA_LIBRARY})
-endif()
-
if(WITH_CYCLES_OSL)
list(APPEND LIBRARIES cycles_kernel_osl)
endif()
-if(NOT CYCLES_STANDALONE_REPOSITORY)
- list(APPEND LIBRARIES bf_intern_glew_mx bf_intern_guardedalloc bf_intern_numaapi bf_intern_sky)
-endif()
-
-if(WITH_CYCLES_LOGGING)
- list(APPEND LIBRARIES
- ${GLOG_LIBRARIES}
- ${GFLAGS_LIBRARIES}
- )
+if(CYCLES_STANDALONE_REPOSITORY)
+ list(APPEND LIBRARIES extern_sky)
+else()
+ list(APPEND LIBRARIES bf_intern_sky)
endif()
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
list(APPEND LIBRARIES ${GLUT_LIBRARIES})
endif()
-# Common configuration.
+list(APPEND LIBRARIES ${CYCLES_GL_LIBRARIES})
-link_directories(
- ${OPENIMAGEIO_LIBPATH}
- ${BOOST_LIBPATH}
- ${PNG_LIBPATH}
- ${JPEG_LIBPATH}
- ${ZLIB_LIBPATH}
- ${TIFF_LIBPATH}
- ${OPENEXR_LIBPATH}
- ${OPENJPEG_LIBPATH}
- ${OPENVDB_LIBPATH}
-)
+# Common configuration.
-if(WITH_OPENCOLORIO)
- link_directories(${OPENCOLORIO_LIBPATH})
-endif()
+cycles_link_directories()
add_definitions(${GL_DEFINITIONS})
include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
-# 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(${target} ${OSL_LIBRARIES} ${LLVM_LIBRARIES})
- endif()
- if(WITH_CYCLES_EMBREE)
- target_link_libraries(${target} ${EMBREE_LIBRARIES})
- endif()
- if(WITH_OPENSUBDIV)
- target_link_libraries(${target} ${OPENSUBDIV_LIBRARIES})
- endif()
- if(WITH_OPENCOLORIO)
- target_link_libraries(${target} ${OPENCOLORIO_LIBRARIES})
- endif()
- target_link_libraries(
- ${target}
- ${OPENIMAGEIO_LIBRARIES}
- ${OPENEXR_LIBRARIES}
- ${OPENJPEG_LIBRARIES}
- ${PUGIXML_LIBRARIES}
- ${BOOST_LIBRARIES}
- ${CMAKE_DL_LIBS}
- ${PLATFORM_LINKLIBS}
- )
-endmacro()
-
# Application build targets
if(WITH_CYCLES_STANDALONE)
@@ -113,20 +65,31 @@ if(WITH_CYCLES_STANDALONE)
cycles_xml.cpp
cycles_xml.h
)
- add_executable(cycles ${SRC})
+ add_executable(cycles ${SRC} ${INC} ${INC_SYS})
+ unset(SRC)
+
+ target_link_libraries(cycles ${LIBRARIES})
cycles_target_link_libraries(cycles)
if(UNIX AND NOT APPLE)
set_target_properties(cycles PROPERTIES INSTALL_RPATH $ORIGIN/lib)
endif()
- unset(SRC)
+
+ if(CYCLES_STANDALONE_REPOSITORY)
+ cycles_install_libraries(cycles)
+ endif()
endif()
+#####################################################################
+# Cycles network server executable
+#####################################################################
+
if(WITH_CYCLES_NETWORK)
set(SRC
cycles_server.cpp
)
add_executable(cycles_server ${SRC})
+ target_link_libraries(cycles_server ${LIBRARIES})
cycles_target_link_libraries(cycles_server)
if(UNIX AND NOT APPLE)
@@ -135,6 +98,10 @@ if(WITH_CYCLES_NETWORK)
unset(SRC)
endif()
+#####################################################################
+# Cycles cubin compiler executable
+#####################################################################
+
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
@@ -151,18 +118,7 @@ if(WITH_CYCLES_CUBIN_COMPILER)
)
add_executable(cycles_cubin_cc ${SRC})
include_directories(${INC})
- target_link_libraries(cycles_cubin_cc
- extern_cuew
- ${OPENIMAGEIO_LIBRARIES}
- ${OPENEXR_LIBRARIES}
- ${OPENJPEG_LIBRARIES}
- ${PUGIXML_LIBRARIES}
- ${BOOST_LIBRARIES}
- ${PLATFORM_LINKLIBS}
- )
- if(NOT CYCLES_STANDALONE_REPOSITORY)
- target_link_libraries(cycles_cubin_cc bf_intern_guardedalloc)
- endif()
+ cycles_target_link_libraries(cycles_cubin_cc)
unset(SRC)
unset(INC)
endif()