### OpenNURBS Project Setup Source: https://github.com/mcneel/opennurbs/blob/8.x/README.md This snippet demonstrates how to set up a C++ project to use the openNURBS library. It includes defining the installation directory and optionally importing the library as a DLL. ```cpp #define OPENNURBS_PUBLIC_INSTALL_DIR "" // uncomment the next line if you want to use opennurbs as a DLL //#define OPENNURBS_IMPORTS #include "/opennurbs_public.h" ``` -------------------------------- ### Installation Targets Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Installs the opennurbsStatic library to the 'lib' directory and its public headers to 'include/opennurbsStatic'. ```cmake install( TARGETS opennurbsStatic DESTINATION "lib") install( FILES ${OPENNURBS_PUBLIC_HEADERS} DESTINATION "include/opennurbsStatic") ``` -------------------------------- ### OpenNURBS FileIO CMakeLists Source: https://github.com/mcneel/opennurbs/blob/8.x/example_test/README.md The CMakeLists.txt file used to build the OpenNURBS FileIO example test. It specifies build settings and dependencies. ```cmake cmake -S . -B build ``` -------------------------------- ### zlib Library Build Configuration Source: https://github.com/mcneel/opennurbs/blob/8.x/zlib/CMakeLists.txt Configures the build for the zlib static library. It specifies the minimum CMake version, project name, include directories, source files, headers, and compile definitions. It also sets up the installation paths for the library and include files. ```cmake cmake_minimum_required (VERSION 3.16) project( zlib C) set( INCLUDE_DIRS . ) set( PROJECT_HEADERS crc32.h deflate.h inffast.h inffixed.h inflate.h inftrees.h trees.h zconf.h zlib.h zutil.h ) set( SOURCES adler32.c compress.c crc32.c deflate.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c ) set(CMAKE_POSITION_INDEPENDENT_CODE ON) # -fPIC add_library( zlib STATIC ${SOURCES} ${PROJECT_HEADERS} ${RESOURCES} ) target_compile_definitions(zlib PRIVATE Z_PREFIX MY_ZCALLOC) target_include_directories( zlib PUBLIC . ) install( TARGETS zlib DESTINATION "lib") install( FILES DESTINATION "include/zlib") ``` -------------------------------- ### OpenNURBS Installation Logic Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt This snippet details the CMake logic for installing the OpenNURBS library. It conditionally installs the library and public headers to different destinations based on the SOVERSION, either as a Framework or within lib/include directories. ```cmake if (SOVERSION STREQUAL "8.0.0") install( TARGETS OpenNURBS DESTINATION "Frameworks") else() install( TARGETS OpenNURBS DESTINATION "lib" ) install( FILES ${OPENNURBS_PUBLIC_HEADERS} DESTINATION "include/OpenNURBS") endif() ``` -------------------------------- ### Basic CMake Configuration Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Sets the minimum required CMake version and defines the project name and language. This is a fundamental setup for building the OpenNURBS project with CMake. ```cmake cmake_minimum_required (VERSION 3.16) #set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)") project(opennurbs CXX) ``` -------------------------------- ### OpenNURBS FreeType CMake Configuration Source: https://github.com/mcneel/opennurbs/blob/8.x/freetype263/CMakeLists.txt This snippet outlines the CMake build process for the OpenNURBS library with FreeType integration. It defines the minimum CMake version, project name, includes directories, lists all source files, and creates a static library. It also sets specific compile definitions for FreeType and configures Xcode properties for macOS builds, including SDK, supported platforms, debug information format, and header search paths. Finally, it specifies installation targets and files. ```cmake cmake_minimum_required (VERSION 3.16) project( opennurbs_public_freetype C) include_directories("include") set( SOURCES src/autofit/autofit.c src/base/ftbase.c src/base/ftbbox.c src/base/ftbdf.c src/base/ftbitmap.c src/base/ftcid.c src/base/ftdebug.c src/base/ftfntfmt.c src/base/ftfstype.c src/base/ftgasp.c src/base/ftglyph.c src/base/ftgxval.c src/base/ftinit.c src/base/ftlcdfil.c src/base/ftmm.c src/base/ftotval.c src/base/ftpatent.c src/base/ftpfr.c src/base/ftstroke.c src/base/ftsynth.c src/base/ftsystem.c src/base/fttype1.c src/base/ftwinfnt.c src/bdf/bdf.c src/bzip2/ftbzip2.c src/cache/ftcache.c src/cff/cff.c src/cid/type1cid.c src/gzip/ftgzip.c src/lzw/ftlzw.c src/pcf/pcf.c src/pfr/pfr.c src/psaux/psaux.c src/pshinter/pshinter.c src/psnames/psnames.c src/raster/raster.c src/sfnt/sfnt.c src/smooth/smooth.c src/truetype/truetype.c src/type1/type1.c src/type42/type42.c src/winfonts/winfnt.c ) add_library( opennurbs_public_freetype STATIC ${SOURCES} ) set( OPENNURBS_FREETYPE_DEFINES FT2_BUILD_LIBRARY ) target_compile_definitions(opennurbs_public_freetype PRIVATE ${OPENNURBS_FREETYPE_DEFINES}) if( APPLE) set_target_properties( opennurbs_public_freetype PROPERTIES XCODE_ATTRIBUTE_SDKROOT "macosx" XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS "macosx iphonesimulator iphoneos" XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf" XCODE_ATTRIBUTE_HEADER_SEARCH_PATHS "$(PROJECT_DIR)/freetype263/include" ) endif() install( TARGETS opennurbs_public_freetype DESTINATION "lib") install( FILES ${PUBLIC_HEADERS} DESTINATION "include/opennurbs_public_freetype") ``` -------------------------------- ### CMake Build Configuration for android_uuid Source: https://github.com/mcneel/opennurbs/blob/8.x/android_uuid/CMakeLists.txt This snippet outlines the CMake script used to build the `android_uuid` static library. It specifies the minimum CMake version, project name, source files, include directories, and installation targets. The `CMAKE_POSITION_INDEPENDENT_CODE` is set to ON for position-independent code generation. ```cmake cmake_minimum_required (VERSION 3.4) project( android_uuid C) set( INCLUDE_DIRS . ) set( SOURCES copy.c gen_uuid.c isnull.c pack.c parse.c unpack.c unparse.c uuid_time.c ) set(CMAKE_POSITION_INDEPENDENT_CODE ON) # -fPIC add_library( android_uuid STATIC ${SOURCES} ) #target_compile_definitions(android_uuid PRIVATE Z_PREFIX MY_ZCALLOC) target_include_directories( android_uuid PUBLIC . ) install( TARGETS android_uuid DESTINATION "lib") install( FILES DESTINATION "include/android_uuid") ``` -------------------------------- ### Build and Run OpenNURBS FileIO Source: https://github.com/mcneel/opennurbs/blob/8.x/example_test/README.md Instructions for building and running the OpenNURBS FileIO test project. This includes CMake commands for configuration and building, and execution commands for different operating systems. ```bash cmake -S . -B build cmake --build build cd build && ./example_test -r ../../example_files ``` ```bash cd build/Debug && ./example_test -r ../../example_files ``` -------------------------------- ### CMake Build Configuration Source: https://github.com/mcneel/opennurbs/blob/8.x/example_test/CMakeLists.txt Configures the CMake build for the OpenNURBS project. It sets the minimum CMake version, project name, C++ standard to C++17, and specifies output directories for libraries and executables. It also includes the OpenNURBS subdirectory and links the OpenNURBS library to the example_test executable. ```cmake cmake_minimum_required(VERSION 3.16) project(ON_Test) # GoogleTest requires at least C++14 set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) add_subdirectory(../../opennurbs build_opennurbs) add_executable( example_test example_test.cpp ) target_link_libraries( example_test OpenNURBS ) ``` -------------------------------- ### OpenNURBS Static Library Creation Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Defines and builds the 'opennurbsStatic' library using a comprehensive list of public and plus headers and sources. ```cmake add_library( opennurbsStatic STATIC ${OPENNURBS_PUBLIC_HEADERS} ${OPENNURBS_PUBLIC_SOURCES} ${OPENNURBS_PUBLIC_MEMORY} ${OPENNURBS_PLUS_HEADERS} ${OPENNURBS_PLUS_SOURCES} ) ``` -------------------------------- ### OpenNURBS Plus Sources Configuration Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Lists the source files for the OpenNURBS Plus module, covering various functionalities like brep, mesh operations, and subd. ```cmake set( OPENNURBS_PLUS_SOURCES opennurbs_plus_bezier.cpp opennurbs_plus_brep.cpp opennurbs_plus_brep_changesrf.cpp opennurbs_plus_brep_facegroups.cpp opennurbs_plus_brep_kinky.cpp opennurbs_plus_ctree.cpp opennurbs_plus_fontsub.cpp opennurbs_plus_fpu.cpp opennurbs_plus_function.cpp opennurbs_plus_ginfinity.cpp opennurbs_plus_hiddenline.cpp opennurbs_plus_idimage.cpp opennurbs_plus_implicitfn.cpp opennurbs_plus_massprop.cpp opennurbs_plus_memory.cpp opennurbs_plus_memory_new.cpp opennurbs_plus_mesh_clash.cpp opennurbs_plus_mesh_intersection.cpp opennurbs_plus_mesh_marker.cpp opennurbs_plus_mesh_thickness.cpp opennurbs_plus_meshbooleans.cpp opennurbs_plus_mtree.cpp opennurbs_plus_particle.cpp opennurbs_plus_rectpack.cpp opennurbs_plus_rectpack1.cpp opennurbs_plus_rectpack2.cpp opennurbs_plus_registry.cpp opennurbs_plus_sections.cpp opennurbs_plus_sil.cpp opennurbs_plus_sleeplock.cpp opennurbs_plus_squish.cpp opennurbs_plus_stree.cpp opennurbs_plus_subd.cpp opennurbs_plus_subd_curve.cpp opennurbs_plus_subd_eval.cpp opennurbs_plus_subd_facegroups.cpp opennurbs_plus_subd_fillet.cpp opennurbs_plus_subd_limit.cpp opennurbs_plus_subd_loft.cpp opennurbs_plus_subd_matrix.cpp opennurbs_plus_subd_merge.cpp opennurbs_plus_subd_mesh.cpp opennurbs_plus_subd_symmetry.cpp opennurbs_plus_subd_topology.cpp opennurbs_plus_subd_weld.cpp opennurbs_plus_trimesh.cpp opennurbs_plus_validate.cpp opennurbs_plus_x.cpp opennurbs_plus_xmesh.cpp opennurbs_plus_xmeshfast.cpp opennurbs_plus_xray.cpp ) ``` -------------------------------- ### General Build Definitions Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Adds a general definition ON_CMAKE_BUILD, indicating that the project is being built using CMake. ```cmake add_definitions(-DON_CMAKE_BUILD) ``` -------------------------------- ### OpenNURBS Brep and Mesh Manipulation Files Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt This snippet lists C++ files focused on Boundary Representation (Brep) and Mesh data structures and their associated operations within the OpenNURBS library. This includes creation, modification, validation, and conversion utilities. ```cpp opennurbs_brep.cpp opennurbs_brep_extrude.cpp opennurbs_brep_io.cpp opennurbs_brep_isvalid.cpp opennurbs_brep_region.cpp opennurbs_brep_tools.cpp opennurbs_brep_v2valid.cpp opennurbs_mesh_modifiers.cpp opennurbs_mesh_ngon.cpp opennurbs_mesh_tools.cpp opennurbs_mesh_topology.cpp opennurbs_subd_archive.cpp opennurbs_subd_copy.cpp opennurbs_subd_data.cpp opennurbs_subd_eval.cpp opennurbs_subd_fragment.cpp opennurbs_subd_frommesh.cpp opennurbs_subd_heap.cpp opennurbs_subd_iter.cpp opennurbs_subd_limit.cpp opennurbs_subd_matrix.cpp opennurbs_subd_mesh.cpp opennurbs_subd_ref.cpp opennurbs_subd_ring.cpp opennurbs_subd_sector.cpp opennurbs_subd_texture.cpp ``` -------------------------------- ### OpenNURBS Utility and Helper Files Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt This snippet lists C++ files containing utility functions and helper classes for various tasks within the OpenNURBS library. This includes string manipulation, mathematical operations, memory management, and error handling. ```cpp opennurbs_calculator.cpp opennurbs_color.cpp opennurbs_compress.cpp opennurbs_compstat.cpp opennurbs_crc.cpp opennurbs_date.cpp opennurbs_defines.cpp opennurbs_error.cpp opennurbs_error_message.cpp opennurbs_evaluate_nurbs.cpp opennurbs_extensions.cpp opennurbs_file_utilities.cpp opennurbs_font.cpp opennurbs_freetype.cpp opennurbs_fsp.cpp opennurbs_function_list.cpp opennurbs_geometry.cpp opennurbs_glyph_outline.cpp opennurbs_group.cpp opennurbs_hash_table.cpp opennurbs_hatch.cpp opennurbs_instance.cpp opennurbs_intersect.cpp opennurbs_knot.cpp opennurbs_layer.cpp opennurbs_leader.cpp opennurbs_light.cpp opennurbs_linear_workflow.cpp opennurbs_linetype.cpp opennurbs_locale.cpp opennurbs_lock.cpp opennurbs_lookup.cpp opennurbs_material.cpp opennurbs_math.cpp opennurbs_md5.cpp opennurbs_memory_util.cpp opennurbs_model_component.cpp opennurbs_model_geometry.cpp opennurbs_morph.cpp opennurbs_object.cpp opennurbs_object_history.cpp opennurbs_objref.cpp opennurbs_optimize.cpp opennurbs_parse_angle.cpp opennurbs_parse_length.cpp opennurbs_parse_number.cpp opennurbs_parse_point.cpp opennurbs_parse_settings.cpp opennurbs_photogrammetry.cpp opennurbs_planesurface.cpp opennurbs_pluginlist.cpp opennurbs_pointcloud.cpp opennurbs_pointgeometry.cpp opennurbs_pointgrid.cpp opennurbs_post_effects.cpp opennurbs_progress_reporter.cpp opennurbs_rand.cpp opennurbs_render_channels.cpp opennurbs_render_content.cpp opennurbs_revsurface.cpp opennurbs_rtree.cpp opennurbs_safe_frame.cpp opennurbs_sectionstyle.cpp opennurbs_sha1.cpp opennurbs_skylight.cpp opennurbs_sleeplock.cpp opennurbs_sort.cpp opennurbs_statics.cpp opennurbs_std_string_format.cpp opennurbs_std_string_utf.cpp opennurbs_string.cpp opennurbs_string_compare.cpp opennurbs_string_format.cpp opennurbs_string_scan.cpp opennurbs_string_values.cpp opennurbs_sum.cpp opennurbs_sumsurface.cpp opennurbs_sun.cpp opennurbs_surfaceproxy.cpp opennurbs_symmetry.cpp opennurbs_terminator.cpp opennurbs_testclass.cpp opennurbs_text.cpp opennurbs_text_style.cpp opennurbs_textcontext.cpp opennurbs_textdraw.cpp opennurbs_textglyph.cpp opennurbs_textiterator.cpp opennurbs_textlog.cpp opennurbs_textobject.cpp opennurbs_textrun.cpp opennurbs_topology.cpp opennurbs_unicode.cpp opennurbs_unicode_cpsb.cpp opennurbs_units.cpp opennurbs_userdata.cpp opennurbs_uuid.cpp opennurbs_version.cpp opennurbs_version_number.cpp opennurbs_viewport.cpp opennurbs_win_dwrite.cpp opennurbs_workspace.cpp opennurbs_wstring.cpp opennurbs_xml.cpp ``` -------------------------------- ### macOS/iOS Dependencies and Definitions Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Finds and sets macOS Core Graphics, Core Text, and Foundation libraries. Defines platform-specific macros like ON_COMPILER_CLANG, ON_RUNTIME_APPLE, RHINO_APPLE, and _GNU_SOURCE for Apple targets. ```cmake if( APPLE) find_library( CORE_GRAPHICS_LIBRARY CoreGraphics) message( STATUS "CORE_GRAPHICS_LIBRARY is ${CORE_GRAPHICS_LIBRARY}") find_library( CORE_TEXT_LIBRARY CoreText) message( STATUS "CORE_TEXT_LIBRARY is ${CORE_TEXT_LIBRARY}") find_library( FOUNDATION_LIBRARY Foundation) message( STATUS "FOUNDATION_LIBRARY is ${FOUNDATION_LIBRARY}") set( OPENNURBS_APPLE_DEPENDENCIES ${CORE_GRAPHICS_LIBRARY} ${CORE_TEXT_LIBRARY} ${FOUNDATION_LIBRARY} ) set( OPENNURBS_APPLE_DEFINES ON_COMPILER_CLANG ON_RUNTIME_APPLE RHINO_APPLE=1 _GNU_SOURCE ) target_compile_definitions(opennurbsStatic PRIVATE ${OPENNURBS_APPLE_DEFINES}) target_compile_definitions(OpenNURBS PRIVATE ${OPENNURBS_APPLE_DEFINES}) # xcode properties are the same for both static and shared libs set_target_properties( opennurbsStatic OpenNURBS PROPERTIES XCODE_ATTRIBUTE_SDKROOT "macosx" XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS "macosx iphonesimulator iphoneos" XCODE_ATTRIBUTE_SYMROOT "build" XCODE_ATTRIBUTE_ALLOW_TARGET_PLATFORM_SPECIALIZATION "YES" XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf" XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET "11.3" XCODE_ATTRIBUTE_DYLIB_COMPATIBILITY_VERSION "1" XCODE_ATTRIBUTE_DYLIB_CURRENT_VERSION "1" XCODE_ATTRIBUTE_INFOPLIST_FILE "opennurbsRhinoInfo.plist" XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.mcneel.opennurbs" XCODE_ATTRIBUTE_HEADER_SEARCH_PATHS "$(PROJECT_DIR)/freetype263/include" XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION "1" XCODE_ATTRIBUTE_MARKETING_VERSION "8 Internal" XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN "YES" XCODE_ATTRIBUTE_GCC_NO_COMMON_BLOCKS "YES" XCODE_ATTRIBUTE_GCC_INPUT_FILETYPE "sourcecode.cpp.objcpp" XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES" XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "$(PROJECT_DIR)/opennurbsRhino.pch" XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "YES" XCODE_ATTRIBUTE_ENABLE_STRICT_OBJC_MSGSEND "YES" ) endif() ``` -------------------------------- ### OpenNURBS Annotation and Display Files Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt This snippet lists C++ files related to annotation elements and display-related functionalities within the OpenNURBS library. This includes dimensioning, text styles, and internal representations for different file versions. ```cpp opennurbs_decals.cpp opennurbs_detail.cpp opennurbs_dimension.cpp opennurbs_dimensionformat.cpp opennurbs_dimensionstyle.cpp opennurbs_embedded_file.cpp opennurbs_ground_plane.cpp opennurbs_internal_V2_annotation.cpp opennurbs_internal_V5_annotation.cpp opennurbs_internal_V5_dimstyle.cpp opennurbs_internal_Vx_annotation.cpp opennurbs_leader.cpp opennurbs_linecurve.cpp opennurbs_linetype.cpp opennurbs_offsetsurface.cpp opennurbs_post_effects.cpp opennurbs_safe_frame.cpp opennurbs_sectionstyle.cpp opennurbs_text.cpp opennurbs_text_style.cpp opennurbs_textcontext.cpp opennurbs_textdraw.cpp opennurbs_textglyph.cpp opennurbs_textiterator.cpp opennurbs_textlog.cpp opennurbs_textobject.cpp opennurbs_textrun.cpp ``` -------------------------------- ### Target Compile Definitions Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Sets specific compile definitions for the opennurbsStatic and OpenNURBS targets, including ON_COMPILING_OPENNURBS, Z_PREFIX, and MY_ZCALLOC for static builds, and OPENNURBS_EXPORTS for shared builds. ```cmake target_compile_definitions(opennurbsStatic PRIVATE ON_COMPILING_OPENNURBS Z_PREFIX MY_ZCALLOC) target_compile_definitions(OpenNURBS PRIVATE OPENNURBS_EXPORTS Z_PREFIX MY_ZCALLOC) ``` -------------------------------- ### Target Include Directories Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Sets the current directory as a public include directory for both opennurbsStatic and OpenNURBS targets. ```cmake target_include_directories(opennurbsStatic PUBLIC .) target_include_directories(OpenNURBS PUBLIC .) ``` -------------------------------- ### OpenNURBS Plus Headers Configuration Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Defines the header files for the OpenNURBS Plus module. Includes conditional addition of a test header if testing is enabled. ```cmake if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_plus.h) set( OPENNURBS_PLUS_HEADERS opennurbsRhino.pch opennurbs_plus.h opennurbs_plus_crashtest.h opennurbs_plus_function.h opennurbs_plus_hiddenline.h opennurbs_plus_hiddenline_impl.h opennurbs_plus_idimage.h opennurbs_plus_implicitfn.h opennurbs_plus_massprop.h opennurbs_plus_mesh_intersection.h opennurbs_plus_mesh_marker.h opennurbs_plus_meshbooleans_impl.h opennurbs_plus_particle.h opennurbs_plus_rectpack.h opennurbs_plus_rectpack2.h opennurbs_plus_registry.h opennurbs_plus_sections.h opennurbs_plus_sil.h opennurbs_plus_sleeplock.h opennurbs_plus_squish.h opennurbs_plus_subd.h opennurbs_plus_trimesh.h opennurbs_plus_validate.h opennurbs_plus_x.h ) if (BUILD_TESTING) LIST(APPEND OPENNURBS_PLUS_HEADERS opennurbs_plus_testheader.h) endif(BUILD_TESTING) endif() ``` -------------------------------- ### macOS Framework Properties Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Sets properties for the OpenNURBS target when building as a macOS framework, enabling framework creation and setting its version. ```cmake if (APPLE) set_target_properties( OpenNURBS PROPERTIES FRAMEWORK TRUE FRAMEWORK_VERSION A # MACOSX_FRAMEWORK_IDENTIFIER "com.mcneel.OpenNURBS" # VERSION "8.0.0" ) ``` -------------------------------- ### Android Include Directories Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Includes the freetype263/include directory when building for Android. ```cmake if (ANDROID) include_directories("freetype263/include") endif() ``` -------------------------------- ### Platform-Specific Library Linking Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Links necessary libraries for OpenNURBS based on the target platform (Android, Linux, macOS, Windows), including zlib, freetype, and platform-specific libraries like CoreGraphics, CoreText, Foundation, Shlwapi, and Usp10. ```cmake if (ANDROID) target_link_libraries( OpenNURBS zlib opennurbs_public_freetype android_uuid android) target_link_libraries( opennurbsStatic zlib opennurbs_public_freetype android_uuid android) endif() if (LINUX AND NOT ANDROID) target_link_libraries( OpenNURBS zlib opennurbs_public_freetype android_uuid) target_link_libraries( opennurbsStatic zlib opennurbs_public_freetype android_uuid) endif() if (APPLE) target_link_libraries( OpenNURBS ${OPENNURBS_APPLE_DEPENDENCIES} zlib) target_link_libraries( opennurbsStatic ${OPENNURBS_APPLE_DEPENDENCIES} zlib) endif() if (WIN32) target_link_libraries( OpenNURBS Shlwapi Usp10 zlib) target_link_libraries( opennurbsStatic Shlwapi Usp10 zlib) endif() ``` -------------------------------- ### Precompiled Headers Configuration Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Configures precompiled headers for the OpenNURBS library, including 'opennurbs.h' and 'opennurbs_plus_testheader.h' if testing is enabled. ```cmake set(PRECOMPILED_HEADERS opennurbs.h) if (BUILD_TESTING) LIST(APPEND PRECOMPILED_HEADERS opennurbs_plus_testheader.h) endif(BUILD_TESTING) target_precompile_headers(opennurbsStatic PRIVATE ${PRECOMPILED_HEADERS}) target_precompile_headers(OpenNURBS PRIVATE ${PRECOMPILED_HEADERS}) ``` -------------------------------- ### Platform-Specific Subdirectories Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Adds subdirectories for platform-specific code, such as 'android_uuid' and 'freetype263' for Android and Linux builds. ```cmake if (ANDROID OR LINUX) add_subdirectory(android_uuid) add_subdirectory(freetype263) endif() ``` -------------------------------- ### OpenNURBS Library Definition Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Defines the shared OpenNURBS library, listing its public headers, sources, memory management files, and the main DLL source file. ```cmake add_library( OpenNURBS SHARED ${OPENNURBS_PUBLIC_HEADERS} ${OPENNURBS_PUBLIC_SOURCES} ${OPENNURBS_PUBLIC_MEMORY} ${OPENNURBS_PLUS_HEADERS} ${OPENNURBS_PLUS_SOURCES} opennurbs_dll.cpp ) ``` -------------------------------- ### OpenNURBS Public Sources Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Defines a CMake variable listing the public source files for the OpenNURBS library. These are the implementation files that will be compiled. ```cmake set( OPENNURBS_PUBLIC_SOURCES opennurbs_3dm_attributes.cpp opennurbs_3dm_properties.cpp opennurbs_3dm_settings.cpp opennurbs_annotationbase.cpp opennurbs_apple_nsfont.cpp opennurbs_arc.cpp opennurbs_arccurve.cpp opennurbs_archivable_dictionary.cpp opennurbs_archive.cpp opennurbs_archive_manifest.cpp opennurbs_array.cpp opennurbs_base32.cpp opennurbs_base64.cpp opennurbs_beam.cpp ) ``` -------------------------------- ### Zlib Dependency Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Includes the zlib library as a dependency for the project. ```cmake add_subdirectory(zlib) ``` -------------------------------- ### C++ Standard and Platform Configuration Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Sets the C++ standard to C++17 and marks it as required. It also includes logic to detect if the operating system is Linux (and not macOS). ```cmake set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) if (UNIX AND NOT APPLE) set(LINUX TRUE) endif() ``` -------------------------------- ### Windows-Specific Compiler Flags Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Sets the /bigobj flag for Visual C++ compiler when building opennurbs_brep.cpp to handle large object files. Also defines UNICODE and _UNICODE for Windows compatibility. ```cmake if (MSVC) # opennurbs_brep.cpp requires this flag when compiling with Visual C++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") #add_compile_options(\ bigobj) add_definitions(-DUNICODE) add_definitions(-D_UNICODE) endif() ``` -------------------------------- ### OpenNURBS Core Geometry Files Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt This snippet lists core C++ files related to fundamental geometric entities in the OpenNURBS library. These include basic shapes like lines, circles, spheres, and more complex NURBS representations. ```cpp opennurbs_line.cpp opennurbs_linecurve.cpp opennurbs_circle.cpp opennurbs_ellipse.cpp opennurbs_arc.cpp opennurbs_sphere.cpp opennurbs_cone.cpp opennurbs_cylinder.cpp opennurbs_torus.cpp opennurbs_plane.cpp opennurbs_xform.cpp opennurbs_matrix.cpp opennurbs_quaternion.cpp opennurbs_nurbscurve.cpp opennurbs_nurbssurface.cpp opennurbs_nurbsvolume.cpp opennurbs_bezier.cpp opennurbs_beziervolume.cpp opennurbs_surface.cpp opennurbs_curve.cpp opennurbs_point.cpp opennurbs_ipoint.cpp opennurbs_polyline.cpp opennurbs_polylinecurve.cpp opennurbs_polycurve.cpp opennurbs_polyedgecurve.cpp opennurbs_mesh.cpp opennurbs_subd.cpp ``` -------------------------------- ### OpenNURBS Public Headers Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Defines a CMake variable listing all the public header files for the OpenNURBS library. This list is used for building and distributing the library. ```cmake set( OPENNURBS_PUBLIC_HEADERS opennurbs.h opennurbs_3dm.h opennurbs_3dm_attributes.h opennurbs_3dm_properties.h opennurbs_3dm_settings.h opennurbs_annotationbase.h opennurbs_apple_nsfont.h opennurbs_arc.h opennurbs_arccurve.h opennurbs_archivable_dictionary.h opennurbs_archive.h opennurbs_array.h opennurbs_array_defs.h opennurbs_base32.h opennurbs_base64.h opennurbs_beam.h opennurbs_bezier.h opennurbs_bitmap.h opennurbs_bounding_box.h opennurbs_box.h opennurbs_brep.h opennurbs_circle.h opennurbs_color.h opennurbs_compress.h opennurbs_compstat.h opennurbs_cone.h opennurbs_convex_poly.h opennurbs_crc.h opennurbs_curve.h opennurbs_curveonsurface.h opennurbs_curveproxy.h opennurbs_cylinder.h opennurbs_date.h opennurbs_decals.h opennurbs_defines.h opennurbs_detail.h opennurbs_dimension.h opennurbs_dimensionformat.h opennurbs_dimensionstyle.h opennurbs_dithering.h opennurbs_ellipse.h opennurbs_embedded_file.h opennurbs_error.h opennurbs_evaluate_nurbs.h opennurbs_extensions.h opennurbs_file_utilities.h opennurbs_font.h opennurbs_fpoint.h opennurbs_freetype.h opennurbs_freetype_include.h opennurbs_fsp.h opennurbs_fsp_defs.h opennurbs_function_list.h opennurbs_geometry.h opennurbs_gl.h opennurbs_ground_plane.h opennurbs_group.h opennurbs_hash_table.h opennurbs_hatch.h opennurbs_hsort_template.h opennurbs_instance.h opennurbs_internal_V2_annotation.h opennurbs_internal_V5_annotation.h opennurbs_internal_V5_dimstyle.h opennurbs_internal_defines.h opennurbs_internal_glyph.h opennurbs_intersect.h opennurbs_ipoint.h opennurbs_knot.h opennurbs_layer.h opennurbs_leader.h opennurbs_light.h opennurbs_line.h opennurbs_linear_workflow.h opennurbs_linecurve.h opennurbs_linestyle.h opennurbs_linetype.h opennurbs_locale.h opennurbs_lock.h opennurbs_lookup.h opennurbs_mapchan.h opennurbs_material.h opennurbs_math.h opennurbs_matrix.h opennurbs_md5.h opennurbs_memory.h opennurbs_mesh.h opennurbs_mesh_modifiers.h opennurbs_model_component.h opennurbs_model_geometry.h opennurbs_nurbscurve.h opennurbs_nurbssurface.h opennurbs_object.h opennurbs_object_history.h opennurbs_objref.h opennurbs_offsetsurface.h opennurbs_optimize.h opennurbs_parse.h opennurbs_photogrammetry.h opennurbs_plane.h opennurbs_planesurface.h opennurbs_pluginlist.h opennurbs_point.h opennurbs_pointcloud.h opennurbs_pointgeometry.h opennurbs_pointgrid.h opennurbs_polycurve.h opennurbs_polyedgecurve.h opennurbs_polyline.h opennurbs_polylinecurve.h opennurbs_post_effects.h opennurbs_private_wrap.h opennurbs_private_wrap_defs.h opennurbs_progress_reporter.h opennurbs_qsort_template.h opennurbs_quacksort_template.h opennurbs_quaternion.h opennurbs_rand.h opennurbs_render_channels.h opennurbs_render_content.h opennurbs_rendering.h opennurbs_revsurface.h opennurbs_rtree.h opennurbs_safe_frame.h opennurbs_sectionstyle.h opennurbs_sha1.h opennurbs_skylight.h opennurbs_sleeplock.h opennurbs_sphere.h opennurbs_std_string.h opennurbs_string.h opennurbs_string_value.h opennurbs_subd.h opennurbs_subd_data.h opennurbs_sumsurface.h opennurbs_sun.h opennurbs_surface.h opennurbs_surfaceproxy.h opennurbs_symmetry.h opennurbs_system.h opennurbs_system_compiler.h opennurbs_system_runtime.h #opennurbs_table.h opennurbs_terminator.h opennurbs_testclass.h opennurbs_text.h opennurbs_text_style.h opennurbs_textcontext.h opennurbs_textdraw.h opennurbs_textglyph.h opennurbs_textiterator.h opennurbs_textlog.h opennurbs_textobject.h opennurbs_textrun.h opennurbs_texture.h opennurbs_texture_mapping.h opennurbs_topology.h opennurbs_torus.h opennurbs_unicode.h opennurbs_userdata.h opennurbs_uuid.h opennurbs_version.h opennurbs_version_number.h opennurbs_viewport.h opennurbs_wip.h opennurbs_workspace.h opennurbs_xform.h opennurbs_xml.h opennurbs_zlib.h ) ``` -------------------------------- ### UUID Support Files for Android Source: https://github.com/mcneel/opennurbs/blob/8.x/android_uuid/README.md These C source files provide the necessary functionality for handling Universally Unique Identifiers (UUIDs) within the OpenNURBS library when building for Android. They are essential for unique identification and data management in the Android environment. ```c #include // Example usage of uuid_generate void generate_and_print_uuid() { uuid_t uuid; uuid_generate_random(uuid); char uuid_str[37]; uuid_unparse_lower(uuid, uuid_str); // Print the generated UUID (e.g., to logcat or a file) // printf("%s\n", uuid_str); } ``` -------------------------------- ### Non-MSVC Compiler Warnings Source: https://github.com/mcneel/opennurbs/blob/8.x/CMakeLists.txt Disables specific compiler warnings for non-MSVC compilers to avoid build errors or warnings that are not critical for the project. ```cmake if (MSVC) # warning level 4 and all warnings as errors add_compile_options(/W4) else() # These need to be addressed add_compile_options(-Wno-inconsistent-missing-override) add_compile_options(-Wno-defaulted-function-deleted) add_compile_options(-Wno-switch) add_compile_options(-Wno-tautological-pointer-compare) add_compile_options(-Wno-deprecated-declarations) add_compile_options(-Wno-unsequenced) add_compile_options(-Wno-parentheses) add_compile_options(-Wno-writable-strings) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch") endif() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.