Commit 08af5bd5 authored by Harald Scheirich's avatar Harald Scheirich
Browse files

Merge branch 'master' into fix/scalars-in-dynamic-meshes

parents 0d8c1976 c9f002ec
<!-- The text within this markup is a comment, and is intended to provide
guidelines to open a Pull Request for the iMSTK repository. This text will not
be part of the Pull Request. -->
<!-- See the [Contributing guidelines](https://gitlab.kitware.com/iMSTK/iMSTK/-/blob/master/CONTRIBUTING.md). Specifically:
Start commit messages with a standard prefix (and a space):
* BUG: fix for runtime crash or incorrect result
* COMP: compiler error or warning fix
* DOC: documentation change
* ENH: new functionality
* PERF: performance improvement
* STYLE: no logic impact (indentation, comments)
* WIP: Work In Progress not ready for merge
* REFAC: Refactoring the code
Provide a short, meaningful message that describes the change you made.
When the PR is based on a single commit, the commit message is usually left as
the PR message.
-->
## PR Checklist
- [ ] No API changes were made (or the changes have been approved)
- [ ] No major design changes were made (or the changes have been approved)
- [ ] No new dependecies were added (or the new dependencies have been approved)
- [ ] Added test (or behavior not changed)
- [ ] Updated API documentation (or API not changed)
- [ ] Ran the `CodeFormatEnforcer` task and verified the header is in all new files
- [ ] Added [iMSTK examples](https://gitlab.kitware.com/iMSTK/iMSTK/-/tree/master/Examples) for all new major features (if any)
<!-- **Thanks for contributing to iMSTK!** -->
\ No newline at end of file
......@@ -95,14 +95,13 @@ ExternalProject_Add( ${PROJECT_NAME}
-D${PROJECT_NAME}_BUILD_EXAMPLES:BOOL=${${PROJECT_NAME}_BUILD_EXAMPLES}
-D${PROJECT_NAME}_BUILD_TESTING:BOOL=${${PROJECT_NAME}_BUILD_TESTING}
-D${PROJECT_NAME}_USE_OpenHaptics:BOOL=${${PROJECT_NAME}_USE_OpenHaptics}
-D${PROJECT_NAME}_USE_MODEL_REDUCTION:BOOL=${${PROJECT_NAME}_USE_MODEL_REDUCTION}
-D${PROJECT_NAME}_USE_Vulkan:BOOL=${${PROJECT_NAME}_USE_Vulkan}
-D${PROJECT_NAME}_USE_MODEL_REDUCTION:BOOL=${${PROJECT_NAME}_USE_MODEL_REDUCTION}
-D${PROJECT_NAME}_ENABLE_AUDIO:BOOL=${${PROJECT_NAME}_ENABLE_AUDIO}
-D${PROJECT_NAME}_USE_VRPN:BOOL=${${PROJECT_NAME}_USE_VRPN}
-D${PROJECT_NAME}_COLOR_OUTPUT:BOOL=${${PROJECT_NAME}_COLOR_OUTPUT}
-D${PROJECT_NAME}_USE_VTK_OSMESA:BOOL=${${PROJECT_NAME}_USE_VTK_OSMESA}
# External Libraries
-DEigen3_DIR:PATH=${Eigen3_DIR}
-Dglm_DIR:PATH=${glm_DIR}
-DEigen3_DIR:PATH=${Eigen3_DIR}
-DGTest_DIR:PATH=${GTest_DIR}
-DVegaFEM_DIR:PATH=${VegaFEM_DIR}
-DVTK_DIR:PATH=${VTK_DIR}
......
......@@ -3,12 +3,13 @@
#-----------------------------------------------------------------------------
include(imstkAddExternalProject)
imstk_add_external_project( GTest
URL https://gitlab.kitware.com/iMSTK/googletest/-/archive/release-1.10.0/googletest-release-1.10.0.zip
URL_MD5 1878d0300f865cb54df06b220ded5168
URL https://github.com/google/googletest/archive/53495a2a7d6ba7e0691a7f3602e9a5324bba6e45.zip
URL_MD5 8349ef674d27b005a43ce3679cb04947
CMAKE_CACHE_ARGS
-DBUILD_GMOCK:BOOL=ON
-DBUILD_GTEST:BOOL=ON
-DBUILD_SHARED_LIBS:BOOL=ON
-DBUILD_SHARED_LIBS:BOOL=OFF
-Dgtest_force_shared_crt:BOOL=ON
DEPENDENCIES ""
RELATIVE_INCLUDE_PATH ""
#VERBOSE
......
......@@ -45,6 +45,13 @@ else()
message(STATUS "Building dual PhysX configurations")
endif()
if(MSVC)
set(NO_MEMSET "")
else()
# Newer GCC complains with the selected physx version
set(NO_MEMSET "-Wno-error=class-memaccess")
endif()
set(PHYSX_iMSTK_INSTALL "${CMAKE_COMMAND}"
-DPhysX_INSTALL_DIR=${PhysX_BINARY_DIR}/install
-DiMSTK_INSTALL_DIR=${CMAKE_INSTALL_PREFIX}
......@@ -55,6 +62,7 @@ imstk_add_external_project( PhysX
URL_MD5 9c17263ceec705eaf1ddd7c2ee796bac
SOURCE_SUBDIR ./physx/compiler/public
CMAKE_CACHE_ARGS
-DPHYSX_CXX_FLAGS:STRING=${NO_MEMSET}
-DCMAKE_BUILD_TYPE:STRING=${PHYSX_CONFIGURATION}
-DCMAKE_INSTALL_PREFIX:PATH=${PhysX_BINARY_DIR}/install
-DPXSHARED_INSTALL_PREFIX:PATH=${PhysX_BINARY_DIR}/install
......
#-----------------------------------------------------------------------------
# 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
)
#-----------------------------------------------------------------------------
# Add External Project
#-----------------------------------------------------------------------------
include(imstkAddExternalProject)
imstk_add_external_project( glfw
URL https://gitlab.kitware.com/iMSTK/glfw/-/archive/3.2.1/glfw-3.2.1.zip
URL_MD5 cb412cba8daba35d849ddfe78700a210
CMAKE_ARGS
-DGLFW_BUILD_DOCS:BOOL=OFF
-DGLFW_BUILD_EXAMPLES:BOOL=OFF
-DGLFW_BUILD_TESTS:BOOL=OFF
RELATIVE_INCLUDE_PATH ""
DEPENDENCIES ""
#VERBOSE
)
#-----------------------------------------------------------------------------
# Add External Project
#-----------------------------------------------------------------------------
include(imstkAddExternalProject)
imstk_add_external_project( gli
URL https://gitlab.kitware.com/iMSTK/gli/-/archive/0.8.2/gli-0.8.2.zip
URL_MD5 6f891066d2365bbd58f27a71763ca335
RELATIVE_INCLUDE_PATH ""
DEPENDENCIES ""
#VERBOSE
)
#-----------------------------------------------------------------------------
# Add External Project
#-----------------------------------------------------------------------------
include(imstkAddExternalProject)
imstk_add_external_project( glm
URL https://gitlab.kitware.com/iMSTK/glm/-/archive/0.9.8.3/glm-0.9.8.3.zip
URL_MD5 a95fae241b7ff3ba7d6e614cfd87df02
RELATIVE_INCLUDE_PATH ""
DEPENDENCIES ""
#VERBOSE
)
#-----------------------------------------------------------------------------
# Add External Project
#-----------------------------------------------------------------------------
include(imstkAddExternalProject)
imstk_define_external_dirs( imgui )
# Gather up headers for install
set(imgui_H_FILES ${imgui_SOURCE_DIR}/imconfig.h
${imgui_SOURCE_DIR}/imgui.h
${imgui_SOURCE_DIR}/imstb_rectpack.h
${imgui_SOURCE_DIR}/imstb_textedit.h
${imgui_SOURCE_DIR}/imstb_truetype.h
)
set(make_imgui_dir_command
${CMAKE_COMMAND} -E make_directory
${CMAKE_INSTALL_PREFIX}/include/imgui/
)
set(copy_imgui_headers_command
${CMAKE_COMMAND} -E copy
${imgui_H_FILES}
${CMAKE_INSTALL_PREFIX}/include/imgui/
)
imstk_add_external_project( imgui
URL https://gitlab.kitware.com/iMSTK/imgui/-/archive/v1.65/imgui-v1.65.zip
URL_MD5 e255a471fa1cc4f2be931659c253956a
CONFIGURE_COMMAND ${SKIP_STEP_COMMAND}
BUILD_COMMAND ${SKIP_STEP_COMMAND}
INSTALL_COMMAND
COMMAND ${make_imgui_dir_command}
COMMAND ${copy_imgui_headers_command}
RELATIVE_INCLUDE_PATH ""
DEPENDENCIES ""
#VERBOSE
)
#-----------------------------------------------------------------------------
# Vulkan renderer
#-----------------------------------------------------------------------------
include(imstkFind)
#-----------------------------------------------------------------------------
# Find All Headers and Libraries for VulkanSDK
#-----------------------------------------------------------------------------
imstk_find_header(VulkanSDK vulkan/vulkan.h)
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}")
include(imstkFind)
#-----------------------------------------------------------------------------
# Find All Headers and Libraries for g3log
#-----------------------------------------------------------------------------
imstk_find_header(glfw glfw/glfw3.h)
imstk_find_libary(glfw glfw3)
imstk_find_package(glfw)
#message(STATUS "glfw include : ${GLFW_INCLUDE_DIRS}")
#message(STATUS "glfw libraries : ${GLFW_LIBRARIES}")
include(imstkFind)
#-----------------------------------------------------------------------------
# Find All Headers and Libraries for glm
#-----------------------------------------------------------------------------
imstk_find_header(gli gli/gli.hpp)
imstk_find_header_package(gli)
#message(STATUS "gli include : ${GLI_INCLUDE_DIRS}")
\ No newline at end of file
include(imstkFind)
#-----------------------------------------------------------------------------
# Find All Headers for imgui
#-----------------------------------------------------------------------------
imstk_find_header(imgui imgui.h imgui)
imstk_find_header_package(imgui)
#message(STATUS "imgui includes : ${IMGUI_INCLUDE_DIRS}")
if(FIND_IMGUI_SOURCE)
#-----------------------------------------------------------------------------
# Find Source
# Since imgui has no CMake, code is pulled into an iMSTK component directly
#-----------------------------------------------------------------------------
find_path(IMGUI_SOURCE_DIR
NAMES
imgui.cpp
PATHS
${CMAKE_BINARY_DIR}/../External/imgui/src
NO_DEFAULT_PATH
)
mark_as_advanced(IMGUI_SOURCE_DIR)
#message(STATUS "imgui source : ${IMGUI_SOURCE_DIR}")
#-----------------------------------------------------------------------------
# Find package
#-----------------------------------------------------------------------------
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(imgui
REQUIRED_VARS
IMGUI_SOURCE_DIR)
endif()
......@@ -21,7 +21,7 @@ macro(imstk_add_executable target)
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wall -Wno-unused-function>
$<$<CXX_COMPILER_ID:MSVC>:
-W4 -MP -wd4505>)
-W4 -MP -wd4505 /bigobj>)
endif()
set_target_properties(${target} PROPERTIES
......
......@@ -96,13 +96,13 @@ function(imstk_add_library target)
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wall -Wno-unused-function -fdiagnostics-color=always>
$<$<CXX_COMPILER_ID:MSVC>:
-W4 -MP -wd4505>)
-W4 -MP -wd4505 /bigobj>)
else()
target_compile_options(${target} PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wall -Wno-unused-function>
$<$<CXX_COMPILER_ID:MSVC>:
-W4 -MP -wd4505>)
-W4 -MP -wd4505 /bigobj>)
endif()
#-----------------------------------------------------------------------------
......
# gtest_add_tests
#
# Taken from https://github.com/Kitware/CMake/blob/master/Modules/FindGTest.cmake
#
# Only changed the 'add_test' line to add 'extra_args' before the 'gtest_filter' flag.
# Doing so allows to use gtest with a ctest driver created after create_test_sourcelist,
# by providing the test file name as the first argument to the driver.
#
# Changes should become a part of CMake. Better improvements could be made to bring
# ctest and gtest together.
#
function(GTEST_ADD_TESTS executable extra_args)
if(NOT ARGN)
message(FATAL_ERROR "Missing ARGN: Read the documentation for GTEST_ADD_TESTS")
endif()
if(ARGN STREQUAL "AUTO")
# obtain sources used for building that executable
get_property(ARGN TARGET ${executable} PROPERTY SOURCES)
endif()
set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+) *, *([A-Za-z_0-9]+) *\\).*")
set(gtest_test_type_regex "(TYPED_TEST|TEST_?[FP]?)")
foreach(source ${ARGN})
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${source})
file(READ "${source}" contents)
string(REGEX MATCHALL "${gtest_test_type_regex} *\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
foreach(hit ${found_tests})
string(REGEX MATCH "${gtest_test_type_regex}" test_type ${hit})
# Parameterized tests have a different signature for the filter
if("x${test_type}" STREQUAL "xTEST_P")
string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" test_name ${hit})
elseif("x${test_type}" STREQUAL "xTEST_F" OR "x${test_type}" STREQUAL "xTEST")
string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" test_name ${hit})
elseif("x${test_type}" STREQUAL "xTYPED_TEST")
string(REGEX REPLACE ${gtest_case_name_regex} "\\1/*.\\2" test_name ${hit})
else()
message(WARNING "Could not parse GTest ${hit} for adding to CTest.")
continue()
endif()
add_test(NAME ${test_name} COMMAND ${executable} ${extra_args} --gtest_filter=${test_name} WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin) # changed here
endforeach()
endforeach()
endfunction()
# imstk_add_test
#
# Description: Will create tests for the given iMSTK target.
......@@ -72,35 +26,16 @@ endfunction()
# # test body on m_objectToTest
# }
#
# int imstkMyClassTest(int argc, char* argv[])
# {
# // Init Google Test
# ::testing::InitGoogleTest(&argc, argv);
#
# // Run tests with gtest
# return RUN_ALL_TESTS();
# }
#
function(imstk_add_test target)
include(GoogleTest)
set(test_driver_name "imstk${target}TestDriver")
string(TOLOWER ${target} target_lowercase)
set(test_driver_executable "imstk_${target_lowercase}_test_driver")
message(STATUS "Configuring ${test_driver_executable}")
#-----------------------------------------------------------------------------
# Check that Testing repository exists
#-----------------------------------------------------------------------------
if(NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Testing")
message(WARNING "Can not create test driver for ${target} target: missing 'Testing' directory in ${CMAKE_CURRENT_SOURCE_DIR}.")
return()
endif()
#-----------------------------------------------------------------------------
# Create test driver
#-----------------------------------------------------------------------------
function(imstk_add_test_internal target kind)
set(test_driver_executable "${target}${kind}")
# Get all source files
file(GLOB test_files "${CMAKE_CURRENT_SOURCE_DIR}/Testing/*Test.cpp")
file(GLOB test_files "${CMAKE_CURRENT_SOURCE_DIR}/*Test.cpp")
# Get all source file names
set(test_file_names "")
......@@ -109,44 +44,35 @@ function(imstk_add_test target)
list(APPEND test_file_names ${test_file_name})
endforeach()
# Create test driver main source file
create_test_sourcelist(test_sourcelist ${test_driver_name}.cpp ${test_file_names})
# Create test driver executable
imstk_add_executable(${test_driver_executable} ${test_driver_name}.cpp ${test_files})
imstk_add_executable(${test_driver_executable} ${test_files})
# Link test driver against current target, gtest and pthread
target_link_libraries(${test_driver_executable}
${target}
GTest::gtest
GTest::gmock
GTest::gtest_main
Threads::Threads
)
if (MSVC)
gtest_discover_tests(${test_driver_executable} WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}/bin" DISCOVERY_MODE PRE_TEST)
else()
gtest_add_tests(${test_driver_executable} SOURCES "${test_files}")
endif()
#-----------------------------------------------------------------------------
# Add the target to Testing folder
#-----------------------------------------------------------------------------
SET_TARGET_PROPERTIES (${test_driver_executable} PROPERTIES FOLDER Testing)
#-----------------------------------------------------------------------------
# Create tests
#-----------------------------------------------------------------------------
foreach(test_file ${test_files})
get_filename_component(test_name ${test_file} NAME_WE)
# A. Registers tests per gTests
# [aka] a lot of tests - Google Testing standards
gtest_add_tests(${test_driver_executable} ${test_name} ${test_file})
# ... or ...
# B. Registers tests per test files
# [aka] less tests - CTest standards
# include(ExternalData)
# ExternalData_add_test( ${PROJECT_NAME}Data
# NAME ${test_name}
# COMMAND $<TARGET_FILE:${test_driver_executable}> ${test_name} --gtest_filter=${test_name}.*
# )
endfunction()
endforeach()
function(imstk_add_test target)
imstk_add_test_internal(${target} Tests)
endfunction()
function(imstk_add_visual_test target)
imstk_add_test_internal(${target} VisualTests)
endfunction()
#-----------------------------------------------------------------------------
# Compile Shaders
#-----------------------------------------------------------------------------
add_custom_target(VulkanShaders ALL)
function(compileShaders sourceShader binaryShader)
add_custom_command(
TARGET VulkanShaders
COMMAND ${CMAKE_INSTALL_PREFIX}/bin/glslangvalidator -V ${Vulkan_Shaders}/${sourceShader} -o ${PROJECT_BINARY_DIR}/Shaders/VulkanShaders/${binaryShader})
endfunction()
function(CopyAndCompileShaders)
if( iMSTK_USE_Vulkan )
set(Vulkan_Shaders "${CMAKE_SOURCE_DIR}/Source/Rendering/VulkanRenderer/VulkanShaders")
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/Shaders/VulkanShaders/mesh")
# Mesh shaders
compileShaders(mesh/mesh_vert.vert mesh/mesh_vert.spv)
compileShaders(mesh/mesh_tesc.tesc mesh/mesh_tesc.spv)
compileShaders(mesh/mesh_tese.tese mesh/mesh_tese.spv)
compileShaders(mesh/mesh_frag.frag mesh/mesh_frag.spv)
compileShaders(mesh/decal_vert.vert mesh/decal_vert.spv)
compileShaders(mesh/decal_frag.frag mesh/decal_frag.spv)
compileShaders(mesh/particle_vert.vert mesh/particle_vert.spv)
compileShaders(mesh/particle_frag.frag mesh/particle_frag.spv)
compileShaders(mesh/shadow_vert.vert mesh/shadow_vert.spv)
compileShaders(mesh/shadow_frag.frag mesh/shadow_frag.spv)
compileShaders(mesh/depth_frag.frag mesh/depth_frag.spv)
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/Shaders/VulkanShaders/PostProcessing")
# Post processing shaders
compileShaders(PostProcessing/HDR_tonemap_frag.frag PostProcessing/HDR_tonemap_frag.spv)
compileShaders(PostProcessing/postprocess_vert.vert PostProcessing/postprocess_vert.spv)
compileShaders(PostProcessing/postprocess_frag.frag PostProcessing/postprocess_frag.spv)
compileShaders(PostProcessing/passthrough_frag.frag PostProcessing/passthrough_frag.spv)
compileShaders(PostProcessing/sss_frag.frag PostProcessing/sss_frag.spv)
compileShaders(PostProcessing/lens_distortion_frag.frag PostProcessing/lens_distortion_frag.spv)
compileShaders(PostProcessing/composite_frag.frag PostProcessing/composite_frag.spv)
compileShaders(PostProcessing/vr_composite_frag.frag PostProcessing/vr_composite_frag.spv)
compileShaders(PostProcessing/bloom_threshold_frag.frag PostProcessing/bloom_threshold_frag.spv)
compileShaders(PostProcessing/blur_horizontal_frag.frag PostProcessing/blur_horizontal_frag.spv)
compileShaders(PostProcessing/blur_vertical_frag.frag PostProcessing/blur_vertical_frag.spv)
compileShaders(PostProcessing/bloom_threshold_frag.frag PostProcessing/bloom_threshold_frag.spv)
compileShaders(PostProcessing/ao_frag.frag PostProcessing/ao_frag.spv)
compileShaders(PostProcessing/bilateral_blur_horizontal_frag.frag PostProcessing/bilateral_blur_horizontal_frag.spv)
compileShaders(PostProcessing/bilateral_blur_vertical_frag.frag PostProcessing/bilateral_blur_vertical_frag.spv)
compileShaders(PostProcessing/depth_downscale_frag.frag PostProcessing/depth_downscale_frag.spv)
install(DIRECTORY ${PROJECT_BINARY_DIR}/Shaders/VulkanShaders
DESTINATION ${CMAKE_INSTALL_PREFIX}/data/shaders)
endif()
endfunction()
\ No newline at end of file
......@@ -10,8 +10,8 @@ include(CMakeFindDependencyMacro)
# iMSTK settings
set(iMSTK_ROOT ${PACKAGE_PREFIX_DIR})
set(iMSTK_DATA_DIR ${PACKAGE_PREFIX_DIR}/data)
set(iMSTK_USE_Vulkan @iMSTK_USE_Vulkan@)
set(iMSTK_USE_OpenHaptics @iMSTK_USE_OpenHaptics@)
set(iMSTK_USE_VTK_OSMESA @iMSTK_USE_VTK_OSMESA@)
set(iMSTK_BUILD_TESTING @iMSTK_BUILD_TESTING@)
# Use the iMSTK modules to find all required packages
......@@ -24,7 +24,7 @@ set(CMAKE_DEBUG_POSTFIX @CMAKE_DEBUG_POSTFIX@)
find_package( Assimp REQUIRED )
# Eigen3
set(Eigen3_DIR @Eigen3_DIR@)
set(Eigen3_DIR "@Eigen3_DIR@")
find_dependency( Eigen3 REQUIRED )
# FTD2XX
......@@ -35,19 +35,12 @@ endif()
# g3log
find_package( g3log REQUIRED )
# glm
set(glm_DIR @glm_DIR@)
find_dependency( glm REQUIRED )
# GTest
if(iMSTK_BUILD_TESTING)
set(GTest_DIR @GTest_DIR@)
set(GTest_DIR "@GTest_DIR@")
find_dependency( GTest REQUIRED NO_DEFAULT_PATH )
endif()
# imgui
find_package( imgui REQUIRED )
# LibNiFalcon
find_package( LibNiFalcon REQUIRED)
......@@ -95,7 +88,7 @@ list(GET OPENVR_INCLUDE_DIRS 0 OpenVR_INCLUDE_DIR)
list(GET OPENVR_LIBRARIES 1 OpenVR_LIBRARY)
set(OpenVR_INCLUDE_DIR ${OpenVR_INCLUDE_DIR} CACHE INTERNAL "")
set(OpenVR_LIBRARY ${OpenVR_LIBRARY} CACHE INTERNAL "")
set(VTK_DIR @VTK_DIR@)
set(VTK_DIR "@VTK_DIR@")
find_dependency(VTK CONFIG)
# modules are linked via `VTK::CommonCore`
# vtk_module_autoinit is needed
......@@ -127,11 +120,6 @@ find_dependency(VTK COMPONENTS
RenderingVolumeOpenGL2
ViewsContext2D)
find_dependency(VTK COMPONENTS ${VTK_DEPENDENCIES})
# glfw, gli
if(iMSTK_USE_Vulkan)
find_package( glfw REQUIRED )
find_package( gli REQUIRED )
find_package( VulkanSDK REQUIRED)
add_definitions( -DiMSTK_USE_Vulkan )
endif()
if(iMSTK_USE_VTK_OSMESA)
add_definitions(-DiMSTK_USE_VTK_OSMESA)
endif()
\ No newline at end of file
......@@ -134,14 +134,11 @@ if(${PROJECT_NAME}_SUPERBUILD)
imstk_define_dependency(Uncrustify)
endif()
option(${PROJECT_NAME}_USE_Vulkan "Use the custom Vulkan renderer." OFF)
option(${PROJECT_NAME}_USE_OpenHaptics "Use OpenHaptic Support." OFF)
imstk_define_dependency(Assimp)
imstk_define_dependency(Eigen3)
imstk_define_dependency(g3log)
imstk_define_dependency(glm)
imstk_define_dependency(imgui)
imstk_define_dependency(LibNiFalcon)
imstk_define_dependency(openvr)
imstk_define_dependency(PhysX)
......@@ -167,12 +164,6 @@ if(${PROJECT_NAME}_SUPERBUILD)
set(${PROJECT_NAME}_AUDIO_ENABLED OFF)
endif()
if(${PROJECT_NAME}_USE_Vulkan)
imstk_define_dependency(glfw)
imstk_define_dependency(gli)
imstk_define_dependency(Vulkan)
endif()
if(${PROJECT_NAME}_BUILD_TESTING)
imstk_define_dependency(GTest)
......@@ -223,14 +214,6 @@ if(WIN32)
endif()
# g3log
find_package( g3log REQUIRED )
# glm
find_package( glm REQUIRED)
# imgui
# iMSTK actually includes and compiles imgui code
# As imgui does not have any cmake support
# So tell our find_package to also find the imgui source directory
set(FIND_IMGUI_SOURCE ON)
find_package( imgui REQUIRED )
# LibNiFalcon
find_package( LibNiFalcon REQUIRED)
# Libusb
......@@ -308,23 +291,10 @@ list(APPEND VTK_DEPENDENCIES
RenderingVolumeOpenGL2
ViewsContext2D)
find_package(VTK COMPONENTS ${VTK_DEPENDENCIES})
# Vulkan
set(Vulkan_Dependency)
if( ${PROJECT_NAME}_USE_Vulkan )
find_package( VulkanSDK REQUIRED)