diff --git a/.gitignore b/.gitignore index 1d4d2605d..4ee35dbcd 100644 --- a/.gitignore +++ b/.gitignore @@ -491,7 +491,7 @@ CMakeUserPresets.json ## Build -build* +build/ bin* ## IDES @@ -658,6 +658,7 @@ ipctk IPCToolkitOptions.cmake +# Generated HPP files src/ipc/config.hpp tests/src/tests/config.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 755d7a030..7c596eb52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,8 @@ if(IPC_TOOLKIT_WITH_CCACHE AND CCACHE_PROGRAM) endforeach() endif() +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + ################################################################################ # CMake Policies ################################################################################ @@ -53,6 +55,7 @@ cmake_policy(SET CMP0076 NEW) # target_sources() command converts relative paths if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24") cmake_policy(SET CMP0135 NEW) # Set the timestamps of all extracted contents to the time of the extraction. endif() +cmake_policy(SET CMP0114 NEW) # Support the Xcode "new build system" ################################################################################ @@ -64,8 +67,16 @@ project(IPCToolkit include(CheckLanguage) check_language(CUDA) -option(IPC_TOOLKIT_BUILD_TESTS "Build unit-tests" ${IPC_TOOLKIT_TOPLEVEL_PROJECT}) -option(IPC_TOOLKIT_BUILD_PYTHON "Build Python bindings" OFF) +if(IPC_TOOLKIT_TOPLEVEL_PROJECT) + option(IPC_TOOLKIT_BUILD_TESTS "Build unit-tests" ON) + option(IPC_TOOLKIT_BUILD_PYTHON "Build Python bindings" OFF) +else() + # If this is not the top-level project, we don't want to build tests or Python + # bindings. This is useful for projects that use IPC Toolkit as a submodule. + set(IPC_TOOLKIT_BUILD_TESTS OFF CACHE INTERNAL BOOL "Build unit-tests" FORCE) + set(IPC_TOOLKIT_BUILD_PYTHON OFF CACHE INTERNAL BOOL "Build Python bindings" FORCE) +endif() + if(CMAKE_CUDA_COMPILER) option(IPC_TOOLKIT_WITH_CUDA "Enable CUDA CCD" ON) else() @@ -117,13 +128,21 @@ add_library(ipc::toolkit ALIAS ipc_toolkit) # Fill in configuration options configure_file( "${IPC_TOOLKIT_SOURCE_DIR}/config.hpp.in" - "${IPC_TOOLKIT_SOURCE_DIR}/config.hpp") + "${PROJECT_BINARY_DIR}/include/ipc/config.hpp") # Add source and header files to ipc_toolkit add_subdirectory("${IPC_TOOLKIT_SOURCE_DIR}") # Public include directory for IPC Toolkit -target_include_directories(ipc_toolkit PUBLIC "${IPC_TOOLKIT_INCLUDE_DIR}") +target_include_directories(ipc_toolkit PUBLIC + "${IPC_TOOLKIT_INCLUDE_DIR}" # public headers + "${PROJECT_BINARY_DIR}/include" # generated config.hpp +) + +# Folder name for IDE +set_target_properties(ipc_toolkit PROPERTIES FOLDER "SRC") +get_target_property(IPC_TOOLKIT_SOURCES ipc_toolkit SOURCES) +source_group(TREE "${PROJECT_SOURCE_DIR}" FILES ${IPC_TOOLKIT_SOURCES}) ################################################################################ # Dependencies @@ -243,7 +262,7 @@ endif() ################################################################################ # Enable unit testing at the root level -if(IPC_TOOLKIT_TOPLEVEL_PROJECT AND IPC_TOOLKIT_BUILD_TESTS) +if(IPC_TOOLKIT_BUILD_TESTS) include(CTest) enable_testing() add_subdirectory(tests) @@ -270,6 +289,21 @@ endif() # Python bindings ################################################################################ -if(IPC_TOOLKIT_TOPLEVEL_PROJECT AND IPC_TOOLKIT_BUILD_PYTHON) +if(IPC_TOOLKIT_BUILD_PYTHON) add_subdirectory(python) endif() + +################################################################################ +# Xcode +################################################################################ + +if (CMAKE_GENERATOR STREQUAL "Xcode") + set(CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION "${CMAKE_BUILD_TYPE}") + set_target_properties(ipc_toolkit PROPERTIES XCODE_GENERATE_SCHEME ON) + if(IPC_TOOLKIT_BUILD_TESTS) + set_target_properties(ipc_toolkit_tests PROPERTIES XCODE_GENERATE_SCHEME ON) + endif() + if(IPC_TOOLKIT_BUILD_PYTHON) + set_target_properties(ipctk PROPERTIES XCODE_GENERATE_SCHEME ON) + endif() +endif() \ No newline at end of file diff --git a/CMakePresets.json b/CMakePresets.json index b708f87ef..9409f0cde 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -4,8 +4,7 @@ "major": 3, "minor": 18 }, - "configurePresets": [ - { + "configurePresets": [{ "name": "release", "displayName": "Release Build", "description": "Base preset for release builds", @@ -33,11 +32,21 @@ "binaryDir": "${sourceDir}/build/default" }, { - "name": "cuda", + "name": "cuda-release", "inherits": "release", - "displayName": "CUDA Enabled", - "description": "Build with CUDA support", - "binaryDir": "${sourceDir}/build/cuda", + "displayName": "CUDA (Release)", + "description": "Release build with CUDA support", + "binaryDir": "${sourceDir}/build/cuda-release", + "cacheVariables": { + "IPC_TOOLKIT_WITH_CUDA": "ON" + } + }, + { + "name": "cuda-debug", + "inherits": "debug", + "displayName": "CUDA (Debug)", + "description": "Debug build with CUDA support", + "binaryDir": "${sourceDir}/build/cuda-debug", "cacheVariables": { "IPC_TOOLKIT_WITH_CUDA": "ON" } @@ -55,7 +64,7 @@ { "name": "test", "inherits": "debug", - "displayName": "Build for Testing", + "displayName": "Unit Tests", "description": "Build with unit tests enabled", "binaryDir": "${sourceDir}/build/test", "cacheVariables": { @@ -87,54 +96,52 @@ "IPC_TOOLKIT_WITH_CODE_COVERAGE": "ON", "IPC_TOOLKIT_BUILD_TESTS": "ON" } - }, - { - "name": "debug-cuda", - "inherits": [ "debug", "cuda" ], - "displayName": "CUDA Debug", - "description": "Debug build with CUDA support", - "binaryDir": "${sourceDir}/build/debug-cuda" } ], - "buildPresets": [ - { + "buildPresets": [{ "name": "release", "configurePreset": "release", + "displayName": "Release Build", "description": "Base preset for release builds" }, { "name": "debug", "configurePreset": "debug", + "displayName": "Debug Build", "description": "Base preset for debug builds" }, { "name": "default-build", "configurePreset": "default", + "displayName": "Default Configuration", "description": "Build using default configuration" }, { - "name": "cuda-build", - "configurePreset": "cuda", + "name": "cuda-release", + "configurePreset": "cuda-release", + "displayName": "CUDA (Release)", "description": "Build with CUDA support" }, + { + "name": "cuda-debug", + "configurePreset": "cuda-debug", + "displayName": "CUDA (Debug)", + "description": "Debug build with CUDA support" + }, { "name": "test-build", "configurePreset": "test", + "displayName": "Unit Tests", "description": "Build for running tests" }, { "name": "python-build", "configurePreset": "python", + "displayName": "Python Bindings", "description": "Build with Python bindings enabled" - }, - { - "name": "debug-cuda-build", - "configurePreset": "debug-cuda", - "description": "Debug build with CUDA support" } ], - "testPresets": [ - { + "testPresets": [{ "name": "default-tests", "description": "Run default tests", "configurePreset": "test", @@ -143,20 +150,20 @@ } }, { - "name": "cuda-tests", - "description": "Run tests with CUDA enabled", - "configurePreset": "cuda", + "name": "cuda-tests-release", + "description": "Run tests with CUDA (Release) enabled", + "configurePreset": "cuda-release", "execution": { "stopOnFailure": true } }, { - "name": "debug-cuda-tests", - "description": "Run tests with CUDA Debug configuration", - "configurePreset": "debug-cuda", + "name": "cuda-tests-debug", + "description": "Run tests with CUDA (Debug) enabled", + "configurePreset": "cuda-debug", "execution": { "stopOnFailure": true } } ] -} +} \ No newline at end of file diff --git a/cmake/recipes/abseil.cmake b/cmake/recipes/abseil.cmake index 10113ed79..327d0a308 100644 --- a/cmake/recipes/abseil.cmake +++ b/cmake/recipes/abseil.cmake @@ -9,6 +9,7 @@ message(STATUS "Third-party: creating target 'absl::flat_hash_map'") option(ABSL_PROPAGATE_CXX_STD "Use CMake C++ standard meta features (e.g. cxx_std_11) that propagate to targets that link to Abseil" ON) option(ABSL_USE_SYSTEM_INCLUDES "Silence warnings in Abseil headers by marking them as SYSTEM includes" ON) option(ABSL_BUILD_TESTING "If ON, Abseil will build all of Abseil's own tests." OFF) +set(ABSL_IDE_FOLDER "ThirdParty/Abseil") include(CPM) CPMAddPackage("gh:abseil/abseil-cpp#20230125.3") \ No newline at end of file diff --git a/cmake/recipes/catch2.cmake b/cmake/recipes/catch2.cmake index 4efb1cec2..10d0e03c5 100644 --- a/cmake/recipes/catch2.cmake +++ b/cmake/recipes/catch2.cmake @@ -11,4 +11,8 @@ option(CATCH_INSTALL_DOCS "Install documentation alongside library" OFF) option(CATCH_INSTALL_EXTRAS "Install extras alongside library" OFF) include(CPM) -CPMAddPackage("gh:catchorg/Catch2@3.3.2") \ No newline at end of file +CPMAddPackage("gh:catchorg/Catch2@3.8.1") + +# Folder name for IDE +set_target_properties(Catch2 PROPERTIES FOLDER "ThirdParty/Catch2") +set_target_properties(Catch2WithMain PROPERTIES FOLDER "ThirdParty/Catch2") \ No newline at end of file diff --git a/cmake/recipes/evouga_ccd.cmake b/cmake/recipes/evouga_ccd.cmake index 8148b5f73..dbdf03eb8 100644 --- a/cmake/recipes/evouga_ccd.cmake +++ b/cmake/recipes/evouga_ccd.cmake @@ -27,3 +27,6 @@ target_link_libraries(evouga_ccd PUBLIC Eigen3::Eigen) # Turn off floating point contraction for CCD robustness target_compile_options(evouga_ccd PRIVATE "-ffp-contract=off") + +# Folder name for IDE +set_target_properties(evouga_ccd PROPERTIES FOLDER "ThirdParty") \ No newline at end of file diff --git a/cmake/recipes/filib.cmake b/cmake/recipes/filib.cmake index 314276108..c0fa879bd 100644 --- a/cmake/recipes/filib.cmake +++ b/cmake/recipes/filib.cmake @@ -12,4 +12,7 @@ message(STATUS "Third-party: creating target 'filib::filib'") option(FILIB_BUILD_SHARED_LIB "Build shared library" OFF) include(CPM) -CPMAddPackage("gh:zfergus/filib#7cf13519b0db72df2493c9c8997a8bef9e372848") \ No newline at end of file +CPMAddPackage("gh:zfergus/filib#7cf13519b0db72df2493c9c8997a8bef9e372848") + +# Folder name for IDE +set_target_properties(filib PROPERTIES FOLDER "ThirdParty") \ No newline at end of file diff --git a/cmake/recipes/finite_diff.cmake b/cmake/recipes/finite_diff.cmake index be4ba5455..35661aff8 100644 --- a/cmake/recipes/finite_diff.cmake +++ b/cmake/recipes/finite_diff.cmake @@ -7,4 +7,7 @@ endif() message(STATUS "Third-party: creating target 'finitediff::finitediff'") include(CPM) -CPMAddPackage("gh:zfergus/finite-diff@1.0.1") \ No newline at end of file +CPMAddPackage("gh:zfergus/finite-diff@1.0.1") + +# Folder name for IDE +set_target_properties(finitediff_finitediff PROPERTIES FOLDER "ThirdParty") \ No newline at end of file diff --git a/cmake/recipes/libigl.cmake b/cmake/recipes/libigl.cmake index 380500fc6..11046a192 100644 --- a/cmake/recipes/libigl.cmake +++ b/cmake/recipes/libigl.cmake @@ -11,4 +11,9 @@ set(LIBIGL_PREDICATES ON CACHE BOOL "Use exact predicates" FORCE) include(eigen) include(CPM) -CPMAddPackage("gh:libigl/libigl#89267b4a80b1904de3f6f2812a2053e5e9332b7e") \ No newline at end of file +CPMAddPackage("gh:libigl/libigl#89267b4a80b1904de3f6f2812a2053e5e9332b7e") + +# Folder name for IDE +foreach(target_name IN ITEMS core predicates) + set_target_properties(igl_${target_name} PROPERTIES FOLDER "ThirdParty/libigl") +endforeach() diff --git a/cmake/recipes/onetbb.cmake b/cmake/recipes/onetbb.cmake index 850be7f59..171e7b1f1 100644 --- a/cmake/recipes/onetbb.cmake +++ b/cmake/recipes/onetbb.cmake @@ -67,7 +67,7 @@ endif() foreach(name IN ITEMS tbb tbbmalloc tbbmalloc_proxy) if(TARGET ${name}) # Folder name for IDE - set_target_properties(${name} PROPERTIES FOLDER "third_party//tbb") + set_target_properties(${name} PROPERTIES FOLDER "ThirdParty/tbb") # Force debug postfix for library name. Our pre-compiled MKL library expects "tbb12.dll" (without postfix). set_target_properties(${name} PROPERTIES DEBUG_POSTFIX "") diff --git a/cmake/recipes/scalable_ccd.cmake b/cmake/recipes/scalable_ccd.cmake index 331bf14ce..f8152b25a 100644 --- a/cmake/recipes/scalable_ccd.cmake +++ b/cmake/recipes/scalable_ccd.cmake @@ -9,4 +9,7 @@ message(STATUS "Third-party: creating target 'scalable_ccd::scalable_ccd'") set(SCALABLE_CCD_WITH_CUDA ${IPC_TOOLKIT_WITH_CUDA} CACHE BOOL "Enable CUDA CCD" FORCE) include(CPM) -CPMAddPackage("gh:continuous-collision-detection/scalable-ccd#95a078bbaf9659f2e1b4285d51475deff163bfa0") \ No newline at end of file +CPMAddPackage("gh:continuous-collision-detection/scalable-ccd#2c82b9ca43fba30b85f7e9aa83283464b1bb7843") + +# Folder name for IDE +set_target_properties(scalable_ccd PROPERTIES FOLDER "ThirdParty") \ No newline at end of file diff --git a/cmake/recipes/simple_bvh.cmake b/cmake/recipes/simple_bvh.cmake index 21d8910ad..c86439352 100644 --- a/cmake/recipes/simple_bvh.cmake +++ b/cmake/recipes/simple_bvh.cmake @@ -8,4 +8,7 @@ endif() message(STATUS "Third-party: creating target 'simple_bvh::simple_bvh'") include(CPM) -CPMAddPackage("gh:geometryprocessing/SimpleBVH#e1a931337a9e07e8bd2d2e8bbdfd7e54bc850df5") \ No newline at end of file +CPMAddPackage("gh:geometryprocessing/SimpleBVH#e1a931337a9e07e8bd2d2e8bbdfd7e54bc850df5") + +# Folder name for IDE +set_target_properties(simple_bvh PROPERTIES FOLDER "ThirdParty") \ No newline at end of file diff --git a/cmake/recipes/spdlog.cmake b/cmake/recipes/spdlog.cmake index beac4ce3c..29016cd0b 100644 --- a/cmake/recipes/spdlog.cmake +++ b/cmake/recipes/spdlog.cmake @@ -14,7 +14,8 @@ CPMAddPackage("gh:gabime/spdlog@1.11.0") set_target_properties(spdlog PROPERTIES POSITION_INDEPENDENT_CODE ON) -set_target_properties(spdlog PROPERTIES FOLDER external) +# Folder name for IDE +set_target_properties(spdlog PROPERTIES FOLDER "ThirdParty") if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") diff --git a/cmake/recipes/tight_inclusion.cmake b/cmake/recipes/tight_inclusion.cmake index 4d7541f51..fc83441e4 100644 --- a/cmake/recipes/tight_inclusion.cmake +++ b/cmake/recipes/tight_inclusion.cmake @@ -7,4 +7,7 @@ endif() message(STATUS "Third-party: creating target 'tight_inclusion::tight_inclusion'") include(CPM) -CPMAddPackage("gh:Continuous-Collision-Detection/Tight-Inclusion@1.0.5") \ No newline at end of file +CPMAddPackage("gh:Continuous-Collision-Detection/Tight-Inclusion@1.0.5") + +# Folder name for IDE +set_target_properties(tight_inclusion PROPERTIES FOLDER "ThirdParty") \ No newline at end of file diff --git a/docs/source/style_guide.rst b/docs/source/style_guide.rst index 32601e27a..d3e695ad1 100644 --- a/docs/source/style_guide.rst +++ b/docs/source/style_guide.rst @@ -8,6 +8,8 @@ Code Formatting We utilize `ClangFormat `_ to automate code formatting. Please format your code before pushing and/or creating a pull request. +Additionally, ensure that your code adheres to the project's linting rules. Use the provided linting tools to check for any issues before committing your changes. + Naming conventions ------------------ @@ -26,17 +28,17 @@ In general, we stick to the following naming conventions: Specific ^^^^^^^^ -* vertex positions: ``vertices`` or ``positions`` -* vertex displacements: ``displacements`` -* vertex rest positions/material coordinates: ``rest_positions`` -* vertex velocities: ``velocities`` -* mesh edge matrix: ``edges`` -* mesh face matrix: ``faces`` -* element vertices: we use a numeral suffix (e.g., ``e0`` and ``e1`` for the end-points of an edge) -* edge-edge pairings: suffix of ``a`` and ``b`` -* continuous collision detection pairs: suffix of ``_t0`` for starting values and ``_t1`` for end values -* favor the term "collision" over "contact" (but this is not a hard rule) -* we prefer the term "potential" over "constraint" when referring to the collisions and friction +* Vertex positions: ``vertices`` or ``positions`` +* Vertex displacements: ``displacements`` +* Vertex rest positions/material coordinates: ``rest_positions`` +* Vertex velocities: ``velocities`` +* Mesh edge matrix: ``edges`` +* Mesh face matrix: ``faces`` +* Element vertices: Use a numeral suffix (e.g., ``e0`` and ``e1`` for the end-points of an edge). +* Edge-edge pairings: Use suffixes ``a`` and ``b``. +* Continuous collision detection pairs: Use the suffix ``_t0`` for starting values and ``_t1`` for end values. +* Favor the term "collision" over "contact" (but this is not a hard rule). +* Prefer the term "potential" over "constraint" when referring to collisions and friction. Documentation ------------- diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 1c0ce49ed..0d350b613 100755 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -19,4 +19,9 @@ if (FILIB_BUILD_SHARED_LIB AND WIN32) endif() # Extra warnings -# target_link_libraries(ipctk PRIVATE IPCToolkit::warnings) \ No newline at end of file +# target_link_libraries(ipctk PRIVATE IPCToolkit::warnings) + +# Folder name for IDE +set_target_properties(ipctk PROPERTIES FOLDER "SRC") +get_target_property(IPCTK_SOURCES ipctk SOURCES) +source_group(TREE "${PROJECT_SOURCE_DIR}/python" FILES ${IPCTK_SOURCES}) \ No newline at end of file diff --git a/python/src/CMakeLists.txt b/python/src/CMakeLists.txt index 46da2637f..5e8499e29 100644 --- a/python/src/CMakeLists.txt +++ b/python/src/CMakeLists.txt @@ -4,7 +4,6 @@ set(SOURCES ipc.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipctk PRIVATE ${SOURCES}) ################################################################################ diff --git a/python/src/adhesion/CMakeLists.txt b/python/src/adhesion/CMakeLists.txt index d3ffa59a9..c2f44269e 100644 --- a/python/src/adhesion/CMakeLists.txt +++ b/python/src/adhesion/CMakeLists.txt @@ -2,5 +2,4 @@ set(SOURCES adhesion.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipctk PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/python/src/barrier/CMakeLists.txt b/python/src/barrier/CMakeLists.txt index 0024708f4..09da8082e 100644 --- a/python/src/barrier/CMakeLists.txt +++ b/python/src/barrier/CMakeLists.txt @@ -4,5 +4,4 @@ set(SOURCES barrier.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipctk PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/python/src/broad_phase/CMakeLists.txt b/python/src/broad_phase/CMakeLists.txt index 172265fbb..2e5cdd237 100644 --- a/python/src/broad_phase/CMakeLists.txt +++ b/python/src/broad_phase/CMakeLists.txt @@ -10,5 +10,4 @@ set(SOURCES voxel_size_heuristic.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipctk PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/python/src/broad_phase/broad_phase.cpp b/python/src/broad_phase/broad_phase.cpp index ede22b850..8d8630dd7 100644 --- a/python/src/broad_phase/broad_phase.cpp +++ b/python/src/broad_phase/broad_phase.cpp @@ -122,22 +122,6 @@ class PyBroadPhase : public BroadPhase { throw std::runtime_error( "Tried to call pure virtual function \"BroadPhase::detect_face_face_candidates\""); } - - void - detect_collision_candidates(int dim, Candidates& candidates) const override - { - { - py::gil_scoped_acquire - gil; // Acquire GIL before calling Python code - py::function override = - py::get_override(this, "detect_collision_candidates"); - if (override) { - candidates = override(dim).cast(); - return; - } - } - BroadPhase::detect_collision_candidates(dim, candidates); - } }; void define_broad_phase(py::module_& m) diff --git a/python/src/candidates/CMakeLists.txt b/python/src/candidates/CMakeLists.txt index fbb53eb8f..7c821f354 100644 --- a/python/src/candidates/CMakeLists.txt +++ b/python/src/candidates/CMakeLists.txt @@ -9,5 +9,4 @@ set(SOURCES candidates.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipctk PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/python/src/ccd/CMakeLists.txt b/python/src/ccd/CMakeLists.txt index e3c0ee776..a5896e1a6 100644 --- a/python/src/ccd/CMakeLists.txt +++ b/python/src/ccd/CMakeLists.txt @@ -10,5 +10,4 @@ set(SOURCES tight_inclusion_ccd.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipctk PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/python/src/collisions/CMakeLists.txt b/python/src/collisions/CMakeLists.txt index 91e9ce369..ddb36548f 100644 --- a/python/src/collisions/CMakeLists.txt +++ b/python/src/collisions/CMakeLists.txt @@ -1,6 +1,5 @@ # set(SOURCES) -# source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) # target_sources(ipc_toolkit PRIVATE ${SOURCES}) ################################################################################ diff --git a/python/src/collisions/normal/CMakeLists.txt b/python/src/collisions/normal/CMakeLists.txt index 0091951ae..a85de9e1d 100644 --- a/python/src/collisions/normal/CMakeLists.txt +++ b/python/src/collisions/normal/CMakeLists.txt @@ -8,5 +8,4 @@ set(SOURCES vertex_vertex.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipctk PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/python/src/collisions/tangential/CMakeLists.txt b/python/src/collisions/tangential/CMakeLists.txt index d688b6265..652d6fe65 100644 --- a/python/src/collisions/tangential/CMakeLists.txt +++ b/python/src/collisions/tangential/CMakeLists.txt @@ -7,5 +7,4 @@ set(SOURCES vertex_vertex.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipctk PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/python/src/distance/CMakeLists.txt b/python/src/distance/CMakeLists.txt index 8ae040a4b..bf326309b 100644 --- a/python/src/distance/CMakeLists.txt +++ b/python/src/distance/CMakeLists.txt @@ -10,5 +10,4 @@ set(SOURCES point_triangle.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipctk PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/python/src/friction/CMakeLists.txt b/python/src/friction/CMakeLists.txt index 29d58de86..c81476d0e 100644 --- a/python/src/friction/CMakeLists.txt +++ b/python/src/friction/CMakeLists.txt @@ -2,5 +2,4 @@ set(SOURCES smooth_friction_mollifier.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipctk PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/python/src/implicits/CMakeLists.txt b/python/src/implicits/CMakeLists.txt index a0dcdfe33..fb4526ff5 100644 --- a/python/src/implicits/CMakeLists.txt +++ b/python/src/implicits/CMakeLists.txt @@ -2,5 +2,4 @@ set(SOURCES plane.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipctk PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/python/src/potentials/CMakeLists.txt b/python/src/potentials/CMakeLists.txt index cfabcab0f..4b68dd365 100644 --- a/python/src/potentials/CMakeLists.txt +++ b/python/src/potentials/CMakeLists.txt @@ -7,5 +7,4 @@ set(SOURCES tangential_potential.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipctk PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/python/src/tangent/CMakeLists.txt b/python/src/tangent/CMakeLists.txt index d547aaca1..43be9531b 100644 --- a/python/src/tangent/CMakeLists.txt +++ b/python/src/tangent/CMakeLists.txt @@ -4,5 +4,4 @@ set(SOURCES tangent_basis.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipctk PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/python/src/utils/CMakeLists.txt b/python/src/utils/CMakeLists.txt index 4e0082a0d..9032db4aa 100644 --- a/python/src/utils/CMakeLists.txt +++ b/python/src/utils/CMakeLists.txt @@ -9,5 +9,4 @@ set(SOURCES world_bbox_diagonal_length.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipctk PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/src/ipc/CMakeLists.txt b/src/ipc/CMakeLists.txt index 49848448e..a16cca530 100644 --- a/src/ipc/CMakeLists.txt +++ b/src/ipc/CMakeLists.txt @@ -1,12 +1,10 @@ set(SOURCES collision_mesh.cpp collision_mesh.hpp - config.hpp ipc.hpp ipc.cpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit PRIVATE ${SOURCES}) ################################################################################ diff --git a/src/ipc/adhesion/CMakeLists.txt b/src/ipc/adhesion/CMakeLists.txt index 9cfdd8d04..c361c68b6 100644 --- a/src/ipc/adhesion/CMakeLists.txt +++ b/src/ipc/adhesion/CMakeLists.txt @@ -3,5 +3,4 @@ set(SOURCES adhesion.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) -target_sources(ipc_toolkit PRIVATE ${SOURCES}) +target_sources(ipc_toolkit PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/src/ipc/barrier/CMakeLists.txt b/src/ipc/barrier/CMakeLists.txt index 472967ebe..70f573cca 100644 --- a/src/ipc/barrier/CMakeLists.txt +++ b/src/ipc/barrier/CMakeLists.txt @@ -7,5 +7,4 @@ set(SOURCES barrier.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/src/ipc/broad_phase/CMakeLists.txt b/src/ipc/broad_phase/CMakeLists.txt index 2f8033fda..8fe5a051d 100644 --- a/src/ipc/broad_phase/CMakeLists.txt +++ b/src/ipc/broad_phase/CMakeLists.txt @@ -20,5 +20,4 @@ set(SOURCES voxel_size_heuristic.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/src/ipc/broad_phase/broad_phase.hpp b/src/ipc/broad_phase/broad_phase.hpp index f4abe2a9f..50cd91405 100644 --- a/src/ipc/broad_phase/broad_phase.hpp +++ b/src/ipc/broad_phase/broad_phase.hpp @@ -50,6 +50,11 @@ class BroadPhase { /// @brief Clear any built data. virtual void clear(); + /// @brief Detect all collision candidates needed for a given dimensional simulation. + /// @param dim The dimension of the simulation (i.e., 2 or 3). + /// @param candidates The detected collision candidates. + void detect_collision_candidates(int dim, Candidates& candidates) const; + /// @brief Find the candidate vertex-vertex collisions. /// @param[out] candidates The candidate vertex-vertex collisions. virtual void detect_vertex_vertex_candidates( @@ -80,12 +85,6 @@ class BroadPhase { virtual void detect_face_face_candidates( std::vector& candidates) const = 0; - /// @brief Detect all collision candidates needed for a given dimensional simulation. - /// @param dim The dimension of the simulation (i.e., 2 or 3). - /// @param candidates The detected collision candidates. - virtual void - detect_collision_candidates(int dim, Candidates& candidates) const; - /// @brief Function for determining if two vertices can collide. std::function can_vertices_collide = default_can_vertices_collide; diff --git a/src/ipc/broad_phase/bvh.cpp b/src/ipc/broad_phase/bvh.cpp index fc8ca6162..1e872374c 100644 --- a/src/ipc/broad_phase/bvh.cpp +++ b/src/ipc/broad_phase/bvh.cpp @@ -37,8 +37,9 @@ void BVH::build( void BVH::init_bvh(const std::vector& boxes, SimpleBVH::BVH& bvh) { - if (boxes.size() == 0) + if (boxes.size() == 0) { return; + } std::vector> vector_boxes(boxes.size()); for (int i = 0; i < boxes.size(); i++) { diff --git a/src/ipc/broad_phase/sweep_and_tiniest_queue.cpp b/src/ipc/broad_phase/sweep_and_tiniest_queue.cpp index 30e3053ff..be37c26fc 100644 --- a/src/ipc/broad_phase/sweep_and_tiniest_queue.cpp +++ b/src/ipc/broad_phase/sweep_and_tiniest_queue.cpp @@ -17,15 +17,8 @@ void SweepAndTiniestQueue::build( clear(); - // Mutable copy of the vertices - Eigen::MatrixXd vertices = _vertices; - // Make sure the vertices are 3D - if (vertices.cols() < 3) { - const int dim = vertices.cols(); - vertices.conservativeResize(Eigen::NoChange, 3); - vertices.rightCols(3 - dim).setZero(); - } + const Eigen::MatrixXd vertices = to_X3d(_vertices); scalable_ccd::cuda::build_vertex_boxes( vertices, vertex_boxes, inflation_radius); @@ -48,17 +41,8 @@ void SweepAndTiniestQueue::build( clear(); // Mutable copies of the vertices - Eigen::MatrixXd vertices_t0 = _vertices_t0; - Eigen::MatrixXd vertices_t1 = _vertices_t1; - - // Make sure the vertices are 3D - if (vertices_t0.cols() < 3) { - const int dim = vertices_t0.cols(); - vertices_t0.conservativeResize(Eigen::NoChange, 3); - vertices_t1.conservativeResize(Eigen::NoChange, 3); - vertices_t0.rightCols(3 - dim).setZero(); - vertices_t1.rightCols(3 - dim).setZero(); - } + const Eigen::MatrixXd vertices_t0 = to_X3d(_vertices_t0); + const Eigen::MatrixXd vertices_t1 = to_X3d(_vertices_t1); scalable_ccd::cuda::build_vertex_boxes( vertices_t0, vertices_t1, vertex_boxes, inflation_radius); diff --git a/src/ipc/candidates/CMakeLists.txt b/src/ipc/candidates/CMakeLists.txt index f314e397e..f7efceb30 100644 --- a/src/ipc/candidates/CMakeLists.txt +++ b/src/ipc/candidates/CMakeLists.txt @@ -19,5 +19,4 @@ set(SOURCES vertex_vertex.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/src/ipc/ccd/CMakeLists.txt b/src/ipc/ccd/CMakeLists.txt index aa19e32ef..619dba116 100644 --- a/src/ipc/ccd/CMakeLists.txt +++ b/src/ipc/ccd/CMakeLists.txt @@ -18,5 +18,4 @@ set(SOURCES tight_inclusion_ccd.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/src/ipc/collisions/CMakeLists.txt b/src/ipc/collisions/CMakeLists.txt index 91e9ce369..ddb36548f 100644 --- a/src/ipc/collisions/CMakeLists.txt +++ b/src/ipc/collisions/CMakeLists.txt @@ -1,6 +1,5 @@ # set(SOURCES) -# source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) # target_sources(ipc_toolkit PRIVATE ${SOURCES}) ################################################################################ diff --git a/src/ipc/collisions/normal/CMakeLists.txt b/src/ipc/collisions/normal/CMakeLists.txt index 31cd06dad..98ea4c0fe 100644 --- a/src/ipc/collisions/normal/CMakeLists.txt +++ b/src/ipc/collisions/normal/CMakeLists.txt @@ -14,5 +14,4 @@ set(SOURCES vertex_vertex.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/src/ipc/collisions/tangential/CMakeLists.txt b/src/ipc/collisions/tangential/CMakeLists.txt index 20b93a9f9..3f5ac3b88 100644 --- a/src/ipc/collisions/tangential/CMakeLists.txt +++ b/src/ipc/collisions/tangential/CMakeLists.txt @@ -13,5 +13,4 @@ set(SOURCES vertex_vertex.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/src/ipc/distance/CMakeLists.txt b/src/ipc/distance/CMakeLists.txt index b580ad50c..dc2a541b4 100644 --- a/src/ipc/distance/CMakeLists.txt +++ b/src/ipc/distance/CMakeLists.txt @@ -19,5 +19,4 @@ set(SOURCES point_triangle.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/src/ipc/friction/CMakeLists.txt b/src/ipc/friction/CMakeLists.txt index 23dd74f4d..c48f84f73 100644 --- a/src/ipc/friction/CMakeLists.txt +++ b/src/ipc/friction/CMakeLists.txt @@ -3,5 +3,4 @@ set(SOURCES smooth_friction_mollifier.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/src/ipc/implicits/CMakeLists.txt b/src/ipc/implicits/CMakeLists.txt index 41d2047fe..c210df385 100644 --- a/src/ipc/implicits/CMakeLists.txt +++ b/src/ipc/implicits/CMakeLists.txt @@ -3,5 +3,4 @@ set(SOURCES plane.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/src/ipc/potentials/CMakeLists.txt b/src/ipc/potentials/CMakeLists.txt index 4b660dcfa..350d9055c 100644 --- a/src/ipc/potentials/CMakeLists.txt +++ b/src/ipc/potentials/CMakeLists.txt @@ -15,5 +15,4 @@ set(SOURCES tangential_potential.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/src/ipc/tangent/CMakeLists.txt b/src/ipc/tangent/CMakeLists.txt index 2fa6b609d..bdd862fa1 100644 --- a/src/ipc/tangent/CMakeLists.txt +++ b/src/ipc/tangent/CMakeLists.txt @@ -7,7 +7,6 @@ set(SOURCES tangent_basis.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit PRIVATE ${SOURCES}) ################################################################################ diff --git a/src/ipc/utils/CMakeLists.txt b/src/ipc/utils/CMakeLists.txt index 68d98b273..ce09c59a0 100644 --- a/src/ipc/utils/CMakeLists.txt +++ b/src/ipc/utils/CMakeLists.txt @@ -20,5 +20,4 @@ set(SOURCES world_bbox_diagonal_length.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit PRIVATE ${SOURCES}) \ No newline at end of file diff --git a/src/ipc/utils/eigen_ext.hpp b/src/ipc/utils/eigen_ext.hpp index 3c7659a70..5bedf8083 100644 --- a/src/ipc/utils/eigen_ext.hpp +++ b/src/ipc/utils/eigen_ext.hpp @@ -181,6 +181,28 @@ inline Eigen::Vector3d to_3D(Eigen::ConstRef v) return v.size() == 2 ? Eigen::Vector3d(v.x(), v.y(), 0) : v.head<3>(); } +// TODO: Change return type to Eigen::MatrixX3f +inline Eigen::MatrixXf to_X3f(Eigen::ConstRef vertices) +{ + Eigen::MatrixXf vertices_3f(vertices.rows(), 3); + vertices_3f.leftCols(vertices.cols()) = vertices.cast(); + if (vertices.cols() < 3) { + vertices_3f.rightCols(3 - vertices.cols()).setZero(); + } + return vertices_3f; +} + +// TODO: Change return type to Eigen::MatrixX3d +inline Eigen::MatrixXd to_X3d(Eigen::ConstRef vertices) +{ + Eigen::MatrixXd vertices_3d(vertices.rows(), 3); + vertices_3d.leftCols(vertices.cols()) = vertices; + if (vertices.cols() < 3) { + vertices_3d.rightCols(3 - vertices.cols()).setZero(); + } + return vertices_3d; +} + /// Eigen IO Format to format vectors like vertex rows in an OBJ file. static const Eigen::IOFormat OBJ_VERTEX_FORMAT = Eigen::IOFormat( Eigen::FullPrecision, Eigen::DontAlignCols, " ", "", "v ", "\n", "", ""); diff --git a/src/ipc/utils/logger.cpp b/src/ipc/utils/logger.cpp index 24624fa39..4bd36d340 100644 --- a/src/ipc/utils/logger.cpp +++ b/src/ipc/utils/logger.cpp @@ -38,4 +38,10 @@ void set_logger(std::shared_ptr x) get_shared_logger() = std::move(x); } +void log_and_throw_error(const std::string& msg) +{ + logger().error(msg); + throw std::runtime_error(msg); +} + } // namespace ipc diff --git a/src/ipc/utils/logger.hpp b/src/ipc/utils/logger.hpp index 252d64206..f7507f268 100644 --- a/src/ipc/utils/logger.hpp +++ b/src/ipc/utils/logger.hpp @@ -17,4 +17,13 @@ spdlog::logger& logger(); /// @param logger New logger object to be used. void set_logger(std::shared_ptr logger); +[[noreturn]] void log_and_throw_error(const std::string& msg); + +template +[[noreturn]] void +log_and_throw_error(const std::string& msg, const Args&... args) +{ + log_and_throw_error(fmt::format(msg, args...)); +} + } // namespace ipc diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 14620cf28..6e289d749 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -35,26 +35,42 @@ configure_file( add_subdirectory("${IPC_TOOLKIT_TESTS_SOURCE_DIR}") # Public include directory for IPC Toolkit tests -target_include_directories(ipc_toolkit_tests PUBLIC "${IPC_TOOLKIT_TESTS_INCLUDE_DIR}") +target_include_directories(ipc_toolkit_tests PRIVATE "${IPC_TOOLKIT_TESTS_INCLUDE_DIR}") + +# Folder name for IDE +set_target_properties(ipc_toolkit_tests PROPERTIES FOLDER "SRC") +get_target_property(IPC_TOOLKIT_TESTS_SOURCES ipc_toolkit_tests SOURCES) +source_group(TREE "${PROJECT_SOURCE_DIR}/tests" FILES ${IPC_TOOLKIT_TESTS_SOURCES}) ################################################################################ # Required Libraries ################################################################################ -target_link_libraries(ipc_toolkit_tests PUBLIC ipc::toolkit) +target_link_libraries(ipc_toolkit_tests PRIVATE ipc::toolkit) include(catch2) -target_link_libraries(ipc_toolkit_tests PUBLIC Catch2::Catch2) +target_link_libraries(ipc_toolkit_tests PRIVATE Catch2::Catch2) include(finite_diff) -target_link_libraries(ipc_toolkit_tests PUBLIC finitediff::finitediff) +target_link_libraries(ipc_toolkit_tests PRIVATE finitediff::finitediff) include(json) -target_link_libraries(ipc_toolkit_tests PUBLIC nlohmann_json::nlohmann_json) +target_link_libraries(ipc_toolkit_tests PRIVATE nlohmann_json::nlohmann_json) + +if(IPC_TOOLKIT_WITH_CUDA) + # We need to explicitly state that we need all CUDA files in the particle + # library to be built with -dc as the member functions could be called by + # other libraries and executables. + set_target_properties(ipc_toolkit_tests PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + + # Use the same CUDA architectures Scalable CCD + # get_target_property(CMAKE_CUDA_ARCHITECTURES scalable_ccd CUDA_ARCHITECTURES) + set_target_properties(ipc_toolkit_tests PROPERTIES CUDA_ARCHITECTURES "native") +endif() if (IPC_TOOLKIT_TESTS_CCD_BENCHMARK) include(ccd_query_io) - target_link_libraries(ipc_toolkit_tests PUBLIC ccd_io::ccd_io) + target_link_libraries(ipc_toolkit_tests PRIVATE ccd_io::ccd_io) if(NOT (IPC_TOOLKIT_CCD_BENCHMARK_DIR STREQUAL "")) message(STATUS "Using CCD benchmark directory: ${IPC_TOOLKIT_CCD_BENCHMARK_DIR}") endif() @@ -71,7 +87,7 @@ target_link_libraries(ipc_toolkit_tests PRIVATE ipc::toolkit::warnings) # Compiler options ################################################################################ -target_compile_definitions(ipc_toolkit_tests PUBLIC CATCH_CONFIG_ENABLE_BENCHMARKING) +target_compile_definitions(ipc_toolkit_tests PRIVATE CATCH_CONFIG_ENABLE_BENCHMARKING) if (FILIB_BUILD_SHARED_LIB AND WIN32) # Copy DLLs to the output directory @@ -92,4 +108,10 @@ include(Catch) # Register tests set(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS ON) -catch_discover_tests(ipc_toolkit_tests) \ No newline at end of file +if(CMAKE_GENERATOR STREQUAL "Xcode") + # https://github.com/catchorg/Catch2/issues/2411 + # Requires adding `-C Release` to `ctest` command + catch_discover_tests(ipc_toolkit_tests DISCOVERY_MODE PRE_TEST) +else() + catch_discover_tests(ipc_toolkit_tests) +endif() \ No newline at end of file diff --git a/tests/src/tests/CMakeLists.txt b/tests/src/tests/CMakeLists.txt index 7a167937e..2d49cfc53 100644 --- a/tests/src/tests/CMakeLists.txt +++ b/tests/src/tests/CMakeLists.txt @@ -16,7 +16,6 @@ set(SOURCES utils.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit_tests PRIVATE ${SOURCES}) ################################################################################ diff --git a/tests/src/tests/adhesion/CMakeLists.txt b/tests/src/tests/adhesion/CMakeLists.txt index 6f2d8a0cd..8a4d34f38 100644 --- a/tests/src/tests/adhesion/CMakeLists.txt +++ b/tests/src/tests/adhesion/CMakeLists.txt @@ -7,7 +7,6 @@ set(SOURCES # Utilities ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit_tests PRIVATE ${SOURCES}) ################################################################################ diff --git a/tests/src/tests/adhesion/test_adhesion.cpp b/tests/src/tests/adhesion/test_adhesion.cpp index 43953cd8f..39d5a2667 100644 --- a/tests/src/tests/adhesion/test_adhesion.cpp +++ b/tests/src/tests/adhesion/test_adhesion.cpp @@ -45,9 +45,9 @@ TEST_CASE("Normal adhesion derivatives", "[adhesion][normal]") Eigen::VectorXd fgrad(1); fd::finite_gradient( d_vec, - [&](const Eigen::VectorXd& d) { - REQUIRE(d[0] >= 0); - return normal_adhesion_potential(d[0], dhat_p, dhat_a, a2); + [&](const Eigen::VectorXd& _d) { + REQUIRE(_d[0] >= 0); + return normal_adhesion_potential(_d[0], dhat_p, dhat_a, a2); }, fgrad); @@ -65,10 +65,10 @@ TEST_CASE("Normal adhesion derivatives", "[adhesion][normal]") fd::finite_gradient( d_vec, - [&](const Eigen::VectorXd& d) { - REQUIRE(d[0] >= 0); + [&](const Eigen::VectorXd& _d) { + REQUIRE(_d[0] >= 0); return normal_adhesion_potential_first_derivative( - d[0], dhat_p, dhat_a, a2); + _d[0], dhat_p, dhat_a, a2); }, fgrad); diff --git a/tests/src/tests/barrier/CMakeLists.txt b/tests/src/tests/barrier/CMakeLists.txt index 3d98af90a..002031f61 100644 --- a/tests/src/tests/barrier/CMakeLists.txt +++ b/tests/src/tests/barrier/CMakeLists.txt @@ -8,7 +8,6 @@ set(SOURCES # Utilities ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit_tests PRIVATE ${SOURCES}) ################################################################################ diff --git a/tests/src/tests/broad_phase/CMakeLists.txt b/tests/src/tests/broad_phase/CMakeLists.txt index fd819d795..602b7947f 100644 --- a/tests/src/tests/broad_phase/CMakeLists.txt +++ b/tests/src/tests/broad_phase/CMakeLists.txt @@ -14,7 +14,6 @@ set(SOURCES brute_force_comparison.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit_tests PRIVATE ${SOURCES}) ################################################################################ diff --git a/tests/src/tests/candidates/CMakeLists.txt b/tests/src/tests/candidates/CMakeLists.txt index 8c3f5a90b..57dc9dbc5 100644 --- a/tests/src/tests/candidates/CMakeLists.txt +++ b/tests/src/tests/candidates/CMakeLists.txt @@ -8,7 +8,6 @@ set(SOURCES # Utilities ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit_tests PRIVATE ${SOURCES}) ################################################################################ diff --git a/tests/src/tests/ccd/CMakeLists.txt b/tests/src/tests/ccd/CMakeLists.txt index 6b71fbfba..0a4ba1cd2 100644 --- a/tests/src/tests/ccd/CMakeLists.txt +++ b/tests/src/tests/ccd/CMakeLists.txt @@ -17,7 +17,6 @@ set(SOURCES collision_generator.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit_tests PRIVATE ${SOURCES}) ################################################################################ diff --git a/tests/src/tests/collisions/CMakeLists.txt b/tests/src/tests/collisions/CMakeLists.txt index ed096e08e..56b054e6f 100644 --- a/tests/src/tests/collisions/CMakeLists.txt +++ b/tests/src/tests/collisions/CMakeLists.txt @@ -7,7 +7,6 @@ set(SOURCES # Utilities ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit_tests PRIVATE ${SOURCES}) ################################################################################ diff --git a/tests/src/tests/distance/CMakeLists.txt b/tests/src/tests/distance/CMakeLists.txt index 4b32635a5..9fc0f584f 100644 --- a/tests/src/tests/distance/CMakeLists.txt +++ b/tests/src/tests/distance/CMakeLists.txt @@ -15,7 +15,6 @@ set(SOURCES # Utilities ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit_tests PRIVATE ${SOURCES}) ################################################################################ diff --git a/tests/src/tests/friction/CMakeLists.txt b/tests/src/tests/friction/CMakeLists.txt index 5eb6714ab..96bb01b64 100644 --- a/tests/src/tests/friction/CMakeLists.txt +++ b/tests/src/tests/friction/CMakeLists.txt @@ -11,7 +11,6 @@ set(SOURCES friction_data_generator.hpp ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit_tests PRIVATE ${SOURCES}) ################################################################################ diff --git a/tests/src/tests/potential/CMakeLists.txt b/tests/src/tests/potential/CMakeLists.txt index 2ab0db431..99d291bbf 100644 --- a/tests/src/tests/potential/CMakeLists.txt +++ b/tests/src/tests/potential/CMakeLists.txt @@ -9,7 +9,6 @@ set(SOURCES # Utilities ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit_tests PRIVATE ${SOURCES}) ################################################################################ diff --git a/tests/src/tests/tangent/CMakeLists.txt b/tests/src/tests/tangent/CMakeLists.txt index 2ab3fc9b7..32a642309 100644 --- a/tests/src/tests/tangent/CMakeLists.txt +++ b/tests/src/tests/tangent/CMakeLists.txt @@ -9,7 +9,6 @@ set(SOURCES # Utilities ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit_tests PRIVATE ${SOURCES}) ################################################################################ diff --git a/tests/src/tests/utils/CMakeLists.txt b/tests/src/tests/utils/CMakeLists.txt index 2175e0184..0d0352934 100644 --- a/tests/src/tests/utils/CMakeLists.txt +++ b/tests/src/tests/utils/CMakeLists.txt @@ -8,7 +8,6 @@ set(SOURCES # Utilities ) -source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES}) target_sources(ipc_toolkit_tests PRIVATE ${SOURCES}) ################################################################################