2012-06-09 20:40:48 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) Pixar. All rights reserved.
|
|
|
|
#
|
|
|
|
# This license governs use of the accompanying software. If you
|
|
|
|
# use the software, you accept this license. If you do not accept
|
|
|
|
# the license, do not use the software.
|
|
|
|
#
|
|
|
|
# 1. Definitions
|
|
|
|
# The terms "reproduce," "reproduction," "derivative works," and
|
|
|
|
# "distribution" have the same meaning here as under U.S.
|
|
|
|
# copyright law. A "contribution" is the original software, or
|
|
|
|
# any additions or changes to the software.
|
|
|
|
# A "contributor" is any person or entity that distributes its
|
|
|
|
# contribution under this license.
|
|
|
|
# "Licensed patents" are a contributor's patent claims that read
|
|
|
|
# directly on its contribution.
|
|
|
|
#
|
|
|
|
# 2. Grant of Rights
|
|
|
|
# (A) Copyright Grant- Subject to the terms of this license,
|
|
|
|
# including the license conditions and limitations in section 3,
|
|
|
|
# each contributor grants you a non-exclusive, worldwide,
|
|
|
|
# royalty-free copyright license to reproduce its contribution,
|
|
|
|
# prepare derivative works of its contribution, and distribute
|
|
|
|
# its contribution or any derivative works that you create.
|
|
|
|
# (B) Patent Grant- Subject to the terms of this license,
|
|
|
|
# including the license conditions and limitations in section 3,
|
|
|
|
# each contributor grants you a non-exclusive, worldwide,
|
|
|
|
# royalty-free license under its licensed patents to make, have
|
|
|
|
# made, use, sell, offer for sale, import, and/or otherwise
|
|
|
|
# dispose of its contribution in the software or derivative works
|
|
|
|
# of the contribution in the software.
|
|
|
|
#
|
|
|
|
# 3. Conditions and Limitations
|
|
|
|
# (A) No Trademark License- This license does not grant you
|
|
|
|
# rights to use any contributor's name, logo, or trademarks.
|
|
|
|
# (B) If you bring a patent claim against any contributor over
|
|
|
|
# patents that you claim are infringed by the software, your
|
|
|
|
# patent license from such contributor to the software ends
|
|
|
|
# automatically.
|
|
|
|
# (C) If you distribute any portion of the software, you must
|
|
|
|
# retain all copyright, patent, trademark, and attribution
|
|
|
|
# notices that are present in the software.
|
|
|
|
# (D) If you distribute any portion of the software in source
|
|
|
|
# code form, you may do so only under this license by including a
|
|
|
|
# complete copy of this license with your distribution. If you
|
|
|
|
# distribute any portion of the software in compiled or object
|
|
|
|
# code form, you may only do so under a license that complies
|
|
|
|
# with this license.
|
|
|
|
# (E) The software is licensed "as-is." You bear the risk of
|
|
|
|
# using it. The contributors give no express warranties,
|
|
|
|
# guarantees or conditions. You may have additional consumer
|
|
|
|
# rights under your local laws which this license cannot change.
|
|
|
|
# To the extent permitted under your local laws, the contributors
|
|
|
|
# exclude the implied warranties of merchantability, fitness for
|
|
|
|
# a particular purpose and non-infringement.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2012-06-09 21:22:57 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2012-06-09 00:06:35 +00:00
|
|
|
include_directories(
|
2012-12-11 01:15:13 +00:00
|
|
|
${DXSDK_INCLUDE_DIR}
|
2012-06-09 00:06:35 +00:00
|
|
|
${PROJECT_SOURCE_DIR}/opensubdiv
|
|
|
|
)
|
|
|
|
|
2012-12-20 18:25:41 +00:00
|
|
|
if( OPENGL_FOUND )
|
|
|
|
include_directories(
|
|
|
|
${OPENGL_INCLUDE_DIR}
|
|
|
|
${GLEW_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
elseif( OPENGLES_FOUND )
|
|
|
|
include_directories(
|
|
|
|
${OPENGLES_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
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
|
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
|
|
|
|
)
|
|
|
|
|
|
|
|
set(GPU_SOURCE_FILES
|
2012-06-09 00:06:35 +00:00
|
|
|
)
|
|
|
|
|
2012-06-09 20:40:48 +00:00
|
|
|
set(KERNEL_FILES
|
|
|
|
)
|
|
|
|
|
|
|
|
set(INC_FILES
|
|
|
|
)
|
|
|
|
|
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
|
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)
|
2012-06-09 00:06:35 +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-07-05 22:36:54 +00:00
|
|
|
set(GL_PTEX_PUBLIC_HEADERS glPtexTexture.h)
|
|
|
|
set(DX_PTEX_PUBLIC_HEADERS d3d11PtexTexture.h)
|
|
|
|
|
2012-08-04 02:51:27 +00:00
|
|
|
if( PTEX_FOUND )
|
2012-12-11 01:15:13 +00:00
|
|
|
list(APPEND CPU_SOURCE_FILES
|
|
|
|
ptexTextureLoader.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
|
|
|
|
)
|
|
|
|
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
|
|
|
|
)
|
|
|
|
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()
|
2012-08-04 02:51:27 +00:00
|
|
|
include_directories( ${PTEX_INCLUDE_DIR} )
|
|
|
|
list(APPEND PLATFORM_LIBRARIES
|
|
|
|
${PTEX_LIBRARY}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND DOXY_HEADER_FILES
|
|
|
|
${GL_PTEX_PUBLIC_HEADERS}
|
|
|
|
${DX_PTEX_PUBLIC_HEADERS}
|
|
|
|
)
|
|
|
|
|
2012-08-04 02:51:27 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2013-07-05 22:36:54 +00:00
|
|
|
set(OPENMP_PUBLIC_HEADERS
|
|
|
|
ompKernel.h
|
|
|
|
ompComputeController.h
|
|
|
|
)
|
|
|
|
|
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-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)
|
|
|
|
list(APPEND PLATFORM_LIBRARIES
|
|
|
|
gomp
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2013-07-05 22:36:54 +00:00
|
|
|
list(APPEND DOXY_HEADER_FILES ${OPENMP_PUBLIC_HEADERS})
|
|
|
|
|
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-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
|
|
|
|
)
|
|
|
|
endif()
|
2012-12-11 01:15:13 +00:00
|
|
|
list(APPEND PLATFORM_LIBRARIES
|
|
|
|
${OPENGL_LIBRARY}
|
2012-12-20 18:25:41 +00:00
|
|
|
${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})
|
2012-12-11 01:15:13 +00:00
|
|
|
list(APPEND KERNEL_FILES
|
|
|
|
glslTransformFeedbackKernel.glsl
|
|
|
|
)
|
|
|
|
list(APPEND PLATFORM_LIBRARIES
|
|
|
|
${GLEW_LIBRARY}
|
|
|
|
)
|
|
|
|
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})
|
2012-06-09 20:40:48 +00:00
|
|
|
list(APPEND KERNEL_FILES
|
2012-12-11 01:15:13 +00:00
|
|
|
glslComputeKernel.glsl
|
2012-06-09 00:06:35 +00:00
|
|
|
)
|
2012-06-09 20:40:48 +00:00
|
|
|
list(APPEND PLATFORM_LIBRARIES
|
|
|
|
${GLEW_LIBRARY}
|
2012-06-14 00:37:56 +00:00
|
|
|
)
|
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
|
|
|
|
)
|
2012-08-04 02:51:27 +00:00
|
|
|
list(APPEND PLATFORM_LIBRARIES
|
2012-12-11 01:15:13 +00:00
|
|
|
${DXSDK_LIBRARIES}
|
2012-08-04 02:51:27 +00:00
|
|
|
)
|
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
|
|
|
|
)
|
|
|
|
list(APPEND PLATFORM_LIBRARIES
|
|
|
|
${OPENCL_LIBRARIES}
|
|
|
|
)
|
2013-03-17 01:41:49 +00:00
|
|
|
include_directories( ${OPENCL_INCLUDE_DIRS} )
|
2012-12-11 01:15:13 +00:00
|
|
|
if ( OPENGL_FOUND )
|
|
|
|
list(APPEND GPU_SOURCE_FILES
|
|
|
|
clGLVertexBuffer.cpp
|
|
|
|
)
|
|
|
|
list(APPEND PUBLIC_HEADER_FILES
|
|
|
|
clGLVertexBuffer.h
|
|
|
|
)
|
|
|
|
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
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
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
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# Kernel Stringification
|
2012-06-09 20:40:48 +00:00
|
|
|
# We want to use preprocessor include directives to include GLSL and OpenCL
|
|
|
|
# kernel source files in cpp files, but since the sources contain newline
|
|
|
|
# characters we would need raw string literals from C++11 to do this directly.
|
|
|
|
# To avoid depending on C++11 we instead use a small tool called "line_quote"
|
|
|
|
# to generate source files that are suitable for direct inclusion.
|
|
|
|
foreach(kernel_file ${KERNEL_FILES})
|
|
|
|
|
|
|
|
string(REGEX REPLACE ".*[.](.*)" "\\1" extension ${kernel_file})
|
|
|
|
|
|
|
|
if(NOT ${extension} STREQUAL "cu")
|
|
|
|
|
|
|
|
string(REGEX REPLACE "(.*)[.].*" "\\1.inc" inc_file ${kernel_file})
|
|
|
|
list(APPEND INC_FILES ${inc_file})
|
2012-08-04 02:51:27 +00:00
|
|
|
|
2012-06-09 20:40:48 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${inc_file}
|
|
|
|
COMMAND stringify ${CMAKE_CURRENT_SOURCE_DIR}/${kernel_file}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/${inc_file}
|
|
|
|
DEPENDS stringify ${CMAKE_CURRENT_SOURCE_DIR}/${kernel_file}
|
|
|
|
)
|
2012-08-04 02:51:27 +00:00
|
|
|
|
|
|
|
endif()
|
2012-06-09 20:40:48 +00:00
|
|
|
endforeach()
|
|
|
|
|
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
|
|
|
|
2012-12-11 01:15:13 +00:00
|
|
|
_add_possibly_cuda_library(osd_static_cpu STATIC
|
|
|
|
${CPU_SOURCE_FILES}
|
|
|
|
${PRIVATE_HEADER_FILES}
|
|
|
|
${PUBLIC_HEADER_FILES}
|
|
|
|
)
|
|
|
|
set_target_properties(osd_static_cpu PROPERTIES OUTPUT_NAME osdCPU CLEAN_DIRECT_OUTPUT 1)
|
|
|
|
|
|
|
|
target_link_libraries(osd_static_cpu
|
|
|
|
${PLATFORM_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
_add_possibly_cuda_library(osd_static_gpu STATIC
|
|
|
|
${GPU_SOURCE_FILES}
|
2012-06-19 19:34:26 +00:00
|
|
|
${PRIVATE_HEADER_FILES}
|
|
|
|
${PUBLIC_HEADER_FILES}
|
2012-06-09 20:40:48 +00:00
|
|
|
${KERNEL_FILES}
|
|
|
|
${INC_FILES}
|
2012-06-09 00:06:35 +00:00
|
|
|
)
|
2012-12-11 01:15:13 +00:00
|
|
|
set_target_properties(osd_static_gpu PROPERTIES OUTPUT_NAME osdGPU CLEAN_DIRECT_OUTPUT 1)
|
2012-06-09 00:06:35 +00:00
|
|
|
|
2012-12-11 01:15:13 +00:00
|
|
|
target_link_libraries(osd_static_gpu
|
2012-06-09 00:06:35 +00:00
|
|
|
${PLATFORM_LIBRARIES}
|
|
|
|
)
|
2012-06-09 21:22:57 +00:00
|
|
|
|
2013-05-02 19:02:52 +00:00
|
|
|
install( TARGETS osd_static_cpu DESTINATION ${CMAKE_LIBDIR_BASE} )
|
|
|
|
install( TARGETS osd_static_gpu DESTINATION ${CMAKE_LIBDIR_BASE} )
|
2012-12-11 01:15:13 +00:00
|
|
|
|
2012-12-20 18:25:41 +00:00
|
|
|
if (NOT WIN32 AND NOT IOS)
|
2012-12-11 01:15:13 +00:00
|
|
|
_add_possibly_cuda_library(osd_dynamic_cpu SHARED
|
|
|
|
${CPU_SOURCE_FILES}
|
|
|
|
${PRIVATE_HEADER_FILES}
|
|
|
|
${PUBLIC_HEADER_FILES}
|
|
|
|
)
|
|
|
|
|
|
|
|
set_target_properties(osd_dynamic_cpu PROPERTIES OUTPUT_NAME osdCPU CLEAN_DIRECT_OUTPUT 1)
|
|
|
|
|
|
|
|
target_link_libraries(osd_dynamic_cpu
|
|
|
|
${PLATFORM_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
_add_possibly_cuda_library(osd_dynamic_gpu SHARED
|
|
|
|
${GPU_SOURCE_FILES}
|
2012-06-21 01:20:41 +00:00
|
|
|
${PRIVATE_HEADER_FILES}
|
|
|
|
${PUBLIC_HEADER_FILES}
|
|
|
|
${KERNEL_FILES}
|
|
|
|
${INC_FILES}
|
|
|
|
)
|
|
|
|
|
2012-12-11 01:15:13 +00:00
|
|
|
set_target_properties(osd_dynamic_gpu PROPERTIES OUTPUT_NAME osdGPU CLEAN_DIRECT_OUTPUT 1)
|
2012-06-21 01:20:41 +00:00
|
|
|
|
2012-12-11 01:15:13 +00:00
|
|
|
target_link_libraries(osd_dynamic_gpu
|
2012-12-16 04:34:31 +00:00
|
|
|
osd_dynamic_cpu
|
2012-06-21 01:20:41 +00:00
|
|
|
${PLATFORM_LIBRARIES}
|
|
|
|
)
|
2013-05-02 19:02:52 +00:00
|
|
|
|
|
|
|
install( TARGETS osd_dynamic_cpu DESTINATION ${CMAKE_LIBDIR_BASE} )
|
|
|
|
install( TARGETS osd_dynamic_gpu DESTINATION ${CMAKE_LIBDIR_BASE} )
|
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
|
|
|
|
2012-06-19 19:34:26 +00:00
|
|
|
install( FILES ${PUBLIC_HEADER_FILES}
|
2013-04-23 02:35:41 +00:00
|
|
|
DESTINATION ${CMAKE_INCDIR_BASE}/osd
|
2012-06-11 13:55:06 +00:00
|
|
|
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ )
|
|
|
|
|
2013-04-23 02:35:41 +00:00
|
|
|
|
2012-12-20 18:25:41 +00:00
|
|
|
if (ANDROID)
|
|
|
|
install( FILES Android.mk
|
|
|
|
DESTINATION ${LIBRARY_OUTPUT_PATH_ROOT}
|
|
|
|
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ )
|
|
|
|
endif()
|
|
|
|
|
2012-06-09 21:22:57 +00:00
|
|
|
#-------------------------------------------------------------------------------
|