diff --git a/CMakeLists.txt b/CMakeLists.txt index ed46a5e13..8e1e37eed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ option(BUILD_DAGMC_EXPORTER "Include DagMC export capability" ON) option(BUILD_MCNP_IMPORTER "Include MCNP import capability" ON) option(BUILD_IGEOM "Build iGeom library" ON) option(BUILD_IGEOM_TESTS "Include tests for iGeom" ON) +option(CUBIT_17 "Using a version of Trelis or Cubit >= 17.0" OFF) # MCNP importer and iGeom tests require iGeom if (BUILD_MCNP_IMPORTER OR BUILD_IGEOM_TESTS) @@ -76,6 +77,9 @@ if (BUILD_IGEOM) set(IGEOM_SRC_FILES iGeom/iGeom.cpp iGeom/iGeomError.cc) include_directories(iGeom) add_library(iGeom SHARED ${IGEOM_SRC_FILES}) + if(CUBIT_17) + target_compile_definitions(iGeom PUBLIC -DCUBIT_17_PLUS) + endif() target_link_libraries(iGeom ${CUBIT_LIBS}) install(TARGETS iGeom LIBRARY DESTINATION lib) list(APPEND PLUGIN_LINK_LIBS iGeom) diff --git a/iGeom/iGeom.cpp b/iGeom/iGeom.cpp index 81e4fc66e..40138679e 100644 --- a/iGeom/iGeom.cpp +++ b/iGeom/iGeom.cpp @@ -1454,8 +1454,15 @@ CGMTagManager::CGMTagManager() // get the tag number for CATag DLIList tag_types; int max_type = 0; - CubitAttribManager *cam = CGMApp::instance()->attrib_manager(); + +#ifdef CUBIT_17_PLUS + CubitAttribManager cam = CGMApp::instance()->attrib_manager(); + cam.get_registered_types(tag_types); +#else + CubitAttribManager* cam = CGMApp::instance()->attrib_manager(); cam->get_registered_types(tag_types); +#endif + for (int i = 0; i < tag_types.size(); i++) { int this_type = tag_types.get_and_step(); max_type = (max_type < this_type ? this_type : max_type);