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

CMakeLists.txt « app « cycles « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: aabb8f63640eebf6eddf9d6cc93ebd1471d91f1b (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125

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
	cycles_render
	cycles_bvh
	cycles_subd
	cycles_graph
	cycles_util
	${BLENDER_GL_LIBRARIES}
	${CYCLES_APP_GLEW_LIBRARY}
	${PNG_LIBRARIES}
	${JPEG_LIBRARIES}
	${ZLIB_LIBRARIES}
	${TIFF_LIBRARY}
	${PTHREADS_LIBRARIES}
	extern_clew
)

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(CYCLES_STANDALONE_REPOSITORY)
	if(WITH_CYCLES_LOGGING)
		list(APPEND LIBRARIES
			${GLOG_LIBRARIES}
			${GFLAGS_LIBRARIES}
		)
	endif()
else()
	list(APPEND LIBRARIES bf_intern_glew_mx bf_intern_guardedalloc)
	if(WITH_CYCLES_LOGGING)
		list(APPEND LIBRARIES extern_glog extern_gflags)
	endif()
endif()

if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
	list(APPEND LIBRARIES ${GLUT_LIBRARIES})
endif()

# Common configuration.

link_directories(${OPENIMAGEIO_LIBPATH}
                 ${BOOST_LIBPATH}
                 ${PNG_LIBPATH}
                 ${JPEG_LIBPATH}
                 ${ZLIB_LIBPATH}
                 ${TIFF_LIBPATH}
                 ${OPENEXR_LIBPATH})

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_OPENSUBDIV)
		target_link_libraries(${target} ${OPENSUBDIV_LIBRARIES})
	endif()
	target_link_libraries(
		${target}
		${OPENIMAGEIO_LIBRARIES}
		${OPENEXR_LIBRARIES}
		${PUGIXML_LIBRARIES}
		${BOOST_LIBRARIES}
		${CMAKE_DL_LIBS}
		${PLATFORM_LINKLIBS}
	)
endmacro()

# Application build targets

if(WITH_CYCLES_STANDALONE)
	set(SRC
		cycles_standalone.cpp
		cycles_xml.cpp
		cycles_xml.h
	)
	add_executable(cycles ${SRC})
	cycles_target_link_libraries(cycles)

	if(UNIX AND NOT APPLE)
		set_target_properties(cycles PROPERTIES INSTALL_RPATH $ORIGIN/lib)
	endif()
	unset(SRC)
endif()

if(WITH_CYCLES_NETWORK)
	set(SRC
		cycles_server.cpp
	)
	add_executable(cycles_server ${SRC})
	cycles_target_link_libraries(cycles_server)

	if(UNIX AND NOT APPLE)
		set_target_properties(cycles_server PROPERTIES INSTALL_RPATH $ORIGIN/lib)
	endif()
	unset(SRC)
endif()