Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for macOS & OpenVDB CMake #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 12 additions & 3 deletions tools/cmake/FindOpenVDB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()