-
Notifications
You must be signed in to change notification settings - Fork 4
[cmake] Simplify cmake files for build-check and non-regression testing #88
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
Changes from 10 commits
a15568e
7509b75
942cfb0
cef93a7
9225bd4
dd54295
033e7e5
54dd8a6
40c2deb
6214846
87c0737
19504be
ec312a3
cd45f8a
3c16631
e042ea6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,54 +3,36 @@ project(CollisionAlgorithm VERSION 0.1 LANGUAGES CXX) | |||||||
|
|
||||||||
| set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) | ||||||||
|
|
||||||||
| file(GLOB_RECURSE HEADER_FILES | ||||||||
| "src/*.h" | ||||||||
| "src/*.inl" | ||||||||
| ) | ||||||||
|
|
||||||||
| file(GLOB_RECURSE SOURCE_FILES | ||||||||
| "src/*.cpp" | ||||||||
| ) | ||||||||
|
|
||||||||
| file(GLOB_RECURSE SCENES_FILES | ||||||||
| "scenes/*.scn" | ||||||||
| "*.xml" | ||||||||
| ) | ||||||||
|
|
||||||||
| file(GLOB_RECURSE IGNORED_FILES | ||||||||
| "ignored/*.h" | ||||||||
| "ignored/*.inl" | ||||||||
| "ignored/*.cpp" | ||||||||
| ) | ||||||||
|
|
||||||||
| file(GLOB_RECURSE DEPRECATED_FILES | ||||||||
| "deprecated/*.h" | ||||||||
| "deprecated/*.inl" | ||||||||
| "deprecated/*.cpp" | ||||||||
| ) | ||||||||
| file(GLOB_RECURSE HEADER_FILES "src/*.h" "src/*.inl") | ||||||||
| file(GLOB_RECURSE SOURCE_FILES "src/*.cpp") | ||||||||
| file(GLOB_RECURSE SCENES_FILES "scenes/*.scn" "*.xml") | ||||||||
| file(GLOB_RECURSE IGNORED_FILES "ignored/*.h" "ignored/*.inl" "ignored/*.cpp") | ||||||||
| file(GLOB_RECURSE DEPRECATED_FILES "deprecated/*.h" "deprecated/*.inl" "deprecated/*.cpp") | ||||||||
|
|
||||||||
| find_package(Sofa.Simulation.Core REQUIRED) | ||||||||
| find_package(Sofa.Component.StateContainer REQUIRED) | ||||||||
| find_package(Sofa.Component.Constraint.Lagrangian.Solver REQUIRED) | ||||||||
| find_package(Sofa.GL REQUIRED) | ||||||||
|
|
||||||||
|
|
||||||||
| include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ignored") | ||||||||
| #include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ignored") | ||||||||
| #include_directories("${CMAKE_CURRENT_SOURCE_DIR}/deprecated") | ||||||||
|
|
||||||||
| set_source_files_properties(${IGNORED_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) | ||||||||
|
|
||||||||
| add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${HEADER_FILES} ${SCENES_FILES} ${IGNORED_FILES} ${DEPRECATED_FILES} ${README_FILES}) | ||||||||
| set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DPLUGIN_DATA_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/\"") | ||||||||
| add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${HEADER_FILES} ${README_FILES}) | ||||||||
|
|
||||||||
| target_link_libraries(${PROJECT_NAME} | ||||||||
| Sofa.Simulation.Core | ||||||||
| Sofa.Component.StateContainer | ||||||||
| Sofa.Component.Constraint.Lagrangian.Solver | ||||||||
| Sofa.GL | ||||||||
| ) | ||||||||
|
|
||||||||
| ## Install rules for the library and headers; CMake package configurations files | ||||||||
| set(${PROJECT_NAME}_INCLUDE_DIRS "include/${PROJECT_NAME}") | ||||||||
| target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>") | ||||||||
| target_include_directories(${PROJECT_NAME} PUBLIC "$<INSTALL_INTERFACE:${${PROJECT_NAME}_INCLUDE_DIRS}>") | ||||||||
| sofa_create_package_with_targets(PACKAGE_NAME ${PROJECT_NAME} PACKAGE_VERSION 0.1 TARGETS ${PROJECT_NAME} INCLUDE_INSTALL_DIR ${${PROJECT_NAME}_INCLUDE_DIRS}) | ||||||||
| sofa_create_package_with_targets( | ||||||||
| PACKAGE_NAME ${PROJECT_NAME} | ||||||||
| PACKAGE_VERSION ${PROJECT_VERSION} | ||||||||
| TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES | ||||||||
| INCLUDE_SOURCE_DIR "src" | ||||||||
| INCLUDE_INSTALL_DIR ${PROJECT_NAME} | ||||||||
| EXAMPLE_INSTALL_DIR "scenes" | ||||||||
| ) | ||||||||
|
||||||||
| ) | |
| RELOCATABLE "plugins" | |
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| #pragma once | ||
|
|
||
| #include <sofa/helper/AdvancedTimer.h> | ||
| #include <sofa/collisionAlgorithm/BaseGeometry.h> | ||
| #include <sofa/collisionAlgorithm/BaseAlgorithm.h> | ||
| #include <sofa/collisionAlgorithm/operations/Project.h> | ||
| #include <sofa/collisionAlgorithm/BaseElement.h> | ||
| #include <CollisionAlgorithm/BaseGeometry.h> | ||
| #include <CollisionAlgorithm/BaseAlgorithm.h> | ||
| #include <CollisionAlgorithm/operations/Project.h> | ||
| #include <CollisionAlgorithm/BaseElement.h> | ||
| #include <thread> | ||
|
|
||
| namespace sofa::collisionAlgorithm { | ||
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #include <CollisionAlgorithm/elements/PointElement.h> | ||
| #include <CollisionAlgorithm/elements/EdgeElement.h> | ||
| #include <CollisionAlgorithm/elements/TriangleElement.h> | ||
| #include <CollisionAlgorithm/elements/TetrahedronElement.h> | ||
| #include <CollisionAlgorithm/proximity/PointProximity.h> | ||
|
|
||
| namespace sofa::collisionAlgorithm { | ||
|
|
||
| PointElement::SPtr PointElement::create(const BaseProximity::SPtr &prox) { | ||
| return PointElement::SPtr(new PointElement(prox)); | ||
| } | ||
|
|
||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not really advised to use GLOB_RECURSE for sources files
https://cmake.org/cmake/help/latest/command/file.html#glob