Skip to content

Commit

Permalink
Uploaded makefiles for openvdb library.
Browse files Browse the repository at this point in the history
  • Loading branch information
U-POLYGON\zhou committed Dec 20, 2013
1 parent 19b57fe commit 3eef373
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions openvdb_2_1_0_library/openvdb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
FIND_PACKAGE(Boost REQUIRED)

FIND_PATH(ILMBASE_INCLUDE_DIR REQUIRED)
FIND_PATH(ILMBASE_LIBRARY_DIR REQUIRED)

FIND_PATH(TBB_INCLUDE_DIR REQUIRED)
FIND_PATH(TBB_LIBRARY_DIR REQUIRED)

FIND_PACKAGE(ZLIB REQUIRED)

INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR} ${TBB_INCLUDE_DIR} ${ILMBASE_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS} ${OPENVDB_DIR})
LINK_DIRECTORIES(${Boost_LIBRARY_DIR} ${ILMBASE_LIBRARY_DIR} ${TBB_LIBRARY_DIR})

SET(OPENVDB_SOURCE_FILES
Grid.cc
Platform.cc
openvdb.cc)

SET(OPENVDB_HEADER_FILES
Exceptions.h
Grid.h
Platform.h
Types.h
openvdb.h
version.h)

# IO
FILE(GLOB OPENVDB_IO_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/io/*.cc)
FILE(GLOB OPENVDB_IO_HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/io/*.h)
SOURCE_GROUP(IO FILES ${OPENVDB_IO_SOURCE_FILES} ${OPENVDB_IO_HEADER_FILES})

# Math
FILE(GLOB OPENVDB_MATH_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/math/*.cc)
FILE(GLOB OPENVDB_MATH_HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/math/*.h)
SOURCE_GROUP(Math FILES ${OPENVDB_MATH_SOURCE_FILES} ${OPENVDB_MATH_HEADER_FILES})

# Metadata
FILE(GLOB OPENVDB_METADATA_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/metadata/*.cc)
FILE(GLOB OPENVDB_METADATA_HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/metadata/*.h)
SOURCE_GROUP(Metadata FILES ${OPENVDB_METADATA_SOURCE_FILES} ${OPENVDB_METADATA_HEADER_FILES})

#Tools
FILE(GLOB OPENVDB_TOOLS_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/tools/*.cc)
FILE(GLOB OPENVDB_TOOLS_HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/tools/*.h)
SOURCE_GROUP(Tools FILES ${OPENVDB_TOOLS_SOURCE_FILES} ${OPENVDB_TOOLS_HEADER_FILES})

#Tree
FILE(GLOB OPENVDB_TREE_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/tree/*.cc)
FILE(GLOB OPENVDB_TREE_HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/tree/*.h)
SOURCE_GROUP(Tree FILES ${OPENVDB_TREE_SOURCE_FILES} ${OPENVDB_TREE_HEADER_FILES})

#Util
FILE(GLOB OPENVDB_UTIL_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/util/*.cc)
FILE(GLOB OPENVDB_UTIL_HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/util/*.h)
SOURCE_GROUP(Util FILES ${OPENVDB_UTIL_SOURCE_FILES} ${OPENVDB_UTIL_HEADER_FILES})

IF(MSVC)
ADD_DEFINITIONS(-DNOMINMAX)
SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} /bigobj)
ENDIF()

ADD_DEFINITIONS(-DOPENVDB_PRIVATE)

ADD_LIBRARY(openvdb SHARED ${OPENVDB_SOURCE_FILES} ${OPENVDB_HEADER_FILES}
${OPENVDB_IO_SOURCE_FILES} ${OPENVDB_IO_HEADER_FILES}
${OPENVDB_MATH_SOURCE_FILES} ${OPENVDB_MATH_HEADER_FILES}
${OPENVDB_METADATA_SOURCE_FILES} ${OPENVDB_METADATA_HEADER_FILES}
${OPENVDB_TOOLS_SOURCE_FILES} ${OPENVDB_TOOLS_HEADER_FILES}
${OPENVDB_TREE_SOURCE_FILES} ${OPENVDB_TREE_HEADER_FILES}
${OPENVDB_UTIL_SOURCE_FILES} ${OPENVDB_UTIL_HEADER_FILES})
TARGET_LINK_LIBRARIES(openvdb Half tbb ${ZLIB_LIBRARIES})
SET_TARGET_PROPERTIES(openvdb PROPERTIES VERSION 2.1.0 SOVERSION 2.1.0 OUTPUT_NAME "openvdb-2.1.0")

IF(DEFINED BUILD_UNITTEST AND BUILD_UNITTEST)
ADD_SUBDIRECTORY(unittest)
ENDIF()

INSTALL(TARGETS openvdb RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib)
INSTALL(FILES ${OPENVDB_HEADER_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/openvdb")
INSTALL(FILES ${OPENVDB_IO_HEADER_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/openvdb/io")
INSTALL(FILES ${OPENVDB_MATH_HEADER_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/openvdb/math")
INSTALL(FILES ${OPENVDB_METADATA_HEADER_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/openvdb/metadata")
INSTALL(FILES ${OPENVDB_TOOLS_HEADER_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/openvdb/tools")
INSTALL(FILES ${OPENVDB_TREE_HEADER_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/openvdb/tree")
INSTALL(FILES ${OPENVDB_UTIL_HEADER_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/openvdb/util")

0 comments on commit 3eef373

Please sign in to comment.