Commit 326c9bec authored by Aaron Bray's avatar Aaron Bray
Browse files

Vulkan Install Support

parent 48b4758d
#-----------------------------------------------------------------------------
# Set install commands
#-----------------------------------------------------------------------------
if(NOT DEFINED VulkanSDK_ROOT_DIR OR NOT EXISTS ${VulkanSDK_ROOT_DIR})
set(VulkanSDK_ROOT_DIR "$ENV{VULKAN_SDK}" CACHE PATH "Path to Vulkan SDK install directory." FORCE)
endif()
if(NOT EXISTS ${VulkanSDK_ROOT_DIR})
message(FATAL_ERROR "\nCannot support Vulkan renderer without Vulkan SDK.\nSet VulkanSDK_ROOT_DIR to Vulkan SDK installation directory.\n\n")
endif()
# Header Directories
set(vulkan_headers_dest ${CMAKE_INSTALL_PREFIX}/include/)
set(vulkan_headers_dir ${VulkanSDK_ROOT_DIR}/Include/)
# Library Directories
set(vulkan_libs_dest ${CMAKE_INSTALL_PREFIX}/lib/)
set(vulkan_libs_dir ${VulkanSDK_ROOT_DIR}/Lib)
# Binary Directory
set(vulkan_bin_dest ${CMAKE_INSTALL_PREFIX}/bin/)
set(vulkan_bin_dir ${VulkanSDK_ROOT_DIR}/Bin)
#-----------------------------------------------------------------------------
# Add External Project
#-----------------------------------------------------------------------------
include(imstkAddExternalProject)
imstk_add_external_project( Vulkan
SOURCE_DIR ${VulkanSDK_ROOT_DIR}
UPDATE_COMMAND ${SKIP_STEP_COMMAND}
CONFIGURE_COMMAND ${SKIP_STEP_COMMAND}
BUILD_COMMAND ${SKIP_STEP_COMMAND}
INSTALL_COMMAND
COMMAND ${CMAKE_COMMAND} -E copy_directory ${vulkan_headers_dir} ${vulkan_headers_dest}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${vulkan_libs_dir} ${vulkan_libs_dest}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${vulkan_bin_dir} ${vulkan_bin_dest}
RELATIVE_INCLUDE_PATH "/"
#VERBOSE
)
#-----------------------------------------------------------------------------
# Vulkan renderer
#-----------------------------------------------------------------------------
if(NOT DEFINED VulkanSDK_ROOT_DIR OR NOT EXISTS ${VulkanSDK_ROOT_DIR})
set(VulkanSDK_ROOT_DIR "$ENV{VULKAN_SDK}" CACHE PATH "Path to Vulkan SDK install directory." FORCE)
endif()
if(NOT EXISTS ${VulkanSDK_ROOT_DIR})
message(FATAL_ERROR "\nCannot support Vulkan renderer without Vulkan SDK.\nSet VulkanSDK_ROOT_DIR to Vulkan SDK installation directory.\n\n")
endif()
include(imstkFind)
#-----------------------------------------------------------------------------
# Find All Headers and Libraries for VulkanSDK
#-----------------------------------------------------------------------------
set(VulkanSDK_LIB_DIR Lib)
imstk_find_header(VulkanSDK vulkan/vulkan.h)
imstk_find_libary(VulkanSDK vulkan-1)
imstk_find_libary(VulkanSDK vulkan-1 " ")#Use same library for debug)
imstk_find_package(VulkanSDK)
#message(STATUS "VulkanSDK include : ${VULKANSDK_INCLUDE_DIRS}")
#message(STATUS "VulkanSDK libraries : ${VULKANSDK_LIBRARIES}")
message(STATUS "VulkanSDK include : ${VULKANSDK_INCLUDE_DIRS}")
message(STATUS "VulkanSDK libraries : ${VULKANSDK_LIBRARIES}")
......@@ -126,6 +126,7 @@ if(${PROJECT_NAME}_SUPERBUILD)
if(${PROJECT_NAME}_USE_Vulkan)
imstk_define_dependency(glfw)
imstk_define_dependency(gli)
imstk_define_dependency(Vulkan)
endif()
option(${PROJECT_NAME}_ENABLE_VR "Allow the usage of VR rendering." OFF)
......@@ -221,34 +222,33 @@ add_definitions(-D__TBB_NO_IMPLICIT_LINKAGE)
find_package( VegaFEM REQUIRED CONFIG )
# VRPN
set(OpenHapticsSDK_Dependency)
find_package( VRPN REQUIRED )
if(${PROJECT_NAME}_USE_OpenHaptics)
find_package( OpenHapticsSDK REQUIRED )
add_definitions( -DiMSTK_USE_OPENHAPTICS )
set(OpenHapticsSDK_Dependency OpenHapticsSDK)
else()
remove_definitions( -DiMSTK_USE_OPENHAPTICS )
unset(OpenHapticsSDK_Dependency)
endif()
# VTK
find_package( VTK REQUIRED CONFIG )
# Vulkan
set(Vulkan "") # Target name for dependencies
set(Vulkan_Dependency)
if( ${PROJECT_NAME}_USE_Vulkan )
set(Vulkan "VulkanSDK")
find_package( VulkanSDK REQUIRED)
add_definitions( -DiMSTK_USE_Vulkan )
# glfw
find_package( glfw REQUIRED)
# gli
find_package( gli REQUIRED)
set(Vulkan_Dependency VulkanSDK)
else()
remove_definitions( -DiMSTK_USE_Vulkan )
unset(Vulkan_Dependency)
endif()
......
......@@ -34,7 +34,7 @@ imstk_add_library( GUIOverlay
DEPENDS
Core
imgui
${Vulkan}
${Vulkan_Dependency}
)
#-----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment