Skip to content

Commit

Permalink
Fix build and clean workflow (#5)
Browse files Browse the repository at this point in the history
* Clean workflow

* Merge branch 'v21.06' into clean_workflow

* CLEAN CMakeLists.txt

* [CI] Remove build with SOFA v21.06

master branch is not compatible with SOFA v21.06 anymore
  • Loading branch information
guparan authored and fredroy committed Dec 17, 2021
1 parent 125e3cb commit ebf4fa5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-10.15, windows-2019]
sofa_branch: [v21.12,master]
sofa_branch: [master, v21.12]

steps:
- name: Setup SOFA and environment
Expand All @@ -22,7 +22,7 @@ jobs:
with:
sofa_root: ${{ github.workspace }}/sofa
sofa_version: ${{ matrix.sofa_branch }}
sofa_scope: 'full'
sofa_scope: 'standard'
- name: Checkout source code
uses: actions/checkout@v2
with:
Expand Down
18 changes: 7 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ find_package(SofaFramework REQUIRED)
find_package(SofaBaseMechanics REQUIRED)
find_package(SofaConstraint REQUIRED)
find_package(SofaUserInteraction REQUIRED)
find_package(SofaImplicitField REQUIRED)
find_package(Sofa.GL REQUIRED)

find_package(SofaImplicitField QUIET)
Expand Down Expand Up @@ -51,7 +50,6 @@ set(HEADER_FILES
${BEAMADAPTER_SRC}/component/mapping/MultiAdaptiveBeamMapping.h
${BEAMADAPTER_SRC}/component/mapping/MultiAdaptiveBeamMapping.inl


${BEAMADAPTER_SRC}/utils/deprecatedcomponent.h
)

Expand All @@ -78,9 +76,6 @@ set(SOURCE_FILES
${BEAMADAPTER_SRC}/component/mapping/MultiAdaptiveBeamMapping.cpp
)


set(README_FILE "README.md" )

if(SofaImplicitField_FOUND)
set(HEADER_FILES ${HEADER_FILES}
${BEAMADAPTER_SRC}/component/constraint/ImplicitSurfaceAdaptiveConstraint.h
Expand All @@ -90,7 +85,6 @@ if(SofaImplicitField_FOUND)
set(SOURCE_FILES ${SOURCE_FILES}
${BEAMADAPTER_SRC}/component/constraint/ImplicitSurfaceAdaptiveConstraint.cpp
)

endif()

if(SofaAdvancedConstraint_FOUND)
Expand All @@ -115,15 +109,20 @@ if(SofaAdvancedConstraint_FOUND)
#cuda_add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${CUDA_SOURCES})
endif()


add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES})

set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_BEAMADAPTER")

target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>")
target_include_directories(${PROJECT_NAME} PUBLIC "$<INSTALL_INTERFACE:include>")

target_link_libraries(${PROJECT_NAME} Sofa.Helper Sofa.Core SofaConstraint SofaBaseMechanics SofaUserInteraction SofaImplicitField Sofa.GL)
target_link_libraries(${PROJECT_NAME} Sofa.Helper Sofa.Core SofaConstraint SofaBaseMechanics SofaUserInteraction Sofa.GL)
if(SofaImplicitField_FOUND)
target_link_libraries(${PROJECT_NAME} SofaImplicitField)
endif()
if(SofaAdvancedConstraint_FOUND)
target_link_libraries(${PROJECT_NAME} SofaAdvancedConstraint)
endif()

sofa_create_package_with_targets(
PACKAGE_NAME ${PROJECT_NAME}
Expand All @@ -148,10 +147,7 @@ endif()
#set(LINKER_DEPENDENCIES SofaAdvancedConstraint)
#endif()

#
# Organize projects into folders
#

SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
SET_PROPERTY(TARGET ${PROJECT_NAME} PROPERTY FOLDER "plugins")

Expand Down
18 changes: 9 additions & 9 deletions cmake/environment.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# CMake modules path, for our FindXXX.cmake modules
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}/extlibs)
list(APPEND CMAKE_PREFIX_PATH ${PROJECT_BINARY_DIR})
list(APPEND CMAKE_PREFIX_PATH ${PROJECT_BINARY_DIR}/extlibs)

## Default build type
if(NOT CMAKE_BUILD_TYPE)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Release")
endif()

## Change default install prefix
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install/${PROJECT_NAME} CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
## Force default install prefix
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT "${PROJECT_BINARY_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/install/${PROJECT_NAME}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
endif()
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")

Expand All @@ -23,9 +23,9 @@ if(WIN32)
else()
set(LIBRARY_OUTPUT_DIRECTORY ${ARCHIVE_OUTPUT_DIRECTORY})
endif()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${ARCHIVE_OUTPUT_DIRECTORY})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${RUNTIME_OUTPUT_DIRECTORY})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIBRARY_OUTPUT_DIRECTORY})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${ARCHIVE_OUTPUT_DIRECTORY})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${RUNTIME_OUTPUT_DIRECTORY})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${LIBRARY_OUTPUT_DIRECTORY})

## RPATH
if(UNIX)
Expand Down

0 comments on commit ebf4fa5

Please sign in to comment.