mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-11-21 19:30:04 +00:00
Expose preprocessor definition about enabled features
This commit is contained in:
parent
ee4d4e9f60
commit
04ff84bc35
@ -366,6 +366,57 @@ if (NOT NO_LIB)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
# Expose preprocessor macro to the interface so that client know which feature are enabled
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.0)
|
||||
foreach(osd_target osd_static_cpu osd_static_gpu osd_dynamic_cpu osd_dynamic_gpu osd_static_framework osd_dynamic_framework)
|
||||
if(TARGET ${osd_target})
|
||||
if(CLEW_FOUND)
|
||||
target_compile_definitions(${osd_target} INTERFACE OPENSUBDIV_HAS_CLEW)
|
||||
endif()
|
||||
if(CUDA_FOUND)
|
||||
target_compile_definitions(${osd_target} INTERFACE OPENSUBDIV_HAS_CUDA)
|
||||
endif()
|
||||
if(DXSDK_FOUND)
|
||||
target_compile_definitions(${osd_target} INTERFACE OPENSUBDIV_HAS_DX11SDK)
|
||||
endif()
|
||||
if(METAL_FOUND)
|
||||
target_compile_definitions(${osd_target} INTERFACE OPENSUBDIV_HAS_METAL)
|
||||
endif()
|
||||
if(OPENCL_CL_D3D11_EXT_H_FOUND OR OPENCL_CL_D3D11_H_FOUND)
|
||||
target_compile_definitions(${osd_target} INTERFACE OPENSUBDIV_HAS_OPENCL_DX_INTEROP)
|
||||
endif()
|
||||
if(OPENCL_FOUND)
|
||||
target_compile_definitions(${osd_target} INTERFACE OPENSUBDIV_HAS_OPENCL)
|
||||
endif()
|
||||
if(OPENGL_4_2_FOUND)
|
||||
target_compile_definitions(${osd_target} INTERFACE OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK)
|
||||
endif()
|
||||
if(OPENGL_4_3_FOUND)
|
||||
target_compile_definitions(${osd_target} INTERFACE OPENSUBDIV_HAS_GLSL_COMPUTE)
|
||||
endif()
|
||||
if(NOT NO_OPENGL AND OPENGL_FOUND)
|
||||
target_compile_definitions(${osd_target} INTERFACE OPENSUBDIV_HAS_OPENGL)
|
||||
endif()
|
||||
if(NOT NO_OPENGL AND OPENGLES_FOUND)
|
||||
target_compile_definitions(${osd_target} INTERFACE OPENSUBDIV_HAS_OPENGLES)
|
||||
endif()
|
||||
if(OPENMP_FOUND)
|
||||
target_compile_definitions(${osd_target} INTERFACE OPENSUBDIV_HAS_OPENMP)
|
||||
endif()
|
||||
if(OPENSUBDIV_GREGORY_EVAL_TRUE_DERIVATIVES)
|
||||
target_compile_definitions(${osd_target} INTERFACE OPENSUBDIV_GREGORY_EVAL_TRUE_DERIVATIVES)
|
||||
endif()
|
||||
if(PTEX_FOUND)
|
||||
target_compile_definitions(${osd_target} INTERFACE OPENSUBDIV_HAS_PTEX)
|
||||
endif()
|
||||
if(TBB_FOUND)
|
||||
target_compile_definitions(${osd_target} INTERFACE OPENSUBDIV_HAS_TBB)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user