Commit 023be85c authored by Aaron Bray's avatar Aaron Bray
Browse files

ENH: CMake Improvements

- Removed ODE
- External Data placed in install
- Add MSVC Build and Run Support
- OpenVR tested and failed against new build, needs fix
parent b00223d6
......@@ -11,6 +11,17 @@ endif()
#-----------------------------------------------------------------------------
# CMake global args
#-----------------------------------------------------------------------------
if(MSVC)
# Allow the MP flag to get set externally
set(iMSTK_ENABLE_MULTI_PROCESS_BUILDS ON CACHE BOOL "Enable multi-process builds")
set(PROCESSOR_COUNT "$ENV{NUMBER_OF_PROCESSORS}")
set(iMSTK_NUM_BUILD_PROCESSES ${PROCESSOR_COUNT} CACHE STRING "The maximum number of processes for the /MP flag")
if(${PROJECT}_ENABLE_MULTI_PROCESS_BUILDS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP${iMSTK_NUM_BUILD_PROCESSES}" CACHE STRING INTERNAL FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP${iMSTK_NUM_BUILD_PROCESSES}" CACHE STRING INTERNAL FORCE)
endif()
endif()
message(STATUS "CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}" )
mark_as_superbuild(
VARS
CMAKE_BUILD_TYPE
......@@ -75,8 +86,6 @@ ExternalProject_Add( ${PROJECT_NAME}
-DBUILD_TESTING:BOOL=${BUILD_TESTING}
-D${PROJECT_NAME}_SUPERBUILD:BOOL=OFF
-D${PROJECT_NAME}_USE_OMNI:BOOL=${${PROJECT_NAME}_USE_OMNI}
-D${PROJECT_NAME}_USE_ODE:BOOL=${${PROJECT_NAME}_USE_ODE}
-DODE_ROOT_DIR:PATH=${ODE_ROOT_DIR}
-D${PROJECT_NAME}_USE_Vulkan:BOOL=${${PROJECT_NAME}_USE_Vulkan}
-D${PROJECT_NAME}_ENABLE_AUDIO:BOOL=${${PROJECT_NAME}_ENABLE_AUDIO}
-D${PROJECT_NAME}_ENABLE_VR:BOOL=${${PROJECT_NAME}_ENABLE_VR}
......
#----------------------------------------------------------
# ODE does not have a cmake version.
# Use of this file is a workaround to create a mode for setting
# up iMSTK to build with ODE.
# This piece of code also sets other necessary directories.
# It is assumed that ODE was compiled with double precision.
#
# When ODE is configured with cmake (in future),
# this script should be updated.
#----------------------------------------------------------
set(USE_SYSTEM_ODE 1 CACHE BOOL "Use system ODE" FORCE)
#-----------------------------------------------------------------------------
# Add External Project
#-----------------------------------------------------------------------------
include(imstkAddExternalProject)
imstk_add_external_project( ODE
DOWNLOAD_COMMAND ${SKIP_STEP_COMMAND}
CONFIGURE_COMMAND ${SKIP_STEP_COMMAND}
BUILD_COMMAND ${SKIP_STEP_COMMAND}
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
RELATIVE_INCLUDE_PATH ""
DEPENDENCIES ""
#VERBOSE
)
mark_as_superbuild(ODE_INCLUDE_DIR)
mark_as_superbuild(ODE_LIBRARY)
#-----------------------------------------------------------------------------
if(WIN32)
# Since on windows there is no support for Runtime Path, we need to copy
# the ODE shared library.
if(NOT DEFINED ODE_SHARED_LIBRARY)
get_filename_component(_dir ${ODE_LIBRARY} DIRECTORY)
get_filename_component(_name_we ${ODE_LIBRARY} NAME_WE)
set(ODE_SHARED_LIBRARY "${_dir}/${_name_we}.dll")
if(NOT EXISTS "${ODE_SHARED_LIBRARY}")
message(FATAL_ERROR "ODE_SHARED_LIBRARY corresponds to a nonexistent file. ODE_SHARED_LIBRARY is '${ODE_SHARED_LIBRARY}'")
endif()
endif()
set(_dest "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/")
ExternalProject_Add_Step( ODE copy_shared_library
COMMAND ${CMAKE_COMMAND} -E make_directory ${_dest}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ODE_SHARED_LIBRARY} ${_dest}
COMMENT "Copy ODE shared library into ${_dest}"
DEPENDERS download
USES_TERMINAL 1
)
endif()
......@@ -2,9 +2,13 @@
# Dependencies
#-----------------------------------------------------------------------------
set(VTK_DEPENDENCIES "")
set(VTK_ENABLE_OPENVR "NO")
if(${${PROJECT_NAME}_ENABLE_VR})
list(APPEND VTK_DEPENDENCIES "openvr")
endif(${${PROJECT_NAME}_ENABLE_VR})
set(VTK_ENABLE_OPENVR "YES")
endif()
message(STATUS "iMSTK_ENABLE_VR : ${${PROJECT_NAME}_ENABLE_VR}")
#-----------------------------------------------------------------------------
# Add External Project
......@@ -26,6 +30,7 @@ imstk_add_external_project( VTK
-DModule_vtkInteractionStyle:BOOL=ON
-DModule_vtkRenderingAnnotation:BOOL=ON
-DModule_vtkRenderingOpenVR:BOOL=${${PROJECT_NAME}_ENABLE_VR}
-DVTK_MODULE_ENABLE_VTK_RenderingOpenVR:STRING=${VTK_ENABLE_OPENVR}
-DModule_vtkInteractionWidgets:BOOL=ON
-DModule_vtkglew:BOOL=ON
-DModule_vtkRenderingContext2D:BOOL=ON
......
# Finding ODE from a pre-installed directory
# Find ODE include directories and libraries
find_path(ODE_INCLUDE_DIR
NAMES
ode/ode.h
PATHS
${ODE_ROOT_DIR}
${ODE_ROOT_DIR}/include
NO_DEFAULT_PATH
)
# Create library directory hints
list(APPEND ODE_LIBRARY_HINTS ${ODE_ROOT_DIR}/lib)
# Windows compilation has special directories.
set(_ode_lib_name_win)
if(WIN32)
list(APPEND ODE_LIBRARY_HINTS ${ODE_ROOT_DIR}/lib/ReleaseDoubleDLL)
list(APPEND ODE_LIBRARY_HINTS ${ODE_ROOT_DIR}/lib/DebugDoubleDLL)
set(_ode_lib_name_win ode_double)
list(APPEND _ode_lib_name_win ode_doubled)
endif()
find_library(ODE_LIBRARY
NAMES
${_ode_lib_name_win}
ode
HINTS
${ODE_LIBRARY_HINTS}
)
list(APPEND ODE_LIBRARIES ${ODE_LIBRARY})
if(NOT ODE_FIND_QUIETLY)
message(STATUS "ODE_INCLUDE_DIR is ${ODE_INCLUDE_DIR}")
message(STATUS "ODE_LIBRARIES is ${ODE_LIBRARIES}")
endif()
#-----------------------------------------------------------------------------
# Find package
#-----------------------------------------------------------------------------
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ODE
REQUIRED_VARS
ODE_INCLUDE_DIR
ODE_LIBRARIES
)
#-----------------------------------------------------------------------------
# If missing target, create it
#-----------------------------------------------------------------------------
if(ODE_FOUND AND NOT TARGET libodedouble)
add_library(libodedouble INTERFACE IMPORTED)
set_target_properties(libodedouble PROPERTIES
INTERFACE_LINK_LIBRARIES "${ODE_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${ODE_INCLUDE_DIR}"
)
endif()
\ No newline at end of file
......@@ -88,7 +88,7 @@ function(imstk_add_library target)
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wall>
$<$<CXX_COMPILER_ID:MSVC>:
-W4>)
-W4 -MP>)
#-----------------------------------------------------------------------------
# Install headers
......
......@@ -8,45 +8,46 @@ function(compileShaders sourceShader binaryShader)
endfunction()
function(CopyAndCompileShaders)
if( iMSTK_USE_Vulkan )
file(COPY ${CMAKE_SOURCE_DIR}/Source/Rendering/VulkanRenderer/VulkanShaders
DESTINATION ${PROJECT_BINARY_DIR}/Shaders)
if( iMSTK_USE_Vulkan )
file(COPY ${CMAKE_SOURCE_DIR}/Source/Rendering/VulkanRenderer/VulkanShaders
DESTINATION ${PROJECT_BINARY_DIR}/Shaders/VulkanShaders)
# 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)
# 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)
# 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)
# 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)
file(COPY ${PROJECT_BINARY_DIR}/Shaders/VulkanShaders
DESTINATION ${CMAKE_PROGRAM_PATH}/Shaders)
else( iMSTK_USE_Vulkan )
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Source/Rendering/VTKRenderer/VTKShaders
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/Shaders)
endif()
install(DIRECTORY ${PROJECT_BINARY_DIR}/Shaders/VulkanShaders
DESTINATION ${CMAKE_INSTALL_PREFIX}/data/shaders)
else()
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Source/Rendering/VTKRenderer/VTKShaders
DESTINATION ${CMAKE_INSTALL_PREFIX}/data/shaders)
endif()
endfunction()
\ No newline at end of file
......@@ -21,7 +21,6 @@ list(APPEND ExternalData_OBJECT_STORES
"${CMAKE_SOURCE_DIR}/.ExternalData"
)
set(ExternalData_BINARY_ROOT ${CMAKE_BINARY_DIR}/ExternalData)
# Expands %(algo:lower)
set(ExternalData_URL_ALGO_MD5_lower md5)
......@@ -49,18 +48,17 @@ set(ExternalData_SERIES_MATCH "(\\.[0-9]+)?")
# Sometimes we want to download very large files.
set(ExternalData_TIMEOUT_ABSOLUTE 900)
# Configure the default iMSTK_DATA_CONTENT_LINKS_PATH for the location of iMSTK Data content links.
set(iMSTK_DATA_CONTENT_LINKS_PATH "${iMSTK_SOURCE_DIR}/Data")
set(ExternalData_SOURCE_ROOT "${iMSTK_SOURCE_DIR}/Data")
set(ExternalData_BINARY_ROOT "${CMAKE_INSTALL_PREFIX}/data/")
# Define the path to the data root directory
add_definitions( -DiMSTK_DATA_ROOT=\"${ExternalData_BINARY_ROOT}/Data\")
add_definitions( -DiMSTK_DATA_ROOT=\"${ExternalData_BINARY_ROOT}\")
# Function to upload data from list of data file
function(imstk_add_data target)
# Download data
foreach(file IN LISTS ARGN)
set(datalist "${datalist} DATA{${iMSTK_DATA_CONTENT_LINKS_PATH}/${file}}")
set(datalist "${datalist} DATA{${ExternalData_SOURCE_ROOT}/${file}}")
endforeach()
ExternalData_expand_arguments(${target}ExternalData
......
cmake_minimum_required(VERSION 3.9)
project(iMSTK VERSION 0.0.1 LANGUAGES C CXX)
project(iMSTK VERSION 1.0.0 LANGUAGES C CXX)
if(UNIX AND NOT APPLE)
set(LINUX TRUE)
......@@ -37,10 +37,10 @@ if(APPLE)
else()
set(${PROJECT_NAME}_INSTALL_ROOT "${CMAKE_INSTALL_PREFIX}")
endif()
set(${PROJECT_NAME}_INSTALL_BIN_DIR "${${PROJECT_NAME}_INSTALL_ROOT}/${${PROJECT_NAME}_BIN_DIR}/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}")
set(${PROJECT_NAME}_INSTALL_LIB_DIR "${${PROJECT_NAME}_INSTALL_ROOT}/${${PROJECT_NAME}_LIB_DIR}/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}")
set(${PROJECT_NAME}_INSTALL_INCLUDE_DIR "${${PROJECT_NAME}_INSTALL_ROOT}/${${PROJECT_NAME}_INCLUDE_DIR}/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}")
set(${PROJECT_NAME}_INSTALL_SHARE_DIR "${${PROJECT_NAME}_INSTALL_ROOT}/${${PROJECT_NAME}_SHARE_DIR}/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}")
set(${PROJECT_NAME}_INSTALL_BIN_DIR "${${PROJECT_NAME}_INSTALL_ROOT}/bin")
set(${PROJECT_NAME}_INSTALL_LIB_DIR "${${PROJECT_NAME}_INSTALL_ROOT}/lib")
set(${PROJECT_NAME}_INSTALL_INCLUDE_DIR "${${PROJECT_NAME}_INSTALL_ROOT}/include/imstk-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
set(${PROJECT_NAME}_INSTALL_SHARE_DIR "${${PROJECT_NAME}_INSTALL_ROOT}")
#-----------------------------------------------------------------------------
# Update CMake module path & cmake dir
#-----------------------------------------------------------------------------
......@@ -131,16 +131,6 @@ if(${PROJECT_NAME}_SUPERBUILD)
imstk_define_dependency(openvr)
endif()
option(${PROJECT_NAME}_USE_ODE "Build iMSTK with ODE support." OFF)
if(${PROJECT_NAME}_USE_ODE)
imstk_define_dependency(ODE)
endif()
#----------------------------------------------------
# Setting up ODE from preinstalled directories.
#----------------------------------------------------
#include(CMake/External/External_ODE.cmake)
if(${PROJECT_NAME}_BUILD_TESTING)
imstk_define_dependency(GoogleTest)
......@@ -200,17 +190,6 @@ find_package( LibNiFalcon REQUIRED)
# Libusb
find_package( Libusb REQUIRED)
# ODE
if(${PROJECT_NAME}_USE_ODE)
find_package(ODE)
# Assuming that ODE was compiled with Double precision.
add_definitions( -DdDOUBLE ) # Needed by ODE library.
add_definitions( -DiMSTK_USE_ODE )
else()
remove_definitions( -DdDouble )
remove_definitions( -DiMSTK_USE_ODE )
endif()
# OpenVR
if(${PROJECT_NAME}_ENABLE_VR)
add_definitions( -DiMSTK_ENABLE_VR )
......@@ -297,6 +276,12 @@ if(${PROJECT_NAME}_BUILD_TESTING OR ${PROJECT_NAME}_BUILD_EXAMPLES)
include(imstkExternalData)
include(imstkExternalDataDownloadTest)
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
endif()
#--------------------------------------------------------------------------
......
......@@ -39,20 +39,17 @@ else()
SimulationManager
${SFML_LIBRARIES})
endif()
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
list(APPEND FILE_LIST
sound/,REGEX:.*)
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
#-----------------------------------------------------------------------------
# Set MSVC working directory to the install/bin directory
#-----------------------------------------------------------------------------
if(MSVC) # Configure running executable out of MSVC
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${iMSTK_INSTALL_BIN_DIR}")
endif()
......@@ -18,43 +18,44 @@
if(iMSTK_USE_OMNI)
project(Example-BoneDrilling)
project(Example-BoneDrilling)
#-----------------------------------------------------------------------------
# Create executable
#-----------------------------------------------------------------------------
add_executable(${PROJECT_NAME} BoneDrillingExample.cpp)
#-----------------------------------------------------------------------------
# Create executable
#-----------------------------------------------------------------------------
add_executable(${PROJECT_NAME} BoneDrillingExample.cpp)
#-----------------------------------------------------------------------------
# Add the target to Examples folder
#-----------------------------------------------------------------------------
SET_TARGET_PROPERTIES (${PROJECT_NAME} PROPERTIES FOLDER Examples)
#-----------------------------------------------------------------------------
# Add the target to Examples folder
#-----------------------------------------------------------------------------
SET_TARGET_PROPERTIES (${PROJECT_NAME} PROPERTIES FOLDER Examples)
#-----------------------------------------------------------------------------
# Link libraries to executable
#-----------------------------------------------------------------------------
if(UNIX)
target_link_libraries(${PROJECT_NAME}
SimulationManager
apiUtilities)
else()
target_link_libraries(${PROJECT_NAME}
SimulationManager
apiUtilities
SFML)
endif()
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
#-----------------------------------------------------------------------------
list(APPEND FILE_LIST
asianDragon/,REGEX:.*)
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
#-----------------------------------------------------------------------------
# Link libraries to executable
#-----------------------------------------------------------------------------
if(UNIX)
target_link_libraries(${PROJECT_NAME}
SimulationManager
apiUtilities)
else()
target_link_libraries(${PROJECT_NAME}
SimulationManager
apiUtilities
SFML)
endif()
endif()
\ No newline at end of file
#-----------------------------------------------------------------------------
# Associate external data
#-----------------------------------------------------------------------------
list(APPEND FILE_LIST
asianDragon/,REGEX:.*)
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
#-----------------------------------------------------------------------------
# Set MSVC working directory to the install/bin directory
#-----------------------------------------------------------------------------
if(MSVC) # Configure running executable out of MSVC
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${iMSTK_INSTALL_BIN_DIR}")
endif()
endif()
......@@ -33,13 +33,7 @@ if(iMSTK_USE_OMNI)
# Link libraries to executable
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager apiUtilities)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
#-----------------------------------------------------------------------------
......@@ -47,4 +41,10 @@ if(iMSTK_USE_OMNI)
asianDragon/,REGEX:.*)
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
endif()
\ No newline at end of file
#-----------------------------------------------------------------------------
# Set MSVC working directory to the install/bin directory
#-----------------------------------------------------------------------------
if(MSVC) # Configure running executable out of MSVC
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${iMSTK_INSTALL_BIN_DIR}")
endif()
endif()
......@@ -2,20 +2,18 @@
# Add Example subdirectories
#-----------------------------------------------------------------------------
macro(listOfSubDir result curdir)
file(GLOB children RELATIVE ${curdir} ${curdir}/*)
set(dirlist "")
foreach(child ${children})
if(IS_DIRECTORY ${curdir}/${child})
list(APPEND dirlist ${child})
endif()
endforeach()
set(${result} ${dirlist})
endmacro()
file(GLOB children RELATIVE ${curdir} ${curdir}/*)
set(dirlist "")
foreach(child ${children})
if(IS_DIRECTORY ${curdir}/${child})
list(APPEND dirlist ${child})
endif()
endforeach()
set(${result} ${dirlist})
endmacro()
listOfSubDir(subDirs ${CMAKE_CURRENT_SOURCE_DIR})
listOfSubDir(subDirs ${CMAKE_CURRENT_SOURCE_DIR})
foreach(subdir ${subDirs})
add_subdirectory(${subdir})
foreach(subdir ${subDirs})
add_subdirectory(${subdir})
endforeach()
......@@ -33,15 +33,16 @@ SET_TARGET_PROPERTIES (${PROJECT_NAME} PROPERTIES FOLDER Examples)
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager apiUtilities)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
#-----------------------------------------------------------------------------
list(APPEND FILE_LIST
asianDragon/,REGEX:.*)
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
\ No newline at end of file
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
#-----------------------------------------------------------------------------
# Set MSVC working directory to the install/bin directory
#-----------------------------------------------------------------------------
if(MSVC) # Configure running executable out of MSVC
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${iMSTK_INSTALL_BIN_DIR}")
endif()
......@@ -33,15 +33,16 @@ SET_TARGET_PROPERTIES (${PROJECT_NAME} PROPERTIES FOLDER Examples)
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager apiUtilities)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
#-----------------------------------------------------------------------------
list(APPEND FILE_LIST
asianDragon/,REGEX:.*)
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
\ No newline at end of file
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
#-----------------------------------------------------------------------------
# Set MSVC working directory to the install/bin directory
#-----------------------------------------------------------------------------
if(MSVC) # Configure running executable out of MSVC
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${iMSTK_INSTALL_BIN_DIR}")
endif()
......@@ -27,14 +27,15 @@ add_executable(${PROJECT_NAME} ExtractSurfaceExample.cpp)
# Add the target to Examples folder
#-----------------------------------------------------------------------------
SET_TARGET_PROPERTIES (${PROJECT_NAME} PROPERTIES FOLDER Examples)
#-----------------------------------------------------------------------------
# Add shaders
# Link libraries to executable
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
target_link_libraries(${PROJECT_NAME} SimulationManager apiUtilities)
#-----------------------------------------------------------------------------
# Link libraries to executable
# Set MSVC working directory to the install/bin directory
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager apiUtilities)
\ No newline at end of file
if(MSVC) # Configure running executable out of MSVC
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${iMSTK_INSTALL_BIN_DIR}")
endif()
......@@ -18,34 +18,35 @@
if(iMSTK_USE_Vulkan)
project(Example-GUIOverlay)
project(Example-GUIOverlay)
#-----------------------------------------------------------------------------
# Create executable