@@ -134,8 +134,8 @@ Disable CMakes default system search paths when locating dependencies. When enab
134134its default system search routine if it cannot find a dependency with the provided settings. When disabled, only
135135paths provided through the Xxx_ROOT, supported XXX_INCLUDEDIR/XXX_LIBRARYDIR variables or the SYSTEM_LIBRARY_PATHS
136136list will be searched.]=] OFF )
137- option (OPENVDB_USE_DEPRECATED_ABI_6 "Bypass minimum ABI requirement checks" OFF )
138137option (OPENVDB_USE_DEPRECATED_ABI_7 "Bypass minimum ABI requirement checks" OFF )
138+ option (OPENVDB_USE_DEPRECATED_ABI_8 "Bypass minimum ABI requirement checks" OFF )
139139option (OPENVDB_USE_FUTURE_ABI_10 "Bypass future ABI check" OFF )
140140option (OPENVDB_FUTURE_DEPRECATION "Generate messages for upcoming deprecation" ON )
141141option (OPENVDB_ENABLE_UNINSTALL "Adds a CMake uninstall target." ON )
@@ -208,8 +208,28 @@ if(USE_AX)
208208 endif ()
209209endif ()
210210
211+ if (OPENVDB_BUILD_HOUDINI_PLUGIN OR OPENVDB_BUILD_HOUDINI_ABITESTS)
212+ set (USE_HOUDINI ON )
213+ endif ()
214+
215+ if (OPENVDB_BUILD_MAYA_PLUGIN)
216+ set (USE_MAYA ON )
217+ endif ()
218+
219+ if (USE_MAYA AND USE_HOUDINI)
220+ # @todo technically this is possible so long as library versions match
221+ # exactly but it's difficult to validate and dangerous
222+ message (FATAL_ERROR "Cannot build both Houdini and Maya plugins against "
223+ "the same core dependencies. Plugins must be compiled separately to "
224+ "ensure the required DCC dependencies are met." )
225+ endif ()
226+
211227###### Deprecated options
212228
229+ if (OPENVDB_CODE_COVERAGE)
230+ message (FATAL_ERROR "The OPENVDB_CODE_COVERAGE option has been removed. Choose instead the unique"
231+ "build type -DCMAKE_BUILD_TYPE=coverage" )
232+ endif ()
213233if (OPENVDB_BUILD_HOUDINI_SOPS)
214234 message (FATAL_ERROR "The OPENVDB_BUILD_HOUDINI_SOPS option has been removed. Use OPENVDB_BUILD_HOUDINI_PLUGIN." )
215235endif ()
@@ -220,142 +240,33 @@ endif()
220240# Various root level CMake options which are marked as advanced
221241
222242mark_as_advanced (
243+ CONCURRENT_MALLOC
244+ DISABLE_CMAKE_SEARCH_PATHS
245+ DISABLE_DEPENDENCY_VERSION_CHECKS
246+ OPENVDB_BUILD_HOUDINI_ABITESTS
223247 OPENVDB_CXX_STRICT
224248 OPENVDB_ENABLE_RPATH
225- USE_HOUDINI
226- USE_MAYA
227- USE_LOG4CPLUS
228- USE_IMATH_HALF
229- USE_CCACHE
230- OPENVDB_BUILD_HOUDINI_ABITESTS
231- DISABLE_DEPENDENCY_VERSION_CHECKS
232- DISABLE_CMAKE_SEARCH_PATHS
233- OPENVDB_USE_DEPRECATED_ABI_6
249+ OPENVDB_FUTURE_DEPRECATION
250+ OPENVDB_SIMD
234251 OPENVDB_USE_DEPRECATED_ABI_7
252+ OPENVDB_USE_DEPRECATED_ABI_8
235253 OPENVDB_USE_FUTURE_ABI_10
236- OPENVDB_FUTURE_DEPRECATION
237- CONCURRENT_MALLOC
238- USE_COLORED_OUTPUT
239254 SYSTEM_LIBRARY_PATHS
240- OPENVDB_SIMD
255+ USE_CCACHE
256+ USE_COLORED_OUTPUT
257+ USE_HOUDINI
258+ USE_IMATH_HALF
259+ USE_LOG4CPLUS
260+ USE_MAYA
241261)
242262
243- # Configure minimum version requirements - some are treated specially and fall
244- # outside of the DISABLE_DEPENDENCY_VERSION_CHECKS catch
245- set (MINIMUM_CXX_STANDARD 14)
246-
247- # @note ABI always enforced so the correct deprecation messages are available.
248- # OPENVDB_USE_DEPRECATED_ABI_<VERSION> should be used to circumvent this
249- set (MINIMUM_OPENVDB_ABI_VERSION 6)
250- set (FUTURE_MINIMUM_OPENVDB_ABI_VERSION 8)
251- set (FUTURE_OPENVDB_ABI_VERSION 10)
252-
253- if (NOT DISABLE_DEPENDENCY_VERSION_CHECKS)
254- # @note Currently tracking CY2020 of the VFX platform where available
255- set (MINIMUM_GCC_VERSION 6.3.1)
256- set (MINIMUM_CLANG_VERSION 3.8)
257- set (MINIMUM_ICC_VERSION 17)
258- set (MINIMUM_MSVC_VERSION 19.10)
259-
260- set (MINIMUM_BOOST_VERSION 1.70)
261- set (MINIMUM_ILMBASE_VERSION 2.4)
262- set (MINIMUM_OPENEXR_VERSION 2.4)
263- set (MINIMUM_ZLIB_VERSION 1.2.7)
264- set (MINIMUM_TBB_VERSION 2019.0)
265- set (MINIMUM_LLVM_VERSION 7.0.0)
266- set (MINIMUM_BLOSC_VERSION 1.5.0)
267-
268- set (MINIMUM_PYTHON_VERSION 2.7) # @warning should be 3.7.x, but H18.5+ can still be used with 2.7.x
269- set (MINIMUM_NUMPY_VERSION 1.14.0)
270-
271- set (MINIMUM_GOOGLETEST_VERSION 1.10)
272- set (MINIMUM_GLFW_VERSION 3.1)
273- set (MINIMUM_LOG4CPLUS_VERSION 1.1.2)
274- set (MINIMUM_HOUDINI_VERSION 18.5)
275-
276- # These always promote warnings rather than errors
277- set (MINIMUM_MAYA_VERSION 2017)
278- set (MINIMUM_DOXYGEN_VERSION 1.8.8)
279- endif ()
280-
281- # VFX 21 deprecations to transition to MINIMUM_* variables in OpenVDB 10.0.0
282-
283- # No compiler upgrades planned
284- set (FUTURE_MINIMUM_GCC_VERSION 9.3.1)
285- set (FUTURE_MINIMUM_ICC_VERSION 19)
286- # set(FUTURE_MINIMUM_MSVC_VERSION 19.10)
287-
288- # set(FUTURE_MINIMUM_CMAKE_VERSION 3.18)
289- # set(FUTURE_MINIMUM_ILMBASE_VERSION 2.4)
290- # set(FUTURE_MINIMUM_OPENEXR_VERSION 2.4)
291- set (FUTURE_MINIMUM_BOOST_VERSION 1.73)
292- set (FUTURE_MINIMUM_BLOSC_VERSION 1.17.0)
293- set (FUTURE_MINIMUM_TBB_VERSION 2020.2)
294- set (FUTURE_MINIMUM_PYTHON_VERSION 3.7)
295- set (FUTURE_MINIMUM_NUMPY_VERSION 1.17.0)
296- # set(FUTURE_MINIMUM_HOUDINI_VERSION 18.5)
297- set (FUTURE_MINIMUM_LLVM_VERSION 10.0.0)
298-
299263#########################################################################
300264
301- # General CMake and CXX settings
265+ # Configure MINIMUM and FUTURE_MINIMUM version variables
302266
303- if (FUTURE_MINIMUM_CMAKE_VERSION)
304- if (${CMAKE_VERSION} VERSION_LESS ${FUTURE_MINIMUM_CMAKE_VERSION} )
305- message (DEPRECATION "Support for CMake versions < ${FUTURE_MINIMUM_CMAKE_VERSION} "
306- "is deprecated and will be removed." )
307- endif ()
308- endif ()
309-
310- if (NOT CMAKE_CXX_STANDARD)
311- set (CMAKE_CXX_STANDARD ${MINIMUM_CXX_STANDARD} CACHE STRING
312- "The C++ standard whose features are requested to build OpenVDB components." FORCE)
313- elseif (CMAKE_CXX_STANDARD LESS ${MINIMUM_CXX_STANDARD} )
314- message (FATAL_ERROR "Provided C++ Standard is less than the supported minimum."
315- "Required is at least \" ${MINIMUM_CXX_STANDARD} \" (found ${CMAKE_CXX_STANDARD} )" )
316- endif ()
317-
318- # Configure MS Runtime
319-
320- if (WIN32 AND CMAKE_MSVC_RUNTIME_LIBRARY)
321- message (STATUS "CMAKE_MSVC_RUNTIME_LIBRARY set to target ${CMAKE_MSVC_RUNTIME_LIBRARY} " )
322-
323- # Configure Boost library varient on Windows
324- if (NOT Boost_USE_STATIC_RUNTIME)
325- set (Boost_USE_STATIC_RUNTIME OFF )
326- if (CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL MultiThreaded OR
327- CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL MultiThreadedDebug)
328- set (Boost_USE_STATIC_RUNTIME ON )
329- endif ()
330- endif ()
331- if (NOT Boost_USE_DEBUG_RUNTIME)
332- set (Boost_USE_DEBUG_RUNTIME OFF )
333- if (CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL MultiThreadedDebugDLL OR
334- CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL MultiThreadedDebug)
335- set (Boost_USE_DEBUG_RUNTIME ON )
336- endif ()
337- endif ()
338- endif ()
267+ include (cmake/config/OpenVDBVersions.cmake)
339268
340- set (CMAKE_CXX_STANDARD_REQUIRED ON )
341- set (CMAKE_CXX_EXTENSIONS OFF )
342-
343- set (CMAKE_DISABLE_SOURCE_CHANGES ON )
344- set (CMAKE_DISABLE_IN_SOURCE_BUILD ON )
345-
346- if (OPENVDB_ENABLE_RPATH)
347- # Configure rpath for installation base on the following:
348- # https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
349- set (CMAKE_SKIP_BUILD_RPATH FALSE )
350- set (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE )
351- set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE )
352- # @todo make relocatable?
353- set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX} /${CMAKE_INSTALL_LIBDIR} " )
354- endif ()
355-
356- # For CMake's find Threads module which brings in pthread - This flag
357- # forces the compiler -pthread flag vs -lpthread
358- set (THREADS_PREFER_PTHREAD_FLAG TRUE )
269+ #########################################################################
359270
360271enable_testing ()
361272
@@ -383,26 +294,6 @@ if(OPENVDB_INSTALL_CMAKE_MODULES)
383294 install (FILES ${OPENVDB_CMAKE_MODULES} DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/OpenVDB)
384295endif ()
385296
386- # Configure DCC installation if necessary
387-
388- if (OPENVDB_BUILD_HOUDINI_PLUGIN OR
389- OPENVDB_BUILD_HOUDINI_ABITESTS)
390- set (USE_HOUDINI ON )
391- endif ()
392-
393- if (OPENVDB_BUILD_MAYA_PLUGIN)
394- set (USE_MAYA ON )
395- endif ()
396-
397- if (USE_MAYA AND USE_HOUDINI)
398- # @todo technically this is possible so long as library versions match
399- # exactly but it's difficult to validate and dangerous
400- message (FATAL_ERROR "Cannot build both Houdini and Maya plugins against "
401- "the same core dependencies. Plugins must be compiled separately to "
402- "ensure the required DCC dependencies are met."
403- )
404- endif ()
405-
406297# Configure component dependencies by loading the Houdini/Maya setup
407298# scripts. These also find the Houdini/Maya installations
408299
@@ -455,31 +346,11 @@ if(USE_CCACHE)
455346 endif ()
456347endif ()
457348
458- # Build type configuration
459-
460- if (OPENVDB_CODE_COVERAGE)
461- message (DEPRECATION "The OPENVDB_CODE_COVERAGE option is deprecated. Choose instead the unique"
462- "build type -DCMAKE_BUILD_TYPE=coverage" )
463- set (CMAKE_BUILD_TYPE coverage)
464- endif ()
465- if (NOT CMAKE_BUILD_TYPE )
466- set (CMAKE_BUILD_TYPE Release)
467- endif ()
468-
469- include (cmake/config/OpenVDBBuildTypes.cmake)
349+ #########################################################################
470350
471- if (CMAKE_BUILD_TYPE EQUAL coverage)
472- # use .gcno extension instead of .cc.gcno
473- # @note This is an undocumented internal cmake var and does not work
474- # with multi config generators
475- set (CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
476- endif ()
351+ # Configure general CMake and CXX settings
477352
478- # CMAKE_BUILD_TYPE is ignored for multi config generators i.e. MSVS
479- get_property (_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
480- if (NOT _isMultiConfig)
481- message (STATUS "CMake Build Type: ${CMAKE_BUILD_TYPE} " )
482- endif ()
353+ include (cmake/config/OpenVDBCXX.cmake)
483354
484355#########################################################################
485356
0 commit comments