From 18608f5476c151d43cd03667b012bf5cd58cc549 Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Sat, 21 Sep 2024 01:37:22 -0400 Subject: [PATCH 1/8] Update filib --- cmake/recipes/filib.cmake | 7 +++++-- src/ipc/utils/interval.hpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake/recipes/filib.cmake b/cmake/recipes/filib.cmake index dcbcc522e..de2fb4800 100644 --- a/cmake/recipes/filib.cmake +++ b/cmake/recipes/filib.cmake @@ -1,10 +1,13 @@ # filib (https://github.com/zfergus/filib.git) -# License: LGPL +# License: LGPL-2.1 if(TARGET filib::filib) return() endif() message(STATUS "Third-party: creating target 'filib::filib'") +# This has to be set to ON to avoid licensing IPC Toolkit under LGPL +set(FILIB_BUILD_SHARED_LIB ON CACHE BOOL "Build shared library" FORCE) + include(CPM) -CPMAddPackage("gh:zfergus/filib#1cd377a7c833a68dc47217829e333f4886c5c46d") \ No newline at end of file +CPMAddPackage("gh:zfergus/filib#5b9cbc73790585b391da1624c1f1ea52eaaeb5ac") \ No newline at end of file diff --git a/src/ipc/utils/interval.hpp b/src/ipc/utils/interval.hpp index a4bf00ec4..69f1b15af 100644 --- a/src/ipc/utils/interval.hpp +++ b/src/ipc/utils/interval.hpp @@ -21,7 +21,7 @@ class Interval : public interval { this->SUP = 0; } - Interval(double x) + explicit Interval(double x) { this->INF = x; this->SUP = x; From 47377b25007a4a7cb39f9a9fa7774ad9578517fd Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Sun, 22 Sep 2024 19:11:48 -0400 Subject: [PATCH 2/8] Update filib package to version 03e4eb0fc59399bd0003f8efd3179078195df49f --- cmake/recipes/filib.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/recipes/filib.cmake b/cmake/recipes/filib.cmake index de2fb4800..9d8b355da 100644 --- a/cmake/recipes/filib.cmake +++ b/cmake/recipes/filib.cmake @@ -10,4 +10,4 @@ message(STATUS "Third-party: creating target 'filib::filib'") set(FILIB_BUILD_SHARED_LIB ON CACHE BOOL "Build shared library" FORCE) include(CPM) -CPMAddPackage("gh:zfergus/filib#5b9cbc73790585b391da1624c1f1ea52eaaeb5ac") \ No newline at end of file +CPMAddPackage("gh:zfergus/filib#03e4eb0fc59399bd0003f8efd3179078195df49f") \ No newline at end of file From cf6a129f90bc53a2cbea95ef867e97e5fd3312fd Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Sun, 22 Sep 2024 19:23:15 -0400 Subject: [PATCH 3/8] .gitignore visual studio --- .gitignore | 403 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 403 insertions(+) diff --git a/.gitignore b/.gitignore index 00625903e..bad03b826 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,409 @@ Network Trash Folder Temporary Items .apdisk +############################################################################### +# Visual Studio +############################################################################### + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + ############################################################################### # C++ ############################################################################### From 6fa425b5a901a71e91a43e7d96f169b5fc518263 Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Tue, 24 Sep 2024 00:26:25 -0400 Subject: [PATCH 4/8] Copy DLLs to tests and python output dir --- .gitignore | 2 ++ python/CMakeLists.txt | 9 +++++++++ tests/CMakeLists.txt | 9 +++++++++ 3 files changed, 20 insertions(+) diff --git a/.gitignore b/.gitignore index bad03b826..a83094bbb 100644 --- a/.gitignore +++ b/.gitignore @@ -435,6 +435,8 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +CMakeSettings.json + ############################################################################### # C++ ############################################################################### diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 300116348..c1dc1268f 100755 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -9,5 +9,14 @@ target_include_directories(ipctk PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src") target_link_libraries(ipctk PRIVATE ipc::toolkit) +if (WIN32) + # Copy DLLs to the output directory + add_custom_command( + TARGET ipctk POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $ + COMMAND_EXPAND_LISTS + ) +endif() + # Extra warnings # target_link_libraries(ipctk PRIVATE IPCToolkit::warnings) \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index dd187730a..d583cceec 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -73,6 +73,15 @@ target_link_libraries(ipc_toolkit_tests PRIVATE ipc::toolkit::warnings) target_compile_definitions(ipc_toolkit_tests PUBLIC CATCH_CONFIG_ENABLE_BENCHMARKING) +if (WIN32) + # Copy DLLs to the output directory + add_custom_command( + TARGET ipc_toolkit_tests POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $ + COMMAND_EXPAND_LISTS + ) +endif() + ################################################################################ # Register tests ################################################################################ From e2de1b919fd42ce7d32e2f1f2ecc202f98398b3d Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Tue, 24 Sep 2024 01:06:55 -0400 Subject: [PATCH 5/8] Disable filib shared lib for windows --- README.md | 13 +++++++++++++ cmake/recipes/filib.cmake | 13 +++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2103ded23..8c374002c 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,19 @@ The following dependencies are optionally used based on CMake options: * [filib](https://github.com/zfergus/filib): interval arithmetic for nonlinear trajectories/CCD * Enable by using the CMake option `IPC_TOOLKIT_WITH_FILIB` * Enabled by default + * NOTE: filib is licensed under LGPL-2.1 and as such it is required to be dynamically linked. We enable this by default for Linux and MacOS. However, for Windows, we disable this by default because it requires copying the DLLs to the binary directory. To enable this, set the CMake option `FILIB_BUILD_SHARED_LIBS` to `ON` and add this CMake code to copy the DLLs to the binary directory: + ```cmake + if(WIN32) + # Copy DLLs to the output directory + add_custom_command( + TARGET ${MY_EXE_TARGET} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $ + COMMAND_EXPAND_LISTS + ) + endif() + ``` + * where `${MY_EXE_TARGET}` is the name of your executable target. If you know a better way to handle this, please [let us know](https://github.com/ipc-sim/ipc-toolkit/discussions)! + * If you would rather avoid LGPL code entirely, you can disable filib by setting `IPC_TOOLKIT_WITH_FILIB` to `OFF`. With this option disabled, CMake will not download or use any of filib's code. * [rational-cpp](https://github.io/zfergus/rational-cpp): rational arithmetic used for exact intersection checks * Enable by using the CMake option `IPC_TOOLKIT_WITH_RATIONAL_INTERSECTION` * Requires [GMP](https://gmplib.org/) to be installed at a system level diff --git a/cmake/recipes/filib.cmake b/cmake/recipes/filib.cmake index 9d8b355da..758d630b7 100644 --- a/cmake/recipes/filib.cmake +++ b/cmake/recipes/filib.cmake @@ -6,8 +6,17 @@ endif() message(STATUS "Third-party: creating target 'filib::filib'") -# This has to be set to ON to avoid licensing IPC Toolkit under LGPL -set(FILIB_BUILD_SHARED_LIB ON CACHE BOOL "Build shared library" FORCE) +# filib should be built as a shared library to avoid licensing IPC Toolkit under LGPL +if(WIN32 AND NOT IPC_TOOLKIT_TOPLEVEL_PROJECT) + # Setting up proper linkage on Windows is a bit tricky, so we'll just use a + # static library by default and provide instructions on how to build as a + # shared library in the README. + option(FILIB_BUILD_SHARED_LIB "Build shared library" OFF) +else() + # NOTE: Our Windows CMake is properly configured to build shared libraries for + # OUR applications and python bindings. + option(FILIB_BUILD_SHARED_LIB "Build shared library" ON) +endif() include(CPM) CPMAddPackage("gh:zfergus/filib#03e4eb0fc59399bd0003f8efd3179078195df49f") \ No newline at end of file From a2666a812e33617c07cb508064e87669fdf22979 Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Sun, 29 Sep 2024 15:24:46 -0400 Subject: [PATCH 6/8] Disable FILIB_BUILD_SHARED_LIB by default --- README.md | 16 +++++++--------- cmake/recipes/filib.cmake | 15 ++++----------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 8c374002c..bbd5129f7 100644 --- a/README.md +++ b/README.md @@ -84,16 +84,14 @@ The following dependencies are optionally used based on CMake options: * [filib](https://github.com/zfergus/filib): interval arithmetic for nonlinear trajectories/CCD * Enable by using the CMake option `IPC_TOOLKIT_WITH_FILIB` * Enabled by default - * NOTE: filib is licensed under LGPL-2.1 and as such it is required to be dynamically linked. We enable this by default for Linux and MacOS. However, for Windows, we disable this by default because it requires copying the DLLs to the binary directory. To enable this, set the CMake option `FILIB_BUILD_SHARED_LIBS` to `ON` and add this CMake code to copy the DLLs to the binary directory: + * NOTE: filib is licensed under LGPL-2.1 and as such it is required to be dynamically linked. Doing so automatically is a challenge, so by default we use static linkage. Enabling dynaic linkage requires copying the `.so`/`.dylib`/`.dll` file to the binary directory or system path. To enable this, set the CMake option `FILIB_BUILD_SHARED_LIBS` to `ON` and add this CMake code to copy the shared libaray object to the binary directory: ```cmake - if(WIN32) - # Copy DLLs to the output directory - add_custom_command( - TARGET ${MY_EXE_TARGET} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $ - COMMAND_EXPAND_LISTS - ) - endif() + # Copy shared lib to the output directory + add_custom_command( + TARGET ${MY_EXE_TARGET} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $ + COMMAND_EXPAND_LISTS + ) ``` * where `${MY_EXE_TARGET}` is the name of your executable target. If you know a better way to handle this, please [let us know](https://github.com/ipc-sim/ipc-toolkit/discussions)! * If you would rather avoid LGPL code entirely, you can disable filib by setting `IPC_TOOLKIT_WITH_FILIB` to `OFF`. With this option disabled, CMake will not download or use any of filib's code. diff --git a/cmake/recipes/filib.cmake b/cmake/recipes/filib.cmake index 758d630b7..73dd15d68 100644 --- a/cmake/recipes/filib.cmake +++ b/cmake/recipes/filib.cmake @@ -6,17 +6,10 @@ endif() message(STATUS "Third-party: creating target 'filib::filib'") -# filib should be built as a shared library to avoid licensing IPC Toolkit under LGPL -if(WIN32 AND NOT IPC_TOOLKIT_TOPLEVEL_PROJECT) - # Setting up proper linkage on Windows is a bit tricky, so we'll just use a - # static library by default and provide instructions on how to build as a - # shared library in the README. - option(FILIB_BUILD_SHARED_LIB "Build shared library" OFF) -else() - # NOTE: Our Windows CMake is properly configured to build shared libraries for - # OUR applications and python bindings. - option(FILIB_BUILD_SHARED_LIB "Build shared library" ON) -endif() +# NOTE: filib should be built as a shared library to avoid licensing IPC Toolkit under LGPL +# However, Setting up proper linkage is a bit tricky, so we'll just use a static library by +# default and provide instructions on how to build as a shared library in the README. +option(FILIB_BUILD_SHARED_LIB "Build shared library" OFF) include(CPM) CPMAddPackage("gh:zfergus/filib#03e4eb0fc59399bd0003f8efd3179078195df49f") \ No newline at end of file From 10e986e7cebd26ed3e9324f6f4dfc6261d87bb1b Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Sun, 29 Sep 2024 20:46:02 -0400 Subject: [PATCH 7/8] Only copy DLL if shared lib --- python/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index c1dc1268f..1c0ce49ed 100755 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -9,7 +9,7 @@ target_include_directories(ipctk PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src") target_link_libraries(ipctk PRIVATE ipc::toolkit) -if (WIN32) +if (FILIB_BUILD_SHARED_LIB AND WIN32) # Copy DLLs to the output directory add_custom_command( TARGET ipctk POST_BUILD diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d583cceec..14620cf28 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -73,7 +73,7 @@ target_link_libraries(ipc_toolkit_tests PRIVATE ipc::toolkit::warnings) target_compile_definitions(ipc_toolkit_tests PUBLIC CATCH_CONFIG_ENABLE_BENCHMARKING) -if (WIN32) +if (FILIB_BUILD_SHARED_LIB AND WIN32) # Copy DLLs to the output directory add_custom_command( TARGET ipc_toolkit_tests POST_BUILD From a8ed8efe39b8557ab9f2185ea55c6065969bdedd Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Tue, 1 Oct 2024 00:19:19 -0400 Subject: [PATCH 8/8] Add filib dependency note to cpp.rst --- README.md | 13 ++----------- docs/source/cpp.rst | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index bbd5129f7..f608350c7 100644 --- a/README.md +++ b/README.md @@ -84,17 +84,6 @@ The following dependencies are optionally used based on CMake options: * [filib](https://github.com/zfergus/filib): interval arithmetic for nonlinear trajectories/CCD * Enable by using the CMake option `IPC_TOOLKIT_WITH_FILIB` * Enabled by default - * NOTE: filib is licensed under LGPL-2.1 and as such it is required to be dynamically linked. Doing so automatically is a challenge, so by default we use static linkage. Enabling dynaic linkage requires copying the `.so`/`.dylib`/`.dll` file to the binary directory or system path. To enable this, set the CMake option `FILIB_BUILD_SHARED_LIBS` to `ON` and add this CMake code to copy the shared libaray object to the binary directory: - ```cmake - # Copy shared lib to the output directory - add_custom_command( - TARGET ${MY_EXE_TARGET} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $ - COMMAND_EXPAND_LISTS - ) - ``` - * where `${MY_EXE_TARGET}` is the name of your executable target. If you know a better way to handle this, please [let us know](https://github.com/ipc-sim/ipc-toolkit/discussions)! - * If you would rather avoid LGPL code entirely, you can disable filib by setting `IPC_TOOLKIT_WITH_FILIB` to `OFF`. With this option disabled, CMake will not download or use any of filib's code. * [rational-cpp](https://github.io/zfergus/rational-cpp): rational arithmetic used for exact intersection checks * Enable by using the CMake option `IPC_TOOLKIT_WITH_RATIONAL_INTERSECTION` * Requires [GMP](https://gmplib.org/) to be installed at a system level @@ -102,6 +91,8 @@ The following dependencies are optionally used based on CMake options: * Included for comparison with the original IPC library * Enable by using the CMake option `IPC_TOOLKIT_WITH_INEXACT_CCD` + + ## Usage See the [tutorial](https://ipctk.xyz/tutorial/getting_started.html) for a quick introduction to the toolkit, or the [documentation](https://ipctk.xyz/cpp.html) for a full reference. diff --git a/docs/source/cpp.rst b/docs/source/cpp.rst index 434e24749..22291d63e 100644 --- a/docs/source/cpp.rst +++ b/docs/source/cpp.rst @@ -29,4 +29,25 @@ C++ .. include:: ../../README.md :parser: myst_parser.sphinx_ :start-after: + :end-before: + +.. warning:: + ``filib`` is licensed under `LGPL-2.1 `_ and as such it is required to be dynamically linked. Doing so automatically is a challenge, so by default we use static linkage. Enabling dynaic linkage requires copying the ``.so``/``.dylib``/``.dll`` file to the binary directory or system path. To enable this, set the CMake option :cmake:`FILIB_BUILD_SHARED_LIBS` to :cmake:`ON` and add this CMake code to copy the shared libaray object to the binary directory: + + .. code-block:: cmake + + # Copy shared lib to the output directory + add_custom_command( + TARGET ${MY_EXE_TARGET} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $ + COMMAND_EXPAND_LISTS + ) + + where ``${MY_EXE_TARGET}`` is the name of your executable target. If you know a better way to handle this, please `let us know `_! + + If you would rather avoid LGPL code entirely, you can disable filib by setting :cmake:`IPC_TOOLKIT_WITH_FILIB` to :cmake:`OFF`. With this option disabled, CMake will not download or use any of filib's code. + +.. include:: ../../README.md + :parser: myst_parser.sphinx_ + :start-after: :end-before: \ No newline at end of file