Verified Commit 492b22ce authored by Justin Carpentier's avatar Justin Carpentier
Browse files

cmake: fix missing FILTER option for LIST for old CMake versions

parent d334fa57
Pipeline #13903 failed with stage
in 50 minutes and 31 seconds
#
# Copyright (c) 2015-2020 CNRS INRIA
# Copyright (c) 2015-2021 CNRS INRIA
# Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
#
......@@ -27,6 +27,15 @@ FUNCTION(REMOVE_PATH_FROM_LIST list_name path_name dest_list)
SET(${dest_list} ${list_name_} PARENT_SCOPE)
ENDFUNCTION(REMOVE_PATH_FROM_LIST)
FUNCTION(LIST_FILTER list regular_expression dest_list)
FOREACH(elt ${list})
IF(${elt} MATCHES ${regular_expression})
LIST(REMOVE_ITEM ${list} ${elt})
ENDIF()
ENDFOREACH(elt ${list})
SET(${dest_list} ${list} PARENT_SCOPE)
ENDFUNCTION(LIST_FILTER)
# --- PYTHON TARGET --- #
SET(PYWRAP ${PROJECT_NAME}_pywrap)
SET(PYWRAP ${PYWRAP} PARENT_SCOPE)
......@@ -65,18 +74,23 @@ IF(NOT BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)
ENDIF(NOT BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)
IF(NOT BUILD_WITH_OPENMP_SUPPORT)
LIST(FILTER ${PROJECT_NAME}_PYTHON_HEADERS EXCLUDE REGEX "^multibody/pool")
LIST(FILTER ${PROJECT_NAME}_PYTHON_SOURCES EXCLUDE REGEX "^multibody/pool")
LIST(FILTER ${PROJECT_NAME}_PYTHON_HEADERS EXCLUDE REGEX "^algorithm/parallel")
LIST(FILTER ${PROJECT_NAME}_PYTHON_SOURCES EXCLUDE REGEX "^algorithm/parallel")
LIST_FILTER("${${PROJECT_NAME}_PYTHON_HEADERS}" "^multibody/pool" ${PROJECT_NAME}_PYTHON_HEADERS)
LIST_FILTER("${${PROJECT_NAME}_PYTHON_SOURCES}" "^multibody/pool" ${PROJECT_NAME}_PYTHON_SOURCES)
LIST_FILTER("${${PROJECT_NAME}_PYTHON_HEADERS}" "^algorithm/parallel" ${PROJECT_NAME}_PYTHON_HEADERS)
LIST_FILTER("${${PROJECT_NAME}_PYTHON_SOURCES}" "^algorithm/parallel" ${PROJECT_NAME}_PYTHON_SOURCES)
#LIST(FILTER ${PROJECT_NAME}_PYTHON_HEADERS EXCLUDE REGEX "^multibody/pool")
#LIST(FILTER ${PROJECT_NAME}_PYTHON_SOURCES EXCLUDE REGEX "^multibody/pool")
#LIST(FILTER ${PROJECT_NAME}_PYTHON_HEADERS EXCLUDE REGEX "^algorithm/parallel")
#LIST(FILTER ${PROJECT_NAME}_PYTHON_SOURCES EXCLUDE REGEX "^algorithm/parallel")
ELSE(NOT BUILD_WITH_OPENMP_SUPPORT)
IF(NOT BUILD_WITH_HPP_FCL_SUPPORT)
LIST(FILTER ${PROJECT_NAME}_PYTHON_HEADERS EXCLUDE REGEX "^multibody/pool/geometry.hpp")
LIST(FILTER ${PROJECT_NAME}_PYTHON_SOURCES EXCLUDE REGEX "^algorithm/parallel/geometry.cpp")
LIST_FILTER("${${PROJECT_NAME}_PYTHON_HEADERS}" "^multibody/pool/geometry.hpp" ${PROJECT_NAME}_PYTHON_HEADERS)
LIST_FILTER("${${PROJECT_NAME}_PYTHON_SOURCES}" "^algorithm/parallel/geometry.hpp" ${PROJECT_NAME}_PYTHON_SOURCES)
#LIST(FILTER ${PROJECT_NAME}_PYTHON_HEADERS EXCLUDE REGEX "^multibody/pool/geometry.hpp")
#LIST(FILTER ${PROJECT_NAME}_PYTHON_SOURCES EXCLUDE REGEX "^algorithm/parallel/geometry.cpp")
ENDIF(NOT BUILD_WITH_HPP_FCL_SUPPORT)
ENDIF(NOT BUILD_WITH_OPENMP_SUPPORT)
LIST(APPEND HEADERS ${${PROJECT_NAME}_PYTHON_HEADERS})
# Headers of the Python bindings
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment