Verified Commit 59bef223 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

cmake: clean python project

parent 60a36bd6
......@@ -30,6 +30,16 @@ MACRO(SYMLINK_AND_INSTALL_HEADERS HEADERS SUBPATH)
ENDFOREACH(header)
ENDMACRO(SYMLINK_AND_INSTALL_HEADERS HEADERS SUBPATH)
FUNCTION(REMOVE_PATH_FROM_LIST list_name path_name dest_list)
SET(list_name_)
FOREACH(header ${list_name})
STRING(REGEX REPLACE "${path_name}" "" header ${header})
LIST(APPEND list_name_ ${header})
ENDFOREACH(header ${list_name_})
SET(${dest_list} ${list_name_} PARENT_SCOPE)
ENDFUNCTION(REMOVE_PATH_FROM_LIST)
# --- PYTHON TARGET --- #
ADD_CUSTOM_TARGET(python)
SET_TARGET_PROPERTIES(python PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True)
......@@ -80,12 +90,8 @@ IF(NOT HPP_FCL_FOUND)
)
ENDIF(NOT HPP_FCL_FOUND)
SET(${PROJECT_NAME}_PYTHON_HEADERS_)
FOREACH(header ${${PROJECT_NAME}_PYTHON_HEADERS})
STRING(REGEX REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" header ${header})
LIST(APPEND ${PROJECT_NAME}_PYTHON_HEADERS_ ${header})
ENDFOREACH(header ${${PROJECT_NAME}_PYTHON_HEADERS})
SET(${PROJECT_NAME}_PYTHON_HEADERS ${${PROJECT_NAME}_PYTHON_HEADERS_})
REMOVE_PATH_FROM_LIST("${${PROJECT_NAME}_PYTHON_HEADERS}" "${CMAKE_CURRENT_SOURCE_DIR}/" ${PROJECT_NAME}_PYTHON_HEADERS)
REMOVE_PATH_FROM_LIST("${${PROJECT_NAME}_PYTHON_SOURCES}" "${CMAKE_CURRENT_SOURCE_DIR}/" ${PROJECT_NAME}_PYTHON_SOURCES)
LIST(APPEND HEADERS ${${PROJECT_NAME}_PYTHON_HEADERS})
# Headers of the python binding
......
Markdown is supported
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