From 3eef373014df985c05079ab10d4d98b35632cc7c Mon Sep 17 00:00:00 2001 From: "U-POLYGON\\zhou" Date: Fri, 20 Dec 2013 17:16:14 +0900 Subject: [PATCH] Uploaded makefiles for openvdb library. --- openvdb_2_1_0_library/openvdb/CMakeLists.txt | 98 ++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100755 openvdb_2_1_0_library/openvdb/CMakeLists.txt diff --git a/openvdb_2_1_0_library/openvdb/CMakeLists.txt b/openvdb_2_1_0_library/openvdb/CMakeLists.txt new file mode 100755 index 0000000..5858801 --- /dev/null +++ b/openvdb_2_1_0_library/openvdb/CMakeLists.txt @@ -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")