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

opensubdiv.cmake « cmake « build_environment « build_files - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5a3a4d142fad4adadb079c54ed73220a7c36f981 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****

set(OPENSUBDIV_EXTRA_ARGS
	-DNO_EXAMPLES=ON
	-DNO_REGRESSION=ON
	-DNO_PYTHON=ON
	-DNO_MAYA=ON
	-DNO_PTEX=ON
	-DNO_DOC=ON
	-DNO_CLEW=OFF
	-DNO_OPENCL=OFF
	-DNO_TUTORIALS=ON
	-DGLEW_INCLUDE_DIR=${LIBDIR}/glew/include
	-DGLEW_LIBRARY=${LIBDIR}/glew/lib/libGLEW${LIBEXT}
	-DGLFW_INCLUDE_DIR=${LIBDIR}/glfw/include
	-DGLFW_LIBRARIES=${LIBDIR}/glfw/lib/glfw3${LIBEXT}
)

if(WIN32)
	#no cuda support for vc15 yet
	if(msvc15)
		set(OPENSUBDIV_CUDA ON)
	else()
		set(OPENSUBDIV_CUDA ON)
	endif()

	set(OPENSUBDIV_EXTRA_ARGS
		${OPENSUBDIV_EXTRA_ARGS}
		-DNO_CUDA=${OPENSUBDIV_CUDA}
		-DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/cl
		-DCLEW_LIBRARY=${LIBDIR}/clew/lib/clew${LIBEXT}
		-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
		-DCUEW_LIBRARY=${LIBDIR}/cuew/lib/cuew${LIBEXT}
		-DCMAKE_EXE_LINKER_FLAGS_RELEASE=libcmt.lib
	)
else()
	set(OPENSUBDIV_EXTRA_ARGS
		${OPENSUBDIV_EXTRA_ARGS}
		-DNO_CUDA=ON
		-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
		-DCLEW_LIBRARY=${LIBDIR}/clew/lib/static/${LIBPREFIX}clew${LIBEXT}
	)
endif()

ExternalProject_Add(external_opensubdiv
	URL ${OPENSUBDIV_URI}
	DOWNLOAD_DIR ${DOWNLOAD_DIR}
	URL_HASH MD5=${OPENSUBDIV_Hash}
	PREFIX ${BUILD_DIR}/opensubdiv
	PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/opensubdiv/src/external_opensubdiv < ${PATCH_DIR}/opensubdiv.diff
	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opensubdiv -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${OPENSUBDIV_EXTRA_ARGS}
	INSTALL_DIR ${LIBDIR}/opensubdiv
)

add_dependencies(external_opensubdiv external_glew external_glfw external_clew external_cuew)