### Install PyAssimp Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/port/PyAssimp/README.md Install the PyAssimp library by running the setup script. Ensure you have the Assimp dynamic library available in the default search directories or configure additional directories. ```console python setup.py install ``` -------------------------------- ### Install Example Targets Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/openal-soft/CMakeLists.txt Installs targets listed in EXTRA_INSTALLS to their respective runtime/library directories if EXTRA_INSTALLS is not empty. ```cmake if(EXTRA_INSTALLS) install(TARGETS ${EXTRA_INSTALLS} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() ``` -------------------------------- ### CMake Cross-Compilation Setup Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/openal-soft/XCompile.txt Example CMake command to initiate cross-compilation using a toolchain file. Ensure CMake 2.6 or newer is installed. ```bash cmake .. -DCMAKE_TOOLCHAIN_FILE=../XCompile.txt -DHOST=i686-w64-mingw32 ``` -------------------------------- ### Configure HIDAPI Build Options Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/src/hidapi/README.txt Example of configuring HIDAPI build with specific options. '--enable-testgui' builds the test GUI, and '--prefix' specifies installation directory. ```bash ./configure --enable-testgui --prefix=/usr ``` -------------------------------- ### C++ Per-Test-Suite Setup and Teardown Example Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/contrib/googletest/docs/advanced.md Demonstrates how to declare and define static members for shared resources, along with `SetUpTestSuite()` and `TearDownTestSuite()` methods for managing their lifecycle. This pattern is useful for expensive resources that don't change between tests. ```c++ class FooTest : public testing::Test { protected: // Per-test-suite set-up. // Called before the first test in this test suite. // Can be omitted if not needed. static void SetUpTestSuite() { shared_resource_ = new ...; // If `shared_resource_` is **not deleted** in `TearDownTestSuite()`, // reallocation should be prevented because `SetUpTestSuite()` may be called // in subclasses of FooTest and lead to memory leak. // // if (shared_resource_ == nullptr) { // shared_resource_ = new ...; // } } // Per-test-suite tear-down. // Called after the last test in this test suite. // Can be omitted if not needed. static void TearDownTestSuite() { delete shared_resource_; shared_resource_ = nullptr; } // You can define per-test set-up logic as usual. void SetUp() override { ... } // You can define per-test tear-down logic as usual. void TearDown() override { ... } // Some expensive resource shared by all tests. static T* shared_resource_; }; T* FooTest::shared_resource_ = nullptr; TEST_F(FooTest, Test1) { ... you can refer to shared_resource_ here ... } TEST_F(FooTest, Test2) { ... you can refer to shared_resource_ here ... } ``` -------------------------------- ### Draco Installation and Testing Setup Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/contrib/draco/CMakeLists.txt Sets up the installation target and test targets for the Draco library using custom CMake macros. ```cmake draco_setup_install_target() draco_setup_test_targets() endif() ``` -------------------------------- ### Create Dialog with Bitmap Image Example Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/bin/tools/nsis/app/Docs/nsDialogs/Readme.html This example demonstrates how to create a dialog, add a bitmap control, set an image onto it using NSD_SetImage, and then free the image handle. It includes necessary initialization and plugin directory setup. ```nsis > !include nsDialogs.nsh > > Name nsDialogs > OutFile nsDialogs.exe > > XPStyle on > > Page custom nsDialogsImage > Page instfiles > > Var Dialog > Var Image > Var ImageHandle > > Function .onInit > > InitPluginsDir > File /oname=$PLUGINSDIR\image.bmp "${NSISDIR}\Contrib\Graphics\Header\nsis-r.bmp" > > FunctionEnd > > Function nsDialogsImage > > nsDialogs::Create 1018 > Pop $Dialog > > ${If} $Dialog == error > Abort > ${EndIf} > > ${NSD_CreateBitmap} 0 0 100% 100% "" > Pop $Image > ${NSD_SetImage} $Image $PLUGINSDIR\image.bmp $ImageHandle > > nsDialogs::Show > > ${NSD_FreeImage} $ImageHandle > > FunctionEnd > > Section > SectionEnd ``` -------------------------------- ### Install Sample Configuration Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/openal-soft/CMakeLists.txt Installs a sample configuration file if the ALSOFT_INSTALL_CONFIG option is enabled. ```cmake if(ALSOFT_INSTALL_CONFIG) install(FILES alsoftrc.sample DESTINATION ${CMAKE_INSTALL_DATADIR}/openal) message(STATUS "Installing sample configuration") endif() ``` -------------------------------- ### COM Interface Interaction with CoCreateInstance Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/bin/tools/nsis/app/Docs/System/System.html Demonstrates creating a COM interface instance using 'CoCreateInstance' and then calling methods on that interface. This example shows how to get the wallpaper using IActiveDesktop. ```nsis !define CLSCTX_INPROC_SERVER 1 !define CLSID_ActiveDesktop {75048700-EF1F-11D0-9888-006097DEACF9} !define IID_IActiveDesktop {F490EB00-1240-11D1-9888-006097DEACF9} # create IActiveDesktop interface System::Call "ole32::CoCreateInstance( \ g '${CLSID_ActiveDesktop}', i 0, \ i ${CLSCTX_INPROC_SERVER}, \ g '${IID_IActiveDesktop}', *i .r0) i.r1" StrCmp $1 0 0 end # call IActiveDesktop->GetWallpaper System::Call "$0->4(w .r2, i ${NSIS_MAX_STRLEN}, i 0)" # call IActiveDesktop->Release System::Call "$0->2()" # print result DetailPrint $2 end: ``` -------------------------------- ### Install {fmt} via vcpkg Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/openal-soft/fmt-11.1.1/doc/get-started.md Download and install {fmt} using the vcpkg package manager. This involves cloning the vcpkg repository, bootstrapping it, integrating it with your system, and then installing the fmt package. ```bash git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install ./vcpkg install fmt ``` -------------------------------- ### Integrate fmt with Meson Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/openal-soft/fmt-11.1.1/doc/get-started.md Use the Meson build system to include fmt as a subproject. This example shows how to get the dependency and link it to an executable. ```meson fmt = subproject('fmt') fmt_dep = fmt.get_variable('fmt_dep') ``` ```meson my_build_target = executable( 'name', 'src/main.cc', dependencies: [fmt_dep]) ``` -------------------------------- ### Install License File Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/CMakeLists.txt Installs the LICENSE.txt file to the specified license directory. ```cmake install(FILES "LICENSE.txt" DESTINATION "${LICENSES_PREFIX}") ``` -------------------------------- ### Install Executable Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/samples/SimpleTexturedDirectx11/CMakeLists.txt Defines installation rules for the executable. It specifies the destination directory and the component name for installation. ```cmake INSTALL( TARGETS assimp_simpletextureddirectx11 DESTINATION "${ASSIMP_BIN_INSTALL_DIR}" COMPONENT assimp-dev ) ``` -------------------------------- ### Install Package Configuration Files Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/CMakeLists.txt Installs the generated SDL2Config.cmake, SDL2ConfigVersion.cmake, and sdlfind.cmake files into the specified installation directory. ```cmake install( FILES ${CMAKE_CURRENT_BINARY_DIR}/SDL2Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/SDL2ConfigVersion.cmake ${SDL2_SOURCE_DIR}/cmake/sdlfind.cmake DESTINATION "${SDL_INSTALL_CMAKEDIR}" COMPONENT Devel ) ``` -------------------------------- ### Install Executable Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/samples/SimpleTexturedOpenGL/CMakeLists.txt Installs the 'assimp_simpletexturedogl' executable to the specified destination directory with the 'assimp-dev' component. ```cmake INSTALL( TARGETS assimp_simpletexturedogl DESTINATION "${ASSIMP_BIN_INSTALL_DIR}" COMPONENT assimp-dev ) ``` -------------------------------- ### Install Man Pages and Pkg-config Files Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/lpng/CMakeLists.txt Installs man pages and pkg-config files. Man pages are placed in share/man/man3 and share/man/man5. Pkg-config files are installed to the pkgconfig directory. ```cmake if(NOT PNG_MAN_DIR) set(PNG_MAN_DIR "share/man") endif() install(FILES libpng.3 libpngpf.3 DESTINATION ${PNG_MAN_DIR}/man3) install(FILES png.5 DESTINATION ${PNG_MAN_DIR}/man5) # Install pkg-config files if(NOT CMAKE_HOST_WIN32 OR CYGWIN OR MINGW) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ``` -------------------------------- ### Configure alffplay Example Executable Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/openal-soft/CMakeLists.txt Builds the 'alffplay' example executable if FFmpeg versions are compatible. It sets include directories, links necessary libraries (SDL3, FFmpeg, OpenAL), and configures target properties. The example is added to EXTRA_INSTALLS if ALSOFT_INSTALL_EXAMPLES is true. ```cmake if(FFVER_OK) add_executable(alffplay examples/alffplay.cpp) target_include_directories(alffplay PRIVATE ${FFMPEG_INCLUDE_DIRS}) target_link_libraries(alffplay PRIVATE ${LINKER_FLAGS} SDL3::SDL3 ${FFMPEG_LIBRARIES} alsoft.excommon alsoft::fmt) set_target_properties(alffplay PROPERTIES ${ALSOFT_STD_VERSION_PROPS}) if(ALSOFT_INSTALL_EXAMPLES) set(EXTRA_INSTALLS ${EXTRA_INSTALLS} alffplay) endif() message(STATUS "Building SDL3+FFmpeg example programs") endif() ``` -------------------------------- ### Install Pkgconfig File for FreeBSD Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/CMakeLists.txt Installs the sdl2.pc file to the pkgconfig directory, with a specific path for FreeBSD. ```cmake if(FREEBSD) # FreeBSD uses ${PREFIX}/libdata/pkgconfig install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "libdata/pkgconfig") else() install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") endif() ``` -------------------------------- ### Install SDL2 Static Library Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/CMakeLists.txt Installs the static SDL2 library, its import library, and runtime binaries. Includes conditional installation of PDB files for MSVC. ```cmake install(TARGETS SDL2-static EXPORT SDL2staticTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") if(MSVC) SDL_install_pdb(SDL2-static "${CMAKE_INSTALL_LIBDIR}") endif() ``` -------------------------------- ### Install FreeBSD Development Packages Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/src/hidapi/README.txt Installs GNU make, libiconv, and Fox-Toolkit on FreeBSD. Requires root privileges. ```bash pkg_add -r gmake libiconv fox16 ``` -------------------------------- ### Setting Installation Paths and Package Version Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/openal-soft/CMakeLists.txt Defines installation directories and the package version for pkg-config. ```cmake set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix "${prefix}") set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}") set(bindir "${CMAKE_INSTALL_FULL_BINDIR}") set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}") set(PACKAGE_VERSION "${LIB_VERSION}") set(PKG_CONFIG_CFLAGS ) set(PKG_CONFIG_PRIVATE_LIBS ) ``` -------------------------------- ### TestSuite::start_timestamp Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/contrib/googletest/docs/reference/testing.md Gets the time of the test suite start, in ms from the start of the UNIX epoch. ```APIDOC ## TestSuite::start_timestamp ### Description Gets the time of the test suite start, in ms from the start of the UNIX epoch. ### Signature `TimeInMillis TestSuite::start_timestamp() const` ``` -------------------------------- ### Basic SDL2 Initialization and Window Creation Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/docs/README-visualc.md This snippet demonstrates the fundamental steps to initialize SDL video, create a window, and set up a renderer. It also includes the necessary cleanup functions to properly shut down SDL. ```c #include "SDL.h" int main( int argc, char* argv[] ) { const int WIDTH = 640; const int HEIGHT = 480; SDL_Window* window = NULL; SDL_Renderer* renderer = NULL; SDL_Init(SDL_INIT_VIDEO); window = SDL_CreateWindow("SDL2 Test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_SHOWN); renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); SDL_DestroyRenderer(renderer); SDL_DestroyWindow(window); SDL_Quit(); return 0; } ``` -------------------------------- ### Install SDL for Native Development Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/mingw/pkg-support/INSTALL.txt Use this command to install SDL libraries when developing directly on the target system. ```bash make native ``` -------------------------------- ### Create Project Directory Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/contrib/googletest/docs/quickstart-cmake.md Initializes a new project directory and navigates into it. This is the first step in setting up a new project. ```bash $ mkdir my_project && cd my_project ``` -------------------------------- ### Build Output Example (Initial Build) Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/bin/bison-flex/custom_build_rules/README.md This output shows a successful initial build after setting up custom rules, indicating that Flex and Bison files were processed. ```text 1>------ Rebuild All started: Project: ConsoleApplication1, Configuration: Debug Win32 ------ 1> Process sample bison file 1> Process sample flex file 1> stdafx.cpp 1> ConsoleApplication1.cpp 1> Generating Code... 1> ConsoleApplication1.vcxproj -> C:\Users\ConsoleApplication1\Debug\ConsoleApplication1.exe ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ========== ``` -------------------------------- ### Get Start Menu Folder for Uninstaller Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/bin/tools/nsis/app/Docs/Modern UI 2/Readme.html Retrieves the Start Menu folder path for use in the uninstaller to remove shortcuts. Ensure the registry key is also removed during uninstallation. ```NSIS !insertmacro MUI_STARTMENU_GETFOLDER page_id $R0 Delete "$SMPROGRAMS\$R0\Your Shortcut.lnk" ``` -------------------------------- ### Run Poly2Tri Testbed Example: Load from File Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/contrib/poly2tri/README.md Loads triangulation data from a specified file and centers the geometry. Requires the testbed executable to be built. ```bash build/testbed/p2t ``` -------------------------------- ### Reserve Files for Faster Installation Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/bin/tools/nsis/app/Docs/Modern UI/Readme.html Include reserve file commands before sections and functions when using solid compression to ensure required files are loaded first, making the installer start faster. ```nsis ReserveFile "ioFile.ini" ;Your own InstallOptions INI files ``` ```nsis !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in ``` ```nsis !insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog ``` -------------------------------- ### App_ExampleBrowser Command Line Arguments Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/bullet/README.md Examples of command-line arguments for the App_ExampleBrowser executable to control demo startup, movie recording, sensitivity, and time stepping. ```bash [--start_demo_name="Demo Name"] Start with a selected demo [--mp4=moviename.mp4] Create a mp4 movie of the window, requires ffmpeg installed [--mouse_move_multiplier=0.400000] Set the mouse move sensitivity [--mouse_wheel_multiplier=0.01] Set the mouse wheel sensitivity [--background_color_red= 0.9] Set the red component for background color. Same for green and blue [--fixed_timestep= 0.0] Use either a real-time delta time (0.0) or a fixed step size (0.016666) ``` -------------------------------- ### Launch Action Example Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/visualtest/README.txt Launches an executable with specified arguments. The path to the executable is optional if it's in the system's PATH. ```plaintext LAUNCH [/path/to/executable] [args] ``` -------------------------------- ### HIDAPI Device Interaction Example (C) Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/src/hidapi/README.txt Demonstrates initializing HIDAPI, opening a device by VID/PID, reading string descriptors, sending commands, reading device state, and exiting the library. Error checking is omitted for brevity. ```c #ifdef WIN32 #include #endif #include #include #include "hidapi.h" #define MAX_STR 255 int main(int argc, char* argv[]) { int res; unsigned char buf[65]; wchar_t wstr[MAX_STR]; hid_device *handle; int i; // Initialize the hidapi library res = hid_init(); // Open the device using the VID, PID, // and optionally the Serial number. handle = hid_open(0x4d8, 0x3f, NULL); // Read the Manufacturer String res = hid_get_manufacturer_string(handle, wstr, MAX_STR); wprintf(L"Manufacturer String: %s\n", wstr); // Read the Product String res = hid_get_product_string(handle, wstr, MAX_STR); wprintf(L"Product String: %s\n", wstr); // Read the Serial Number String res = hid_get_serial_number_string(handle, wstr, MAX_STR); wprintf(L"Serial Number String: (%d) %s\n", wstr[0], wstr); // Read Indexed String 1 res = hid_get_indexed_string(handle, 1, wstr, MAX_STR); wprintf(L"Indexed String 1: %s\n", wstr); // Toggle LED (cmd 0x80). The first byte is the report number (0x0). buf[0] = 0x0; buf[1] = 0x80; res = hid_write(handle, buf, 65); // Request state (cmd 0x81). The first byte is the report number (0x0). buf[0] = 0x0; buf[1] = 0x81; res = hid_write(handle, buf, 65); // Read requested state res = hid_read(handle, buf, 65); // Print out the returned buffer. for (i = 0; i < 4; i++) printf("buf[%d]: %d\n", i, buf[i]); // Finalize the hidapi library res = hid_exit(); return 0; } ``` -------------------------------- ### Ruby (ffi) Binding for Zip Library Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/contrib/zip/README.md Example of using the zip library in Ruby with the FFI gem. First, install the gem, then bind the library functions in your module. The example demonstrates opening a zip file, creating an entry, writing content, and closing. ```shell $ gem install ffi ``` ```ruby require 'ffi' module Zip extend FFI::Library ffi_lib "./libzip.#{::FFI::Platform::LIBSUFFIX}" attach_function :zip_open, [:string, :int, :char], :pointer attach_function :zip_close, [:pointer], :void attach_function :zip_entry_open, [:pointer, :string], :int attach_function :zip_entry_close, [:pointer], :void attach_function :zip_entry_write, [:pointer, :string, :int], :int end ptr = Zip.zip_open("/tmp/ruby.zip", 6, "w".bytes()[0]) status = Zip.zip_entry_open(ptr, "test") content = "test content" status = Zip.zip_entry_write(ptr, content, content.size()) Zip.zip_entry_close(ptr) Zip.zip_close(ptr) ``` -------------------------------- ### Get User Memory Pointer Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/lpng/libpng-manual.txt Retrieve the pointer to user-defined memory management data. Added to support user memory management by default starting with libpng 1.0.7. ```c png_get_mem_ptr() ``` -------------------------------- ### Standalone BasicExampleGui Setup Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/bullet/examples/BasicDemo/CMakeLists.txt Configures include directories and source files for the standalone BasicExampleGui, which uses OpenGL. ```cmake INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/btgui ${BULLET_PHYSICS_SOURCE_DIR}/examples ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew ) SET(AppBasicExampleGui_SRCS BasicExample.cpp ${BULLET_PHYSICS_SOURCE_DIR}/build3/bullet.rc ../StandaloneMain/main_opengl_single_example.cpp ../ExampleBrowser/OpenGLGuiHelper.cpp ../ExampleBrowser/GL_ShapeDrawer.cpp ../ExampleBrowser/CollisionShape2TriangleMesh.cpp ../Utils/b3Clock.cpp ) #this define maps StandaloneExampleCreateFunc to the right 'CreateFunc' ADD_DEFINITIONS(-DB3_USE_STANDALONE_EXAMPLE) ``` -------------------------------- ### Write a Basic GoogleTest Case Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/contrib/googletest/docs/quickstart-bazel.md Include the GoogleTest header and use basic assertions like EXPECT_STRNE and EXPECT_EQ to test code behavior. This is a fundamental example for starting with GoogleTest. ```cpp #include // Demonstrate some basic assertions. TEST(HelloTest, BasicAssertions) { // Expect two strings not to be equal. EXPECT_STRNE("hello", "world"); // Expect equality. EXPECT_EQ(7 * 6, 42); } ``` -------------------------------- ### Utility and Example Dependencies Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/openal-soft/CMakeLists.txt Finds necessary packages for utilities and examples, including MySOFA, Qt5Widgets, SndFile, and FFmpeg, based on build options. ```cmake if(ALSOFT_UTILS) find_package(MySOFA) if(NOT ALSOFT_NO_CONFIG_UTIL) find_package(Qt5Widgets QUIET) if(NOT Qt5Widgets_FOUND) message(STATUS "Could NOT find Qt5Widgets") endif() endif() endif() if(ALSOFT_UTILS OR ALSOFT_EXAMPLES) find_package(SndFile) endif() if(ALSOFT_EXAMPLES AND SDL3_FOUND) find_package(FFmpeg COMPONENTS AVFORMAT AVCODEC AVUTIL SWSCALE SWRESAMPLE) endif() ``` -------------------------------- ### Get Pixel Placement Information (libpng) Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/lpng/libpng-manual.txt Macros to retrieve the starting column and row, and the spacing between pixels for a given pass in an interlaced image. 'pass' is in the range 0 to 6. ```c png_uint_32 x = PNG_PASS_START_COL(pass); png_uint_32 y = PNG_PASS_START_ROW(pass); png_uint_32 xStep = 1U << PNG_PASS_COL_SHIFT(pass); ``` -------------------------------- ### Initialize Multi-User Installer Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/bin/tools/nsis/app/Docs/MultiUser/Readme.html Set the execution level and include the MultiUser.nsh header. Define MULTIUSER_NOUNINSTALL if no uninstaller is present. Insert MULTIUSER_INIT and MULTIUSER_UNINIT macros in .onInit and un.onInit functions respectively. ```nsis !define MULTIUSER_EXECUTIONLEVEL Highest ;!define MULTIUSER_NOUNINSTALL ;Uncomment if no uninstaller is created !include MultiUser.nsh ... Function .onInit !insertmacro MULTIUSER_INIT FunctionEnd Function un.onInit !insertmacro MULTIUSER_UNINIT FunctionEnd ``` -------------------------------- ### Install OpenAL Soft using vcpkg Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/openal-soft/README.md Steps to clone the vcpkg repository, bootstrap it, integrate it with your system, and then install openal-soft. ```bash git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install ./vcpkg install openal-soft ``` -------------------------------- ### Get Previous Code Point (Unchecked) Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/contrib/utf8cpp/doc/README.md Decrements an iterator to the start of the previous UTF-8 code point and returns its value. Use when the sequence is valid and boundary checks are not needed. ```cpp template uint32_t prior(octet_iterator& it); ``` ```cpp char* twochars = "\xe6\x97\xa5\xd1\x88"; char* w = twochars + 3; int cp = unchecked::prior (w); assert (cp == 0x65e5); assert (w == twochars); ``` -------------------------------- ### Example .parameters File Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/visualtest/README.txt Defines options for the test harness. Use hash characters for comments. Options can be enums with multiple values or booleans. ```plaintext --blend, enum, [add mod], false, [] --fullscreen, boolean, [], false, [] ``` -------------------------------- ### Table Y Lookup Table Example Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/zlib/doc/algorithm.txt Represents another secondary lookup table (Table Y) used for codes starting with '111'. This table is three bits long and decodes symbols F, G, H, I, and J. ```text 000: F,2 001: F,2 010: G,2 011: G,2 100: H,2 101: H,2 110: I,3 111: J,3 ``` -------------------------------- ### ConnectInternet Function Example (NSIS) Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/bin/tools/nsis/app/Docs/Dialer/Dialer.txt This NSIS function uses the Dialer plugin to attempt an internet connection if one is not already available. It handles cases where Internet Explorer 3 is not installed and provides user feedback. ```nsis Function ConnectInternet Push $R0 ClearErrors Dialer::AttemptConnect IfErrors noie3 Pop $R0 StrCmp $R0 "online" connected MessageBox MB_OK|MB_ICONSTOP "Cannot connect to the internet." Quit ;Remove to make error not fatal noie3: ; IE3 not installed MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now." connected: Pop $R0 FunctionEnd ``` -------------------------------- ### Run Poly2Tri Testbed Example: Load from File and Auto-Fit Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/contrib/poly2tri/README.md Loads triangulation data from a specified file and automatically fits the geometry to the window dimensions. Requires the testbed executable to be built. ```bash build/testbed/p2t ``` -------------------------------- ### Build Output Example (Generated Files Included) Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/bin/bison-flex/custom_build_rules/README.md This output demonstrates a successful build after including the generated .cpp files into the project. Ensure generated files are not excluded from precompiled headers. ```text 1>------ Build started: Project: ConsoleApplication1, Configuration: Debug Win32 ------ 1> Process sample bison file 1> Process sample flex file 1> sample.tab.cpp 1> sample.flex.cpp 1> Generating Code... 1> ConsoleApplication1.vcxproj -> C:\Users\ConsoleApplication1\Debug\ConsoleApplication1.exe ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ``` -------------------------------- ### Boilerplate for Custom main() Function in GoogleTest Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/contrib/googletest/docs/primer.md This C++ code provides a template for a custom `main` function in GoogleTest. It includes necessary headers, namespace setup, a test fixture class `FooTest` with `SetUp()` and `TearDown()` methods, example tests `MethodBarDoesAbc` and `DoesXyz`, and the essential `::testing::InitGoogleTest()` and `RUN_ALL_TESTS()` calls. Remember to call `::testing::InitGoogleTest()` before `RUN_ALL_TESTS()` for proper flag initialization. ```c++ #include "this/package/foo.h" #include namespace my { namespace project { namespace { // The fixture for testing class Foo. class FooTest : public ::testing::Test { protected: // You can remove any or all of the following functions if their bodies would // be empty. FooTest() { // You can do set-up work for each test here. } ~FooTest() override { // You can do clean-up work that doesn't throw exceptions here. } // If the constructor and destructor are not enough for setting up // and cleaning up each test, you can define the following methods: void SetUp() override { // Code here will be called immediately after the constructor (right // before each test). } void TearDown() override { // Code here will be called immediately after each test (right // before the destructor). } // Class members declared here can be used by all tests in the test suite // for Foo. }; // Tests that the Foo::Bar() method does Abc. TEST_F(FooTest, MethodBarDoesAbc) { const std::string input_filepath = "this/package/testfile.dat"; const std::string output_filepath = "this/package/testfile.dat"; Foo f; EXPECT_EQ(f.Bar(input_filepath, output_filepath), 0); } // Tests that Foo does Xyz. TEST_F(FooTest, DoesXyz) { // Exercises the Xyz feature of Foo. } } // namespace } // namespace project } // namespace my int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } ``` -------------------------------- ### Core API Print Example Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/openal-soft/fmt-11.1.1/doc/ChangeLog-old.md Demonstrates using the lightweight core API for printing formatted output. Include for this functionality. ```cpp #include fmt::print("The answer is {}.", 42); ``` -------------------------------- ### Python (cffi) Binding for Zip Library Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/contrib/zip/README.md Example of using the zip library in Python with the cffi package. Install the package, then define the C definitions and load the library. The code demonstrates creating a zip file, adding an entry, writing content, and closing. ```shell $ pip install cffi ``` ```python import ctypes.util from cffi import FFI ffi = FFI() ffi.cdef(""" struct zip_t *zip_open(const char *zipname, int level, char mode); void zip_close(struct zip_t *zip); int zip_entry_open(struct zip_t *zip, const char *entryname); int zip_entry_close(struct zip_t *zip); int zip_entry_write(struct zip_t *zip, const void *buf, size_t bufsize); ") Zip = ffi.dlopen(ctypes.util.find_library("zip")) ptr = Zip.zip_open("/tmp/python.zip", 6, 'w') status = Zip.zip_entry_open(ptr, "test") content = "test content" status = Zip.zip_entry_write(ptr, content, len(content)) Zip.zip_entry_close(ptr) Zip.zip_close(ptr) ``` -------------------------------- ### Build Assimp with Samples Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/Build.md To include the official Assimp samples in the build, set the `ASSIMP_BUILD_SAMPLES` option to `ON`. This requires Glut. ```bash cmake CMakeLists.txt -DASSIMP_BUILD_SAMPLES=ON ``` -------------------------------- ### Build Example Executable Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/zlib/CMakeLists.txt Builds the 'example' executable from test/example.c and links it against the zlib library. It also registers it as a CTest test. ```cmake if(ZLIB_BUILD_EXAMPLES) add_executable(example test/example.c) target_link_libraries(example zlib) add_test(example example) ``` -------------------------------- ### CMake Build Configuration for Torque3D Source: https://context7.com/torquegameengines/torque3d/llms.txt This CMake script configures a Torque3D project. Ensure `TORQUE_APP_NAME` is set before running CMake. It utilizes macros from `torque_macros.cmake` for versioning, template installation, and feature flag propagation. Example vcpkg.json dependencies and Windows MSVC build steps are also shown. ```cmake # CMake configuration example - build from the repository root cmake_minimum_required(VERSION 3.21.0) # Required: set app name before running cmake # cmake -DTORQUE_APP_NAME=MyGame -DTORQUE_TEMPLATE=BaseGame .. # torque_macros.cmake - key macros available after include: # setupVersionNumbers() -> sets TORQUE_APP_VERSION_MAJOR/MINOR/PATCH # installTemplate(name) -> copies Templates/ to My Projects/ # torqueAddSourceDirectories(dir1 dir2 ...) -> collects .cpp/.h into TORQUE_SOURCE_FILES # forwardDef(FLAG) -> appends FLAG to TORQUE_COMPILE_DEFINITIONS if ON # advanced_option(FLAG description state) -> marks cmake option as advanced # Example vcpkg.json dependency block (already present in repo): # { # "name": "torque3d", # "dependencies": ["libogg","libvorbis","libflac","opus","libtheora","libsndfile"], # "overrides": [ # { "name": "libogg", "version": "1.3.6" }, # { "name": "libvorbis", "version": "1.3.7" }, # { "name": "libflac", "version": "1.5.0" }, # { "name": "opus", "version": "1.5.2" }, # { "name": "libtheora", "version": "1.2.0" } # ] # } # Build steps (Windows MSVC example): # cmake -B build -DTORQUE_APP_NAME=MyGame -DCMAKE_TOOLCHAIN_FILE=Tools/CMake/vcpkg/scripts/buildsystems/vcpkg.cmake # cmake --build build --config Release # Output binary lands in: My Projects/MyGame/game/ ``` -------------------------------- ### Get Previous UTF-8 Code Point and Decrement Iterator Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/contrib/utf8cpp/doc/README.md Use `utf8::prior` to find the beginning of the previous UTF-8 code point and decode it, decrementing the iterator. It requires a bidirectional iterator and a start boundary to prevent going past the string beginning. Throws `utf8::invalid_utf8` or `utf8::not_enough_room` on errors. ```cpp template uint32_t prior(octet_iterator& it, octet_iterator start); char* twochars = "\xe6\x97\xa5\xd1\x88"; unsigned char* w = twochars + 3; int cp = prior (w, twochars); assert (cp == 0x65e5); assert (w == twochars); ``` -------------------------------- ### Install Assimp using vcpkg Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/Build.md Install Assimp using the vcpkg dependency manager. This method is recommended for cross-platform compatibility. ```bash git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install ./vcpkg install assimp ``` -------------------------------- ### Set Installation Mode Manually Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/bin/tools/nsis/app/Docs/MultiUser/Readme.html Call these functions to manually set the installation mode for the installer or uninstaller. This is useful for scripting or specific installation scenarios. ```nsis MultiUser.InstallMode.AllUsers MultiUser.InstallMode.CurrentUser un.MultiUser.InstallMode.AllUsers un.MultiUser.InstallMode.CurrentUser ``` -------------------------------- ### Format String Examples Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/openal-soft/fmt-11.1.1/doc/syntax.md Illustrates basic format string usage with explicit and implicit argument referencing. ```c++ "First, thou shalt count to {0}" // References the first argument ``` ```c++ "Bring me a {}" // Implicitly references the first argument ``` ```c++ "From {} to {}" // Same as "From {0} to {1}" ``` -------------------------------- ### Install Google Test Libraries Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/contrib/googletest/googletest/CMakeLists.txt Installs the gtest and gtest_main libraries as part of the project installation rules. ```cmake install_project(gtest gtest_main) ``` -------------------------------- ### Build 64-bit Example Executable Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/zlib/CMakeLists.txt Builds a 64-bit version of the 'example' executable if HAVE_OFF64_T is defined. It links against zlib and sets the COMPILE_FLAGS to enable 64-bit file offsets. ```cmake if(HAVE_OFF64_T) add_executable(example64 test/example.c) target_link_libraries(example64 zlib) set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") add_test(example64 example64) ``` -------------------------------- ### Prepare Chroot Environment for Cross-Compilation Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/docs/README-raspberrypi.md Installs QEMU for ARM emulation and copies the static QEMU binary into the system root. It also binds mount essential host directories into the chroot environment. ```bash sudo apt-get install qemu binfmt-support qemu-user-static sudo cp /usr/bin/qemu-arm-static $SYSROOT/usr/bin sudo mount --bind /dev $SYSROOT/dev sudo mount --bind /proc $SYSROOT/proc sudo mount --bind /sys $SYSROOT/sys ``` -------------------------------- ### Android JNIIOSystem Header Installation Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/code/CMakeLists.txt Installs the AndroidJNIIOSystem.h header if the ASSIMP_ANDROID_JNIIOSYSTEM option is enabled and Assimp is set to install. ```cmake if (ASSIMP_ANDROID_JNIIOSYSTEM AND ASSIMP_INSTALL) INSTALL(FILES ${HEADER_PATH}/${ASSIMP_ANDROID_JNIIOSYSTEM_PATH}/AndroidJNIIOSystem.h DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR} COMPONENT assimp-dev) ENDIF() ``` -------------------------------- ### Initialize and Show Custom Start Menu Dialog Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/bin/tools/nsis/app/Docs/StartMenu/Readme.txt Use Init and Show to customize the dialog's controls, such as colors and fonts. Init returns the HWND of the page, which can then be used with GetDlgItem and SetCtlColors. The Show function then displays the customized dialog. ```nsis StartMenu::Init "Test" Pop $0 IntCmp $0 0 failed GetDlgItem $0 $0 1003 SetCtlColors $0 "" FF0000 StartMenu::Show # continue as with Select here failed: ``` -------------------------------- ### Install SDL Test Executables and Resources Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/test/CMakeLists.txt Installs test executables, PDB files (on MSVC), and resource files to the designated installation directory if SDL_INSTALL_TESTS is enabled. Handles platform-specific installation for RISC OS. ```cmake if(SDL_INSTALL_TESTS) if(RISCOS) install( FILES ${SDL_TEST_EXECUTABLES_AIF} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2 ) else() install( TARGETS ${SDL_TEST_EXECUTABLES} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2 ) endif() if(MSVC) foreach(test ${SDL_TEST_EXECUTABLES}) SDL_install_pdb(${test} "${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2") endforeach() endif() install( FILES ${RESOURCE_FILES} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2 ) endif() ``` -------------------------------- ### Example of androidbuild.sh with Relative Paths Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/docs/README-android.md This example demonstrates how to use `androidbuild.sh` from the `build-scripts` directory to compile a test application, specifying the source file using a relative path. ```bash ./androidbuild.sh org.libsdl.testgles ../test/testgles.c ``` -------------------------------- ### Configure and Install GTest for Cross-Compilation Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/gtest/docs/pkgconfig.md Configure GTest with a specific installation prefix and install it into a sysroot directory using DESTDIR. ```bash mkdir build && cmake -DCMAKE_INSTALL_PREFIX=/usr .. ``` ```bash make -j install DESTDIR=/home/MYUSER/sysroot ``` -------------------------------- ### Install ZLIB Pkgconfig File Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/zlib/CMakeLists.txt Installs the zlib pkgconfig file to the installation pkgconfig directory. This is skipped if SKIP_INSTALL_FILES or SKIP_INSTALL_ALL is set. ```cmake if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) install(FILES ${ZLIB_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}") endif() ``` -------------------------------- ### Build assimp for iOS with specific options Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/assimp/port/iOS/README.md Example of executing the build script with custom configurations for C++ standard library, architectures, fat library generation, and minimum iOS version. ```bash cd ./port/iOS/ ./build.sh --stdlib=libc++ --archs="arm64 x86_64" --no-fat --min-version="16.0" ``` -------------------------------- ### Install Configuration Scripts Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/lpng/CMakeLists.txt Installs configuration scripts like libpng-config and PNGLIB_NAME-config. These are typically installed to the bin directory on non-Windows systems. ```cmake if(NOT WIN32 OR CYGWIN OR MINGW) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config DESTINATION bin) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config DESTINATION bin) ``` -------------------------------- ### Install SDL2 Library Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/CMakeLists.txt Installs the SDL2 shared library to the specified installation directory. This ensures the library is available system-wide after the build process. ```cmake install(FILES ${SDL2_BINARY_DIR}/libSDL2${SOPOSTFIX}${SOEXT} DESTINATION "${CMAKE_INSTALL_LIBDIR}") ``` -------------------------------- ### Install and Uninstall Command Usage Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/bin/tools/nsis/app/Docs/StrFunc/StrFunc.txt Demonstrates the usage of both install (${StrStr}) and uninstall (${UnStrStr}) versions of commands within their respective sections. ```nsis !include "StrFunc.nsh" ${StrStr} // Supportable for Install Sections and Functions ${UnStrStr} // Supportable for Uninstall Sections and Functions Section ${StrStr} $0 "OK! Now what?" "wh" SectionEnd Section Uninstall ${UnStrStr} $0 "OK! Now what?" "wh" SectionEnd ``` -------------------------------- ### Input I/O Setup Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/lpng/libpng-manual.txt Functions to configure how libpng reads data from a file or other input source. ```APIDOC ## Input I/O Setup ### Description Configures the input source for libpng to read PNG data. ### Functions - `png_init_io(png_structp png_ptr, FILE *fp)`: Initializes libpng to use the standard C `fread()` function with the provided `FILE` pointer. The file must be opened in binary mode. - `png_set_sig_bytes(png_structp png_ptr, int number)`: Informs libpng if some initial bytes of the file signature have already been read. - `png_set_compression_buffer_size(png_structp png_ptr, size_t buffer_size)`: Sets the size of the zlib compression buffer used for reading compressed data. The default is 8192 bytes. ``` -------------------------------- ### Install SDL2main Library Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/CMakeLists.txt Installs the SDL2main library, which is often required for Windows applications. Includes conditional installation of PDB files for MSVC. ```cmake install(TARGETS SDL2main EXPORT SDL2mainTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") if(MSVC) SDL_install_pdb(SDL2main "${CMAKE_INSTALL_LIBDIR}") endif() ``` -------------------------------- ### Install ZLIB Man Page Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/zlib/CMakeLists.txt Installs the zlib man page (zlib.3) to the installation man3 directory. This is skipped if SKIP_INSTALL_FILES or SKIP_INSTALL_ALL is set. ```cmake if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) install(FILES zlib.3 DESTINATION "${INSTALL_MAN_DIR}/man3") endif() ``` -------------------------------- ### Build Fox-Toolkit from Source Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/sdl/src/hidapi/README.txt Builds and installs Fox-Toolkit from source, necessary for redistributable app bundles on macOS. Requires compilation tools. ```bash ./configure && make && make install ``` -------------------------------- ### Install ZLIB Public Headers Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/zlib/CMakeLists.txt Installs the public header files for zlib to the installation include directory. This is skipped if SKIP_INSTALL_HEADERS or SKIP_INSTALL_ALL is set. ```cmake if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION "${INSTALL_INC_DIR}") endif() ``` -------------------------------- ### Install BulletCollision Target Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/bullet/src/BulletCollision/CMakeLists.txt Installs the BulletCollision target. The installation path depends on whether shared libraries are being built as frameworks on Apple platforms. ```cmake INSTALL(TARGETS BulletCollision DESTINATION .) ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS BulletCollision RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX}) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE) INSTALL(FILES ../btBulletCollisionCommon.h DESTINATION ${INCLUDE_INSTALL_DIR}/BulletCollision) ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) ``` -------------------------------- ### Install Bullet2FileLoader Library and Headers Source: https://github.com/torquegameengines/torque3d/blob/development/Engine/lib/bullet/src/Bullet3Serialize/Bullet2FileLoader/CMakeLists.txt Configures installation rules for the Bullet2FileLoader library and its headers, with special handling for macOS frameworks and conditional installation. ```cmake IF (INSTALL_LIBS) IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) #FILES_MATCHING requires CMake 2.6 IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS Bullet2FileLoader DESTINATION .) ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS Bullet2FileLoader RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX}) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE) ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) SET_TARGET_PROPERTIES(Bullet2FileLoader PROPERTIES FRAMEWORK true) SET_TARGET_PROPERTIES(Bullet2FileLoader PROPERTIES PUBLIC_HEADER "${Bullet2FileLoader_HDRS}") ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) ENDIF (INSTALL_LIBS) ```