2012-06-09 20:40:48 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# Copyright 2013 Pixar
|
2012-06-09 20:40:48 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
|
|
|
# with the following modification; you may not use this file except in
|
|
|
|
# compliance with the Apache License and the following modification to it:
|
|
|
|
# Section 6. Trademarks. is deleted and replaced with:
|
2012-06-09 20:40:48 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# 6. Trademarks. This License does not grant permission to use the trade
|
|
|
|
# names, trademarks, service marks, or product names of the Licensor
|
|
|
|
# and its affiliates, except as required to comply with Section 4(c) of
|
|
|
|
# the License and to reproduce the content of the NOTICE file.
|
2012-06-09 20:40:48 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# You may obtain a copy of the Apache License at
|
2012-06-09 20:40:48 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2012-06-09 20:40:48 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the Apache License with the above modification is
|
|
|
|
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
# KIND, either express or implied. See the Apache License for the specific
|
|
|
|
# language governing permissions and limitations under the Apache License.
|
2012-06-09 20:40:48 +00:00
|
|
|
#
|
|
|
|
|
2012-06-09 21:22:57 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2012-06-09 00:06:35 +00:00
|
|
|
include_directories(
|
2014-04-09 20:43:38 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/opensubdiv"
|
2012-06-09 00:06:35 +00:00
|
|
|
)
|
|
|
|
|
2013-11-04 23:19:14 +00:00
|
|
|
if( DXSDK_FOUND )
|
|
|
|
include_directories(
|
2014-04-09 20:43:38 +00:00
|
|
|
"${DXSDK_INCLUDE_DIR}"
|
2013-11-04 23:19:14 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2012-12-20 18:25:41 +00:00
|
|
|
if( OPENGL_FOUND )
|
2014-04-09 22:09:53 +00:00
|
|
|
|
2014-04-09 22:16:13 +00:00
|
|
|
if (NOT "${OPENGL_INCLUDE_DIR}" STREQUAL "")
|
2014-04-09 22:09:53 +00:00
|
|
|
include_directories("${OPENGL_INCLUDE_DIR}")
|
|
|
|
endif()
|
2013-07-19 02:44:54 +00:00
|
|
|
if (GLEW_FOUND)
|
2014-04-09 20:43:38 +00:00
|
|
|
include_directories("${GLEW_INCLUDE_DIR}")
|
2013-07-19 02:44:54 +00:00
|
|
|
endif()
|
2012-12-20 18:25:41 +00:00
|
|
|
elseif( OPENGLES_FOUND )
|
2014-04-09 20:43:38 +00:00
|
|
|
include_directories("${OPENGLES_INCLUDE_DIR}")
|
2012-12-20 18:25:41 +00:00
|
|
|
endif()
|
|
|
|
|
2012-06-09 20:40:48 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# source & headers
|
2012-12-11 01:15:13 +00:00
|
|
|
set(CPU_SOURCE_FILES
|
2012-06-09 00:06:35 +00:00
|
|
|
cpuKernel.cpp
|
2012-12-11 01:15:13 +00:00
|
|
|
cpuComputeController.cpp
|
|
|
|
cpuComputeContext.cpp
|
2013-05-16 21:21:11 +00:00
|
|
|
cpuEvalLimitContext.cpp
|
|
|
|
cpuEvalLimitController.cpp
|
|
|
|
cpuEvalLimitKernel.cpp
|
2013-09-11 23:05:14 +00:00
|
|
|
cpuEvalStencilsContext.cpp
|
|
|
|
cpuEvalStencilsController.cpp
|
2014-01-10 01:36:35 +00:00
|
|
|
cpuSmoothNormalContext.cpp
|
|
|
|
cpuSmoothNormalController.cpp
|
2012-12-11 01:15:13 +00:00
|
|
|
cpuVertexBuffer.cpp
|
|
|
|
error.cpp
|
2013-05-16 21:21:11 +00:00
|
|
|
evalLimitContext.cpp
|
2012-12-11 01:15:13 +00:00
|
|
|
drawContext.cpp
|
|
|
|
drawRegistry.cpp
|
|
|
|
)
|
|
|
|
|
2014-04-09 20:43:38 +00:00
|
|
|
set(GPU_SOURCE_FILES )
|
2012-06-09 00:06:35 +00:00
|
|
|
|
2014-04-09 20:43:38 +00:00
|
|
|
set(KERNEL_FILES )
|
2012-06-09 20:40:48 +00:00
|
|
|
|
2014-04-09 20:43:38 +00:00
|
|
|
set(INC_FILES )
|
2012-06-09 20:40:48 +00:00
|
|
|
|
2012-06-19 19:34:26 +00:00
|
|
|
set(PRIVATE_HEADER_FILES
|
2012-12-11 01:15:13 +00:00
|
|
|
debug.h
|
|
|
|
cpuKernel.h
|
2013-04-19 02:55:05 +00:00
|
|
|
cpuEvalLimitKernel.h
|
2012-06-19 19:34:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set(PUBLIC_HEADER_FILES
|
2012-12-11 01:15:13 +00:00
|
|
|
computeController.h
|
2012-12-20 18:25:41 +00:00
|
|
|
cpuComputeContext.h
|
2012-12-11 01:15:13 +00:00
|
|
|
cpuComputeController.h
|
2013-04-19 02:55:05 +00:00
|
|
|
cpuEvalLimitContext.h
|
|
|
|
cpuEvalLimitController.h
|
2013-09-11 23:05:14 +00:00
|
|
|
cpuEvalStencilsContext.h
|
|
|
|
cpuEvalStencilsController.h
|
2014-01-10 01:36:35 +00:00
|
|
|
cpuSmoothNormalContext.h
|
|
|
|
cpuSmoothNormalController.h
|
2012-12-11 01:15:13 +00:00
|
|
|
cpuVertexBuffer.h
|
|
|
|
error.h
|
2013-04-19 02:55:05 +00:00
|
|
|
evalLimitContext.h
|
2012-06-09 00:06:35 +00:00
|
|
|
mesh.h
|
2012-12-11 01:15:13 +00:00
|
|
|
nonCopyable.h
|
2013-06-10 22:54:40 +00:00
|
|
|
opengl.h
|
2012-12-11 01:15:13 +00:00
|
|
|
drawContext.h
|
|
|
|
drawRegistry.h
|
2012-06-09 00:06:35 +00:00
|
|
|
vertex.h
|
2012-12-20 18:25:41 +00:00
|
|
|
vertexDescriptor.h
|
2012-06-09 00:06:35 +00:00
|
|
|
)
|
|
|
|
|
2012-06-09 20:40:48 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2012-06-14 00:37:56 +00:00
|
|
|
# platform dependent tweaks
|
2012-12-11 01:15:13 +00:00
|
|
|
if(APPLE OR UNIX)
|
2014-04-09 20:43:38 +00:00
|
|
|
set(PLATFORM_COMPILE_FLAGS -fPIC)
|
2012-06-13 21:30:28 +00:00
|
|
|
elseif(WIN32)
|
2012-06-14 00:37:56 +00:00
|
|
|
|
2012-06-09 20:40:48 +00:00
|
|
|
endif()
|
|
|
|
|
2012-06-11 18:53:35 +00:00
|
|
|
add_definitions(
|
|
|
|
${PLATFORM_COMPILE_FLAGS}
|
|
|
|
)
|
2012-06-09 20:40:48 +00:00
|
|
|
|
2013-07-05 22:36:54 +00:00
|
|
|
set(DOXY_HEADER_FILES ${PUBLIC_HEADER_FILES})
|
|
|
|
|
2012-06-14 00:37:56 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2013-09-21 01:22:09 +00:00
|
|
|
set(GL_PTEX_PUBLIC_HEADERS
|
|
|
|
glPtexTexture.h
|
|
|
|
glPtexMipmapTexture.h
|
|
|
|
)
|
2013-10-05 01:27:06 +00:00
|
|
|
set(DX_PTEX_PUBLIC_HEADERS
|
|
|
|
d3d11PtexTexture.h
|
|
|
|
d3d11PtexMipmapTexture.h
|
|
|
|
)
|
2013-07-05 22:36:54 +00:00
|
|
|
|
2012-08-04 02:51:27 +00:00
|
|
|
if( PTEX_FOUND )
|
2013-09-21 01:22:09 +00:00
|
|
|
list(APPEND PUBLIC_HEADER_FILES
|
|
|
|
ptexTextureLoader.h
|
|
|
|
ptexMipmapTextureLoader.h
|
|
|
|
)
|
2012-12-11 01:15:13 +00:00
|
|
|
list(APPEND CPU_SOURCE_FILES
|
|
|
|
ptexTextureLoader.cpp
|
2013-09-21 01:22:09 +00:00
|
|
|
ptexMipmapTextureLoader.cpp
|
2012-08-04 02:51:27 +00:00
|
|
|
)
|
2012-12-11 01:15:13 +00:00
|
|
|
if( OPENGL_FOUND )
|
|
|
|
list(APPEND GPU_SOURCE_FILES
|
|
|
|
glPtexTexture.cpp
|
2013-09-21 01:22:09 +00:00
|
|
|
glPtexMipmapTexture.cpp
|
2012-12-11 01:15:13 +00:00
|
|
|
)
|
|
|
|
list(APPEND PUBLIC_HEADER_FILES
|
2013-07-05 22:36:54 +00:00
|
|
|
${GL_PTEX_PUBLIC_HEADERS}
|
2012-12-11 01:15:13 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if( DXSDK_FOUND )
|
|
|
|
list(APPEND GPU_SOURCE_FILES
|
|
|
|
d3d11PtexTexture.cpp
|
2013-10-05 01:27:06 +00:00
|
|
|
d3d11PtexMipmapTexture.cpp
|
2012-12-11 01:15:13 +00:00
|
|
|
)
|
|
|
|
list(APPEND PUBLIC_HEADER_FILES
|
2013-07-05 22:36:54 +00:00
|
|
|
${DX_PTEX_PUBLIC_HEADERS}
|
2012-12-11 01:15:13 +00:00
|
|
|
)
|
|
|
|
endif()
|
2014-04-09 20:43:38 +00:00
|
|
|
include_directories( "${PTEX_INCLUDE_DIR}" )
|
2013-07-26 21:07:14 +00:00
|
|
|
list(APPEND PLATFORM_CPU_LIBRARIES
|
2014-04-09 20:43:38 +00:00
|
|
|
"${PTEX_LIBRARY}"
|
2012-08-04 02:51:27 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2014-04-09 20:43:38 +00:00
|
|
|
list(APPEND DOXY_HEADER_FILES ${GL_PTEX_PUBLIC_HEADERS} ${DX_PTEX_PUBLIC_HEADERS})
|
2013-07-05 22:36:54 +00:00
|
|
|
|
2012-08-04 02:51:27 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2013-08-15 23:11:33 +00:00
|
|
|
set(OPENMP_PUBLIC_HEADERS
|
2013-07-05 22:36:54 +00:00
|
|
|
ompKernel.h
|
|
|
|
ompComputeController.h
|
2013-09-11 23:05:14 +00:00
|
|
|
ompEvalStencilsController.h
|
2014-01-10 23:31:48 +00:00
|
|
|
ompSmoothNormalController.h
|
2013-07-05 22:36:54 +00:00
|
|
|
)
|
2013-08-15 23:11:33 +00:00
|
|
|
|
2012-08-04 02:51:27 +00:00
|
|
|
if( OPENMP_FOUND )
|
2012-12-11 01:15:13 +00:00
|
|
|
list(APPEND CPU_SOURCE_FILES
|
|
|
|
ompKernel.cpp
|
|
|
|
ompComputeController.cpp
|
2013-09-11 23:05:14 +00:00
|
|
|
ompEvalStencilsController.cpp
|
2014-01-10 23:31:48 +00:00
|
|
|
ompSmoothNormalController.cpp
|
2012-12-11 01:15:13 +00:00
|
|
|
)
|
2013-07-05 22:36:54 +00:00
|
|
|
|
|
|
|
list(APPEND PUBLIC_HEADER_FILES ${OPENMP_PUBLIC_HEADERS})
|
|
|
|
|
2012-06-14 00:37:56 +00:00
|
|
|
if (CMAKE_COMPILER_IS_GNUCXX)
|
2014-04-09 20:43:38 +00:00
|
|
|
list(APPEND PLATFORM_CPU_LIBRARIES gomp)
|
2012-06-14 00:37:56 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND DOXY_HEADER_FILES ${OPENMP_PUBLIC_HEADERS})
|
|
|
|
|
2013-08-15 23:11:33 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
if( TBB_FOUND )
|
2014-04-09 20:43:38 +00:00
|
|
|
include_directories("${TBB_INCLUDE_DIR}")
|
|
|
|
|
2013-08-15 23:11:33 +00:00
|
|
|
list(APPEND CPU_SOURCE_FILES
|
|
|
|
tbbKernel.cpp
|
|
|
|
tbbComputeController.cpp
|
2013-09-11 23:05:14 +00:00
|
|
|
tbbEvalStencilsController.cpp
|
2014-01-10 22:56:59 +00:00
|
|
|
tbbSmoothNormalController.cpp
|
2013-08-15 23:11:33 +00:00
|
|
|
)
|
|
|
|
list(APPEND PUBLIC_HEADER_FILES
|
|
|
|
tbbKernel.h
|
|
|
|
tbbComputeController.h
|
2013-09-11 23:05:14 +00:00
|
|
|
tbbEvalStencilsController.h
|
2014-01-10 22:56:59 +00:00
|
|
|
tbbSmoothNormalController.h
|
2013-08-15 23:11:33 +00:00
|
|
|
)
|
|
|
|
if (CMAKE_COMPILER_IS_GNUCXX)
|
2014-04-09 20:43:38 +00:00
|
|
|
list(APPEND PLATFORM_CPU_LIBRARIES gomp)
|
2013-08-15 23:11:33 +00:00
|
|
|
endif()
|
|
|
|
|
2014-04-09 20:43:38 +00:00
|
|
|
list(APPEND PLATFORM_CPU_LIBRARIES "${TBB_LIBRARIES}")
|
2013-08-15 23:11:33 +00:00
|
|
|
endif()
|
|
|
|
|
2013-02-02 20:53:33 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2013-07-05 22:36:54 +00:00
|
|
|
set(GCD_PUBLIC_HEADERS
|
|
|
|
gcdKernel.h
|
|
|
|
gcdComputeController.h
|
|
|
|
)
|
2013-08-15 23:11:33 +00:00
|
|
|
|
2013-02-02 20:53:33 +00:00
|
|
|
if( GCD_FOUND )
|
|
|
|
list(APPEND CPU_SOURCE_FILES
|
|
|
|
gcdKernel.cpp
|
|
|
|
gcdComputeController.cpp
|
|
|
|
)
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND PUBLIC_HEADER_FILES ${GCD_PUBLIC_HEADERS})
|
2013-02-02 20:53:33 +00:00
|
|
|
endif()
|
|
|
|
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND DOXY_HEADER_FILES ${GCD_PUBLIC_HEADERS})
|
|
|
|
|
2012-06-09 20:40:48 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2012-08-04 02:51:27 +00:00
|
|
|
# GL code & dependencies
|
2013-07-05 22:36:54 +00:00
|
|
|
set(GL_PUBLIC_HEADERS
|
|
|
|
cpuGLVertexBuffer.h
|
|
|
|
glDrawContext.h
|
|
|
|
glDrawRegistry.h
|
|
|
|
glVertexBuffer.h
|
|
|
|
glMesh.h
|
|
|
|
)
|
|
|
|
|
2012-12-20 18:25:41 +00:00
|
|
|
if( OPENGL_FOUND OR OPENGLES_FOUND )
|
2012-12-11 01:15:13 +00:00
|
|
|
list(APPEND GPU_SOURCE_FILES
|
|
|
|
cpuGLVertexBuffer.cpp
|
|
|
|
glDrawContext.cpp
|
|
|
|
glDrawRegistry.cpp
|
|
|
|
glVertexBuffer.cpp
|
|
|
|
)
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND PUBLIC_HEADER_FILES ${GL_PUBLIC_HEADERS})
|
2012-12-20 18:25:41 +00:00
|
|
|
if ( OPENGL_FOUND )
|
|
|
|
list(APPEND KERNEL_FILES
|
|
|
|
glslPatchCommon.glsl
|
2013-06-24 19:03:57 +00:00
|
|
|
glslPatchBSpline.glsl
|
2012-12-20 18:25:41 +00:00
|
|
|
glslPatchGregory.glsl
|
|
|
|
glslPatchTransition.glsl
|
2013-11-20 23:47:59 +00:00
|
|
|
glslPtexCommon.glsl
|
2012-12-20 18:25:41 +00:00
|
|
|
)
|
|
|
|
endif()
|
2013-07-26 21:07:14 +00:00
|
|
|
list(APPEND PLATFORM_GPU_LIBRARIES
|
2014-04-09 20:43:38 +00:00
|
|
|
"${OPENGL_LIBRARY}"
|
|
|
|
"${OPENGLES_LIBRARIES}"
|
2012-12-11 01:15:13 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND DOXY_HEADER_FILES ${GL_PUBLIC_HEADERS})
|
|
|
|
|
2012-12-11 01:15:13 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# OpenGL 4.2 dependencies
|
|
|
|
# note : (GLSL transform feedback kernels require GL 4.2)
|
2013-07-05 22:36:54 +00:00
|
|
|
set(GL_4_2_PUBLIC_HEADERS
|
|
|
|
glslTransformFeedbackComputeContext.h
|
|
|
|
glslTransformFeedbackComputeController.h
|
|
|
|
glslTransformFeedbackKernelBundle.h
|
|
|
|
)
|
|
|
|
|
2012-12-11 01:15:13 +00:00
|
|
|
if( OPENGL_4_2_FOUND )
|
|
|
|
list(APPEND GPU_SOURCE_FILES
|
|
|
|
glslTransformFeedbackComputeController.cpp
|
|
|
|
glslTransformFeedbackComputeContext.cpp
|
|
|
|
glslTransformFeedbackKernelBundle.cpp
|
|
|
|
)
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND PUBLIC_HEADER_FILES ${GL_4_2_PUBLIC_HEADERS})
|
2014-04-09 20:43:38 +00:00
|
|
|
list(APPEND KERNEL_FILES glslTransformFeedbackKernel.glsl)
|
|
|
|
list(APPEND PLATFORM_GPU_LIBRARIES "${GLEW_LIBRARY}")
|
2012-12-11 01:15:13 +00:00
|
|
|
endif()
|
|
|
|
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND DOXY_HEADER_FILES ${GL_4_2_PUBLIC_HEADERS})
|
|
|
|
|
2012-12-11 01:15:13 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# OpenGL 4.3 dependencies
|
|
|
|
# note : (GLSL compute shader kernels require GL 4.3)
|
2013-07-05 22:36:54 +00:00
|
|
|
set(GL_4_3_PUBLIC_HEADERS
|
|
|
|
glslComputeContext.h
|
|
|
|
glslComputeController.h
|
|
|
|
glslKernelBundle.h
|
|
|
|
)
|
|
|
|
|
2012-12-11 01:15:13 +00:00
|
|
|
if( OPENGL_4_3_FOUND )
|
|
|
|
list(APPEND GPU_SOURCE_FILES
|
|
|
|
glslComputeController.cpp
|
|
|
|
glslComputeContext.cpp
|
|
|
|
glslKernelBundle.cpp
|
2012-06-09 00:06:35 +00:00
|
|
|
)
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND PUBLIC_HEADER_FILES ${GL_4_3_PUBLIC_HEADERS})
|
2014-04-09 20:43:38 +00:00
|
|
|
list(APPEND KERNEL_FILES glslComputeKernel.glsl)
|
|
|
|
list(APPEND PLATFORM_GPU_LIBRARIES "${GLEW_LIBRARY}")
|
2012-12-11 01:15:13 +00:00
|
|
|
endif()
|
|
|
|
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND DOXY_HEADER_FILES ${GL_4_3_PUBLIC_HEADERS})
|
|
|
|
|
2012-12-11 01:15:13 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# DX11 code & dependencies
|
2013-07-05 22:36:54 +00:00
|
|
|
set(DXSDK_PUBLIC_HEADERS
|
|
|
|
cpuD3D11VertexBuffer.h
|
|
|
|
d3d11ComputeContext.h
|
|
|
|
d3d11ComputeController.h
|
|
|
|
d3d11DrawContext.h
|
|
|
|
d3d11DrawRegistry.h
|
|
|
|
d3d11KernelBundle.h
|
|
|
|
d3d11VertexBuffer.h
|
|
|
|
d3d11Mesh.h
|
|
|
|
)
|
2012-12-11 01:15:13 +00:00
|
|
|
if( DXSDK_FOUND )
|
|
|
|
list(APPEND GPU_SOURCE_FILES
|
|
|
|
cpuD3D11VertexBuffer.cpp
|
2012-12-13 18:22:30 +00:00
|
|
|
d3d11ComputeContext.cpp
|
|
|
|
d3d11ComputeController.cpp
|
2012-12-11 01:15:13 +00:00
|
|
|
d3d11DrawContext.cpp
|
|
|
|
d3d11DrawRegistry.cpp
|
2012-12-13 18:22:30 +00:00
|
|
|
d3d11KernelBundle.cpp
|
2012-12-11 01:15:13 +00:00
|
|
|
d3d11VertexBuffer.cpp
|
|
|
|
)
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND PUBLIC_HEADER_FILES ${DXSDK_PUBLIC_HEADERS})
|
2012-12-11 01:15:13 +00:00
|
|
|
list(APPEND KERNEL_FILES
|
2012-12-13 18:22:30 +00:00
|
|
|
hlslComputeKernel.hlsl
|
2012-12-11 01:15:13 +00:00
|
|
|
hlslPatchCommon.hlsl
|
2013-06-24 19:03:57 +00:00
|
|
|
hlslPatchBSpline.hlsl
|
2012-12-11 01:15:13 +00:00
|
|
|
hlslPatchGregory.hlsl
|
|
|
|
hlslPatchTransition.hlsl
|
2013-11-20 23:47:59 +00:00
|
|
|
hlslPtexCommon.hlsl
|
2012-12-11 01:15:13 +00:00
|
|
|
)
|
2014-04-09 20:43:38 +00:00
|
|
|
list(APPEND PLATFORM_GPU_LIBRARIES "${DXSDK_LIBRARIES}")
|
2012-06-09 20:40:48 +00:00
|
|
|
endif()
|
|
|
|
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND DOXY_HEADER_FILES ${DXSDK_PUBLIC_HEADERS})
|
|
|
|
|
2012-06-16 23:03:52 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2012-08-04 02:51:27 +00:00
|
|
|
# OpenCL code & dependencies
|
2013-07-05 22:36:54 +00:00
|
|
|
set(OPENCL_PUBLIC_HEADERS
|
|
|
|
clComputeContext.h
|
|
|
|
clComputeController.h
|
|
|
|
clVertexBuffer.h
|
|
|
|
)
|
2012-06-21 01:20:41 +00:00
|
|
|
if ( OPENCL_FOUND )
|
2012-12-11 01:15:13 +00:00
|
|
|
list(APPEND GPU_SOURCE_FILES
|
|
|
|
clComputeController.cpp
|
|
|
|
clComputeContext.cpp
|
|
|
|
clKernelBundle.cpp
|
|
|
|
clVertexBuffer.cpp
|
2012-06-16 23:03:52 +00:00
|
|
|
)
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND PUBLIC_HEADER_FILES ${OPENCL_PUBLIC_HEADERS})
|
2012-06-16 23:03:52 +00:00
|
|
|
list(APPEND KERNEL_FILES
|
|
|
|
clKernel.cl
|
|
|
|
)
|
2013-07-26 21:07:14 +00:00
|
|
|
list(APPEND PLATFORM_GPU_LIBRARIES
|
2012-06-16 23:03:52 +00:00
|
|
|
${OPENCL_LIBRARIES}
|
|
|
|
)
|
2014-04-09 20:43:38 +00:00
|
|
|
include_directories( "${OPENCL_INCLUDE_DIRS}" )
|
2012-12-11 01:15:13 +00:00
|
|
|
if ( OPENGL_FOUND )
|
2014-04-09 20:43:38 +00:00
|
|
|
list(APPEND GPU_SOURCE_FILES clGLVertexBuffer.cpp)
|
|
|
|
list(APPEND PUBLIC_HEADER_FILES clGLVertexBuffer.h)
|
2012-12-11 01:15:13 +00:00
|
|
|
endif()
|
2012-06-16 23:03:52 +00:00
|
|
|
endif()
|
|
|
|
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND DOXY_HEADER_FILES ${OPENCL_PUBLIC_HEADERS})
|
|
|
|
|
2012-06-09 21:22:57 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2012-08-04 02:51:27 +00:00
|
|
|
# CUDA code & dependencies
|
2013-07-05 22:36:54 +00:00
|
|
|
set(CUDA_PUBLIC_HEADERS
|
|
|
|
cudaComputeContext.h
|
|
|
|
cudaComputeController.h
|
|
|
|
cudaVertexBuffer.h
|
|
|
|
)
|
2012-06-09 21:22:57 +00:00
|
|
|
if( CUDA_FOUND )
|
2012-12-11 01:15:13 +00:00
|
|
|
list(APPEND GPU_SOURCE_FILES
|
|
|
|
cudaComputeController.cpp
|
|
|
|
cudaComputeContext.cpp
|
|
|
|
cudaVertexBuffer.cpp
|
2012-06-09 21:22:57 +00:00
|
|
|
)
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND PUBLIC_HEADER_FILES ${CUDA_PUBLIC_HEADERS})
|
2012-06-09 21:22:57 +00:00
|
|
|
list(APPEND KERNEL_FILES
|
|
|
|
cudaKernel.cu
|
|
|
|
)
|
2012-12-11 01:15:13 +00:00
|
|
|
if ( OPENGL_FOUND )
|
|
|
|
list(APPEND GPU_SOURCE_FILES
|
|
|
|
cudaGLVertexBuffer.cpp
|
|
|
|
)
|
|
|
|
list(APPEND PUBLIC_HEADER_FILES
|
|
|
|
cudaGLVertexBuffer.h
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if( DXSDK_FOUND )
|
|
|
|
list(APPEND GPU_SOURCE_FILES
|
|
|
|
cudaD3D11VertexBuffer.cpp
|
|
|
|
)
|
|
|
|
list(APPEND PUBLIC_HEADER_FILES
|
|
|
|
cudaD3D11VertexBuffer.h
|
|
|
|
)
|
2013-08-15 23:11:33 +00:00
|
|
|
endif()
|
2012-12-11 01:15:13 +00:00
|
|
|
|
2012-06-16 00:19:13 +00:00
|
|
|
if (UNIX)
|
2013-03-08 01:50:15 +00:00
|
|
|
list( APPEND CUDA_NVCC_FLAGS -Xcompiler -fPIC --gpu-architecture compute_11 )
|
2012-06-16 00:19:13 +00:00
|
|
|
endif()
|
2012-06-09 21:22:57 +00:00
|
|
|
endif()
|
|
|
|
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND DOXY_HEADER_FILES ${CUDA_PUBLIC_HEADERS})
|
2012-06-09 21:22:57 +00:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
2012-08-04 02:51:27 +00:00
|
|
|
|
2014-01-04 00:59:26 +00:00
|
|
|
_stringify("${KERNEL_FILES}" INC_FILES)
|
|
|
|
|
2014-04-09 20:43:38 +00:00
|
|
|
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
|
2012-06-09 20:40:48 +00:00
|
|
|
|
2012-06-09 21:22:57 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2012-06-09 20:40:48 +00:00
|
|
|
source_group("Kernels" FILES ${KERNEL_FILES})
|
2012-06-21 01:20:41 +00:00
|
|
|
|
2012-06-09 20:40:48 +00:00
|
|
|
source_group("Inc" FILES ${INC_FILES})
|
2012-06-09 00:06:35 +00:00
|
|
|
|
2013-07-12 01:55:17 +00:00
|
|
|
if (NOT NO_LIB)
|
2012-12-11 01:15:13 +00:00
|
|
|
|
2014-01-03 21:39:48 +00:00
|
|
|
# Compile objs first for both the CPU and GPU libs -----
|
|
|
|
add_library(osd_cpu_obj
|
2013-12-22 05:02:36 +00:00
|
|
|
OBJECT
|
2013-09-03 22:38:24 +00:00
|
|
|
${CPU_SOURCE_FILES}
|
|
|
|
${PRIVATE_HEADER_FILES}
|
|
|
|
${PUBLIC_HEADER_FILES}
|
2012-12-11 01:15:13 +00:00
|
|
|
)
|
2014-01-03 21:39:48 +00:00
|
|
|
|
|
|
|
add_library(osd_gpu_obj
|
|
|
|
OBJECT
|
|
|
|
${GPU_SOURCE_FILES}
|
|
|
|
${PRIVATE_HEADER_FILES}
|
|
|
|
${PUBLIC_HEADER_FILES}
|
2013-12-24 06:30:34 +00:00
|
|
|
${INC_FILES}
|
2014-01-03 21:39:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Build static libs ------------------------------------
|
2013-12-22 05:02:36 +00:00
|
|
|
add_library(osd_static_cpu
|
|
|
|
STATIC
|
2014-01-03 21:39:48 +00:00
|
|
|
$<TARGET_OBJECTS:osd_cpu_obj>
|
2013-12-22 05:02:36 +00:00
|
|
|
)
|
2013-07-12 01:55:17 +00:00
|
|
|
set_target_properties(osd_static_cpu PROPERTIES OUTPUT_NAME osdCPU CLEAN_DIRECT_OUTPUT 1)
|
2012-12-11 01:15:13 +00:00
|
|
|
|
2013-07-12 01:55:17 +00:00
|
|
|
target_link_libraries(osd_static_cpu
|
2013-07-26 21:07:14 +00:00
|
|
|
${PLATFORM_CPU_LIBRARIES}
|
2012-12-11 01:15:13 +00:00
|
|
|
)
|
|
|
|
|
2014-01-03 21:39:48 +00:00
|
|
|
# this macro uses FindCUDA.cmake to compile .cu kernel files
|
|
|
|
# the target then adds the other obj dependencies and include files
|
2013-09-03 22:38:24 +00:00
|
|
|
_add_possibly_cuda_library(osd_static_gpu
|
|
|
|
STATIC
|
2014-01-03 21:39:48 +00:00
|
|
|
$<TARGET_OBJECTS:osd_gpu_obj>
|
2013-09-03 22:38:24 +00:00
|
|
|
${KERNEL_FILES}
|
2012-06-21 01:20:41 +00:00
|
|
|
)
|
2013-07-12 01:55:17 +00:00
|
|
|
set_target_properties(osd_static_gpu PROPERTIES OUTPUT_NAME osdGPU CLEAN_DIRECT_OUTPUT 1)
|
2012-06-21 01:20:41 +00:00
|
|
|
|
2013-07-12 01:55:17 +00:00
|
|
|
target_link_libraries(osd_static_gpu
|
2014-04-09 20:43:38 +00:00
|
|
|
"${PLATFORM_CPU_LIBRARIES}" "${PLATFORM_GPU_LIBRARIES}"
|
2012-06-21 01:20:41 +00:00
|
|
|
)
|
2013-07-12 01:55:17 +00:00
|
|
|
|
2014-04-09 20:43:38 +00:00
|
|
|
install( TARGETS osd_static_cpu DESTINATION "${CMAKE_LIBDIR_BASE}" )
|
|
|
|
install( TARGETS osd_static_gpu DESTINATION "${CMAKE_LIBDIR_BASE}" )
|
2013-07-12 01:55:17 +00:00
|
|
|
|
2014-01-03 21:39:48 +00:00
|
|
|
# Build dynamic libs ----------------------------------
|
2013-07-12 01:55:17 +00:00
|
|
|
if (NOT WIN32 AND NOT IOS)
|
2013-09-03 22:38:24 +00:00
|
|
|
|
|
|
|
# Evaluate 'soname' from OSD version
|
2014-01-03 21:39:48 +00:00
|
|
|
# replace '_' with '.'
|
|
|
|
string(REGEX REPLACE "(_)" "." OSD_SONAME ${OpenSubdiv_VERSION})
|
2013-09-03 22:38:24 +00:00
|
|
|
|
2014-01-03 21:39:48 +00:00
|
|
|
# remove starting 'v' character
|
|
|
|
string(REGEX REPLACE "^v" "" OSD_SONAME ${OSD_SONAME})
|
2013-09-03 22:38:24 +00:00
|
|
|
|
|
|
|
# generate dynamic-link targets
|
|
|
|
add_library(osd_dynamic_cpu
|
|
|
|
SHARED
|
2014-01-03 21:39:48 +00:00
|
|
|
$<TARGET_OBJECTS:osd_cpu_obj>
|
2013-07-12 01:55:17 +00:00
|
|
|
)
|
|
|
|
|
2013-09-03 22:38:24 +00:00
|
|
|
set_target_properties(osd_dynamic_cpu
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME osdCPU
|
|
|
|
CLEAN_DIRECT_OUTPUT 1
|
|
|
|
SOVERSION ${OSD_SONAME}
|
|
|
|
)
|
2013-07-12 01:55:17 +00:00
|
|
|
|
|
|
|
target_link_libraries(osd_dynamic_cpu
|
2014-04-09 20:43:38 +00:00
|
|
|
"${PLATFORM_CPU_LIBRARIES}"
|
2013-07-12 01:55:17 +00:00
|
|
|
)
|
|
|
|
|
2013-09-03 22:38:24 +00:00
|
|
|
_add_possibly_cuda_library(osd_dynamic_gpu
|
|
|
|
SHARED
|
2013-12-24 06:30:34 +00:00
|
|
|
$<TARGET_OBJECTS:osd_gpu_obj>
|
|
|
|
${KERNEL_FILES}
|
2013-07-12 01:55:17 +00:00
|
|
|
)
|
|
|
|
|
2013-09-03 22:38:24 +00:00
|
|
|
set_target_properties(osd_dynamic_gpu
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME osdGPU
|
|
|
|
CLEAN_DIRECT_OUTPUT 1
|
|
|
|
SOVERSION ${OSD_SONAME}
|
|
|
|
)
|
2013-07-12 01:55:17 +00:00
|
|
|
|
|
|
|
target_link_libraries(osd_dynamic_gpu
|
|
|
|
osd_dynamic_cpu
|
2014-04-09 20:43:38 +00:00
|
|
|
"${PLATFORM_CPU_LIBRARIES}" "${PLATFORM_GPU_LIBRARIES}"
|
2013-07-12 01:55:17 +00:00
|
|
|
)
|
|
|
|
|
2014-04-09 20:43:38 +00:00
|
|
|
install( TARGETS osd_dynamic_cpu LIBRARY DESTINATION "${CMAKE_LIBDIR_BASE}" )
|
|
|
|
install( TARGETS osd_dynamic_gpu LIBRARY DESTINATION "${CMAKE_LIBDIR_BASE}" )
|
2013-07-12 01:55:17 +00:00
|
|
|
endif()
|
2012-06-21 01:20:41 +00:00
|
|
|
endif()
|
|
|
|
|
2013-07-05 22:36:54 +00:00
|
|
|
_add_doxy_headers( "${DOXY_HEADER_FILES}" )
|
2012-06-21 01:20:41 +00:00
|
|
|
|
2014-04-09 20:43:38 +00:00
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
${PUBLIC_HEADER_FILES}
|
|
|
|
DESTINATION
|
|
|
|
"${CMAKE_INCDIR_BASE}/osd"
|
|
|
|
PERMISSIONS
|
|
|
|
OWNER_READ
|
|
|
|
GROUP_READ
|
|
|
|
WORLD_READ )
|
2012-06-11 13:55:06 +00:00
|
|
|
|
2013-04-23 02:35:41 +00:00
|
|
|
|
2012-12-20 18:25:41 +00:00
|
|
|
if (ANDROID)
|
2014-04-09 20:43:38 +00:00
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
Android.mk
|
|
|
|
DESTINATION
|
|
|
|
"${LIBRARY_OUTPUT_PATH_ROOT}"
|
|
|
|
PERMISSIONS
|
|
|
|
OWNER_READ
|
|
|
|
GROUP_READ
|
|
|
|
WORLD_READ )
|
2012-12-20 18:25:41 +00:00
|
|
|
endif()
|
|
|
|
|
2012-06-09 21:22:57 +00:00
|
|
|
#-------------------------------------------------------------------------------
|