diff --git a/.gitignore b/.gitignore index 9382ee6d..3deb2a25 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,43 @@ waveletNoiseTileDouble.bin build doc tensorflow/mantaGen/datasets + + +# Created by https://www.gitignore.io/ + +### CLion ### +.idea/ +*.iml +*.ipr +*.iws + +# CMake +cmake-build-*/ + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk diff --git a/CMakeLists.txt b/CMakeLists.txt index 642e720a..e67a7ad1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -375,6 +375,11 @@ if(OPENVDB) list(APPEND INCLUDE_PATHS ${OPENVDB_INCLUDE_DIR}) list(APPEND F_LIB_PATHS ${OPENVDB_LIBRARY_DIR}) list(APPEND F_LIBS ${OPENVDB_LIBRARY}) + + if(APPLE) + list(APPEND F_LIBS Half) + endif() + add_definitions(${OPENVDB_DEFINITIONS}) else() if (WIN32) diff --git a/tools/cmake/FindOpenVDB.cmake b/tools/cmake/FindOpenVDB.cmake index 8f1fe19f..03971f6b 100644 --- a/tools/cmake/FindOpenVDB.cmake +++ b/tools/cmake/FindOpenVDB.cmake @@ -8,7 +8,9 @@ # OPENVDB_DEFINITIONS if(NOT OPENVDB_ROOT) - if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/openVDB") + if (IS_DIRECTORY "/usr/local/opt/openvdb/") # mac/homebrew (version independent)) + set(OPENVDB_ROOT "/usr/local/opt/openvdb/") + elseif(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/openVDB") set(OPENVDB_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/openVDB") endif() else() @@ -18,9 +20,16 @@ endif() if(OPENVDB_ROOT) set(OPENVDB_INCLUDE_DIR "${OPENVDB_ROOT}/include" CACHE PATH "Include files for openVDB") set(OPENVDB_LIBRARY_DIR "${OPENVDB_ROOT}/lib" CACHE PATH "OpenVDB libraries") - set(OPENVDB_LIBRARY "${OPENVDB_LIBRARY_DIR}/openVDB.lib" CACHE FILEPATH "OpenVDB library filepath") + set(OPENVDB_DEFINITIONS "") list(APPEND OPENVDB_DEFINITIONS -DOPENVDB_DLL) - list(APPEND OPENVDB_DEFINITIONS -DOPENVDB_3_ABI_COMPATIBLE) + + if(APPLE) + set(OPENVDB_LIBRARY "openvdb") + else() + set(OPENVDB_LIBRARY "${OPENVDB_LIBRARY_DIR}/openVDB.lib" CACHE FILEPATH "OpenVDB library filepath") + list(APPEND OPENVDB_DEFINITIONS -DOPENVDB_3_ABI_COMPATIBLE) + endif() + set(OPENVDB_FOUND TRUE) endif() \ No newline at end of file