Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid installing debug files in packages #152

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ if (CollisionOBBCapsule_FOUND)
endif()

# Config files and install rules for pythons scripts
sofa_install_pythonscripts(PLUGIN_NAME ${PROJECT_NAME} PYTHONSCRIPTS_SOURCE_DIR "python")

find_file(SofaPython3Tools NAMES "SofaPython3/lib/cmake/SofaPython3/SofaPython3Tools.cmake")
if(SofaPython3Tools)
message("-- Found SofaPython3Tools.")
Expand All @@ -122,6 +120,42 @@ if(SofaPython3Tools OR SofaPython3_FOUND)
)
endif()

##############################
#### EXAMPLE INSTALLATION ####
##############################
# Install examples without copying debug files by default except those listed in example_debug_folder_to_install

set(example_debug_folder_to_install "others/caduceus" "others/hexaBeam" "softRobots/finger" "softRobots/sofiaLeg")

set(regex_example_debug_folder_to_install "")
FOREACH(folder ${example_debug_folder_to_install})
if(NOT "${regex_example_debug_folder_to_install}" STREQUAL "")
string(APPEND regex_example_debug_folder_to_install "|")
endif ()
string(APPEND regex_example_debug_folder_to_install ".*/${folder}/reduced/debug/.*")
ENDFOREACH ()

FILE(GLOB_RECURSE all_ressources ${CMAKE_CURRENT_SOURCE_DIR}/examples/*)
FOREACH(file_path ${all_ressources})
if( file_path MATCHES "${regex_example_debug_folder_to_install}" OR NOT file_path MATCHES ".*/debug/.*" )
message(${file_path})
endif ()
if( file_path MATCHES "${regex_example_debug_folder_to_install}" OR NOT file_path MATCHES ".*/debug/.*" )
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/examples/" "" install_file_path "${file_path}")
if( install_file_path MATCHES ".*/.*" )
string(FIND "${install_file_path}" "/" last_slash_idx REVERSE)
string(SUBSTRING "${install_file_path}" 0 ${last_slash_idx} install_file_path)
else()
set(install_file_path "")
endif()
install(FILES "${file_path}"
DESTINATION "share/sofa/examples/ModelOrderReduction/${install_file_path}"
COMPONENT resources)
endif()
ENDFOREACH ()
##############################


# Move all resources when install: examples, doc and python files
install(FILES "README.md" "LICENSE" DESTINATION .)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doc")
Expand All @@ -142,6 +176,7 @@ sofa_create_package_with_targets(
INCLUDE_SOURCE_DIR "src"
INCLUDE_INSTALL_DIR "ModelOrderReduction"
RELOCATABLE "plugins"
NO_AUTO_RESOURCES_INSTALL
)

# If SOFA_BUILD_TESTS exists and is OFF, then these tests will be auto-disabled
Expand Down
4 changes: 2 additions & 2 deletions ModelOrderReduction_test/ModelOrderReduction_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace sofa {
simulation::Simulation* simulation;

/// Create the context for the scene
void SetUp()
void doSetUp() override
{
root = simulation::getSimulation()->createNewGraph("root");
}
Expand All @@ -37,7 +37,7 @@ namespace sofa {
}

/// Unload the scene
void TearDown()
void doTearDown() override
{
if (root != nullptr)
{
Expand Down
Loading