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