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

[SofaKernel] Consistent SofaFramework modules #1200

Merged
merged 14 commits into from
Nov 4, 2019
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 4 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ set(Sofa_VERSION_PATCH 99)
set(Sofa_VERSION ${Sofa_VERSION_MAJOR}.${Sofa_VERSION_MINOR}.${Sofa_VERSION_PATCH})

set(SOFA_KERNEL_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/SofaKernel" CACHE STRING "Path to SofaKernel")

if(NOT EXISTS ${SOFA_KERNEL_SOURCE_DIR}/framework)
set(SOFA_KERNEL_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/SofaKernel")
if(NOT EXISTS ${SOFA_KERNEL_SOURCE_DIR}/framework)
message( FATAL_ERROR "SofaKernel is not present or is inaccessible. Check if ${SOFA_KERNEL_SOURCE_DIR} exists or is accessible.")
endif()
if(NOT EXISTS ${SOFA_KERNEL_SOURCE_DIR})
message(WARNING "SofaKernel is not present or is inaccessible. Check if ${SOFA_KERNEL_SOURCE_DIR} exists or is accessible. Backing up to default value.")
set(SOFA_KERNEL_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/SofaKernel" CACHE STRING "Path to SofaKernel" FORCE)
endif()

## Default build type
Expand Down Expand Up @@ -270,7 +267,7 @@ add_subdirectory(modules)

if(SOFA_BUILD_TESTS)
# Tests for all the modules, written using SofaTest.
add_subdirectory(modules/tests)
add_subdirectory(tests)
# SofaPython_test is a special case, because it depends on
# SofaTest, which depends on SofaPython...
if(PLUGIN_SOFAPYTHON)
Expand Down Expand Up @@ -320,17 +317,6 @@ install(FILES "${CMAKE_SOURCE_DIR}/CHANGELOG.md" DESTINATION . COMPONENT applica
install(FILES "${CMAKE_SOURCE_DIR}/LICENSE.LGPL.txt" DESTINATION . COMPONENT applications)
install(FILES "${CMAKE_SOURCE_DIR}/Authors.txt" DESTINATION . COMPONENT applications)

# Create build and install versions of etc/sofa.ini:
# - In build dir, sofa.ini contains absolute paths to distant (in source) share/ and examples/ dirs
# - In install dir, sofa.ini (generated later via installedSofa.ini) contains relative paths to local share/ and examples/ dirs
set(SHARE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/share")
set(EXAMPLES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/examples")
configure_file("${SOFA_KERNEL_SOURCE_DIR}/etc/sofa.ini.in" "${CMAKE_BINARY_DIR}/etc/sofa.ini")
set(SHARE_DIR "../share/sofa")
set(EXAMPLES_DIR "../share/sofa/examples")
configure_file("${SOFA_KERNEL_SOURCE_DIR}/etc/sofa.ini.in" "${CMAKE_BINARY_DIR}/etc/installedSofa.ini")
install(FILES "${CMAKE_BINARY_DIR}/etc/installedSofa.ini" DESTINATION etc RENAME sofa.ini COMPONENT applications)

option(SOFA_INSTALL_RESOURCES_FILES "Copy resources files (etc/, share/, examples/) when installing" ON)
## Install resource files
if(SOFA_INSTALL_RESOURCES_FILES)
Expand Down
140 changes: 0 additions & 140 deletions SofaKernel/CMakeLists.txt

This file was deleted.

25 changes: 10 additions & 15 deletions SofaKernel/SofaFramework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ sofa_set_01(SOFA_WITH_DEPRECATED_COMPONENTS_ VALUE ${SOFA_WITH_DEPRECATED_COMPON
sofa_set_01(SOFA_NO_UPDATE_BBOX_ VALUE ${SOFA_NO_UPDATE_BBOX}) # build_option_bbox.h.in

# Subdirectories
add_subdirectory(../framework/sofa/helper ${CMAKE_CURRENT_BINARY_DIR}/SofaHelper)
add_subdirectory(../framework/sofa/defaulttype ${CMAKE_CURRENT_BINARY_DIR}/SofaDefaultType)
add_subdirectory(../framework/sofa/core ${CMAKE_CURRENT_BINARY_DIR}/SofaCore)
add_subdirectory(../framework/sofa/simulation ${CMAKE_CURRENT_BINARY_DIR}/SofaSimulationCore)
if(SOFA_BUILD_TESTS)
add_subdirectory(../framework/framework_test ${CMAKE_CURRENT_BINARY_DIR}/framework_test)
endif()
add_subdirectory(../modules/SofaHelper ${CMAKE_CURRENT_BINARY_DIR}/SofaHelper)
add_subdirectory(../modules/SofaDefaultType ${CMAKE_CURRENT_BINARY_DIR}/SofaDefaultType)
add_subdirectory(../modules/SofaCore ${CMAKE_CURRENT_BINARY_DIR}/SofaCore)
add_subdirectory(../modules/SofaSimulationCore ${CMAKE_CURRENT_BINARY_DIR}/SofaSimulationCore)

# Generate & install the different files that contains the defines associated with
# the state of the build option.
Expand All @@ -51,20 +48,18 @@ install(FILES "${CMAKE_BINARY_DIR}/include/sofa/config.h" DESTINATION "include/$
set(SOFAFRAMEWORK_VERSION "${Sofa_VERSION}")
set(SOFA_VERSION_STR "\"${Sofa_VERSION}\"")
set(SOFA_VERSION "${Sofa_VERSION_MAJOR}${Sofa_VERSION_MINOR}${Sofa_VERSION_PATCH}")
configure_file(../framework/sofa/version.h.in "${CMAKE_BINARY_DIR}/include/sofa/version.h")
configure_file(version.h.in "${CMAKE_BINARY_DIR}/include/sofa/version.h")
install(FILES "${CMAKE_BINARY_DIR}/include/sofa/version.h" DESTINATION include/${PROJECT_NAME}/sofa COMPONENT headers)

# IDE folder
set_target_properties(SofaHelper PROPERTIES FOLDER "SofaFramework")
set_target_properties(SofaDefaultType PROPERTIES FOLDER "SofaFramework")
set_target_properties(SofaCore PROPERTIES FOLDER "SofaFramework")
set_target_properties(SofaSimulationCore PROPERTIES FOLDER "SofaFramework")

# Package install include directory
set(SOFAFRAMEWORK_TARGETS SofaCore SofaDefaultType SofaHelper)
set(SOFAFRAMEWORK_TARGETS SofaCore SofaDefaultType SofaHelper SofaSimulationCore)
foreach(TARGET ${SOFAFRAMEWORK_TARGETS})
set_target_properties(${TARGET} PROPERTIES FOLDER "SofaFramework") # IDE folder
target_include_directories(${TARGET} PUBLIC "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>")
target_include_directories(${TARGET} PUBLIC "$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
if(SOFA_BUILD_TESTS)
target_compile_options(${TARGET} PUBLIC "-DFRAMEWORK_TEST_RESOURCES_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/resources/tests\"")
endif()
endforeach()

# CMakeParseLibraryList.cmake
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Xsp 3.0
numm 6
nums 5
mass 1 s 0 0 0 0 0 0 0.1 0
mass 2 s 1 0 0 0 0 0 0.1 0
mass 3 s 2 0 0 0 0 0 0.1 0
mass 4 s 3 0 0 0 0 0 0.1 0
mass 5 s 4 0 0 0 0 0 0.1 0
mass 6 s 5 0 0 0 0 0 0.1 0
lspg 1 1 2 100 1 1
lspg 2 2 3 100 1 1
lspg 3 3 4 100 1 1
lspg 4 4 5 100 1 1
lspg 5 5 6 100 1 1
Xsp 3.0
numm 6
nums 5
mass 1 s 0 0 0 0 0 0 0.1 0
mass 2 s 1 0 0 0 0 0 0.1 0
mass 3 s 2 0 0 0 0 0 0.1 0
mass 4 s 3 0 0 0 0 0 0.1 0
mass 5 s 4 0 0 0 0 0 0.1 0
mass 6 s 5 0 0 0 0 0 0.1 0
lspg 1 1 2 100 1 1
lspg 2 2 3 100 1 1
lspg 3 3 4 100 1 1
lspg 4 4 5 100 1 1
lspg 5 5 6 100 1 1
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Xsp 4.0
numm 6
nums 5
mass 1 s 0 0 0 0 0 0 0.1 0
mass 2 s 1 0 0 0 0 0 0.1 0
mass 3 s 2 0 0 0 0 0 0.1 0
mass 4 s 3 0 0 0 0 0 0.1 0
mass 5 s 4 0 0 0 0 0 0.1 0
mass 6 s 5 0 0 0 0 0 0.1 0
lspg 1 1 2 100 1 1 1.1 1.2 1.3
lspg 2 2 3 100 1 1 2.1 2.2 2.3
lspg 3 3 4 100 1 1 3.1 3.2 3.3
lspg 4 4 5 100 1 1 4.1 4.2 4.3
lspg 5 5 6 100 1 1 5.1 5.2 5.3
Xsp 4.0
numm 6
nums 5
mass 1 s 0 0 0 0 0 0 0.1 0
mass 2 s 1 0 0 0 0 0 0.1 0
mass 3 s 2 0 0 0 0 0 0.1 0
mass 4 s 3 0 0 0 0 0 0.1 0
mass 5 s 4 0 0 0 0 0 0.1 0
mass 6 s 5 0 0 0 0 0 0.1 0
lspg 1 1 2 100 1 1 1.1 1.2 1.3
lspg 2 2 3 100 1 1 2.1 2.2 2.3
lspg 3 3 4 100 1 1 3.1 3.2 3.3
lspg 4 4 5 100 1 1 4.1 4.2 4.3
lspg 5 5 6 100 1 1 5.1 5.2 5.3
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
58 changes: 0 additions & 58 deletions SofaKernel/framework/framework_test/CMakeLists.txt

This file was deleted.

This file was deleted.

Loading