4f547a5b6448eefeef60bf57c9b0f33016cb7ac8
[blender.git] / intern / cycles / cmake / external_libs.cmake
1
2 ###########################################################################
3 # GLUT
4
5 if(WITH_CYCLES_TEST)
6         set(GLUT_ROOT_PATH ${CYCLES_GLUT})
7
8         find_package(GLUT)
9         message(STATUS "GLUT_FOUND=${GLUT_FOUND}")
10
11         include_directories(${GLUT_INCLUDE_DIR})
12 endif()
13
14 if(WITH_SYSTEM_GLEW)
15         set(CYCLES_GLEW_LIBRARY ${GLEW_LIBRARY})
16 else()
17         set(CYCLES_GLEW_LIBRARY extern_glew)
18 endif()
19
20 ###########################################################################
21 # OpenShadingLanguage
22
23 if(WITH_CYCLES_OSL)
24
25         set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
26
27         message(STATUS "CYCLES_OSL = ${CYCLES_OSL}")
28
29         find_library(OSL_LIBRARIES NAMES oslexec oslcomp oslquery PATHS ${CYCLES_OSL}/lib ${CYCLES_OSL}/dist)
30         find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include ${CYCLES_OSL}/dist)
31         find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin ${CYCLES_OSL}/dist)
32
33         if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)
34                 set(OSL_FOUND TRUE)
35                 message(STATUS "OSL includes = ${OSL_INCLUDES}")
36                 message(STATUS "OSL library = ${OSL_LIBRARIES}")
37                 message(STATUS "OSL compiler = ${OSL_COMPILER}")
38         else()
39                 message(STATUS "OSL not found")
40         endif()
41
42         include_directories(${OSL_INCLUDES} ${OSL_INCLUDES}/OSL ${OSL_INCLUDES}/../../../src/liboslexec)
43
44 endif()
45
46 ###########################################################################
47 # Partio
48
49 if(WITH_CYCLES_PARTIO)
50
51         set(CYCLES_PARTIO "" CACHE PATH "Path to Partio installation")
52
53         message(STATUS "CYCLES_PARTIO = ${CYCLES_PARTIO}")
54
55         find_library(PARTIO_LIBRARIES NAMES partio PATHS ${CYCLES_PARTIO}/lib)
56         find_path(PARTIO_INCLUDES Partio.h ${CYCLES_PARTIO}/include)
57
58         find_package(ZLIB)
59
60         if(PARTIO_INCLUDES AND PARTIO_LIBRARIES AND ZLIB_LIBRARIES)
61                 list(APPEND PARTIO_LIBRARIES ${ZLIB_LIBRARIES})
62                 set(PARTIO_FOUND TRUE)
63                 message(STATUS "PARTIO includes = ${PARTIO_INCLUDES}")
64                 message(STATUS "PARTIO library = ${PARTIO_LIBRARIES}")
65         else()
66                 message(STATUS "PARTIO not found")
67         endif()
68
69         include_directories(${PARTIO_INCLUDES})
70
71 endif()
72
73 ###########################################################################
74 # CUDA
75
76 if(WITH_CYCLES_CUDA_BINARIES)
77         find_package(CUDA) # Try to auto locate CUDA toolkit
78         if(CUDA_FOUND)
79                 message(STATUS "CUDA nvcc = ${CUDA_NVCC_EXECUTABLE}")
80         else()
81                 message(STATUS "CUDA compiler not found, disabling WITH_CYCLES_CUDA_BINARIES")
82                 set(WITH_CYCLES_CUDA_BINARIES OFF)
83         endif()
84 endif()
85