Verified Commit 08f48e07 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

cmake: homogenize

parent a114b2c8
#
#
# Copyright (c) 2015-2021 CNRS INRIA
# Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
#
......@@ -21,14 +21,14 @@ 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})
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)
FUNCTION(LIST_FILTER list regular_expression dest_list)
FOREACH(elt ${list})
FOREACH(elt ${list})
IF(${elt} MATCHES ${regular_expression})
LIST(REMOVE_ITEM list ${elt})
ENDIF()
......@@ -41,12 +41,12 @@ SET(PYWRAP ${PROJECT_NAME}_pywrap)
SET(PYWRAP ${PYWRAP} PARENT_SCOPE)
FILE(GLOB_RECURSE ${PROJECT_NAME}_PYTHON_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp
)
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp
)
FILE(GLOB_RECURSE ${PROJECT_NAME}_PYTHON_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)
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)
......@@ -126,7 +126,7 @@ SET(${PYWRAP}_SOURCES ${${PROJECT_NAME}_PYTHON_SOURCES})
SET(${PYWRAP}_HEADERS ${${PROJECT_NAME}_PYTHON_HEADERS})
IF(BUILD_PYTHON_INTERFACE)
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_DIRS})
ADD_CUSTOM_TARGET(python)
SET_TARGET_PROPERTIES(python PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True)
......@@ -141,7 +141,7 @@ IF(BUILD_PYTHON_INTERFACE)
ENDIF(LINK_PYTHON_INTERFACE_TO_OPENM)
ENDIF(BUILD_WITH_OPENMP_SUPPORT)
ADD_DEPENDENCIES(python ${PYWRAP})
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES PREFIX "") # Remove lib prefix for the target
# Do not report:
......@@ -175,7 +175,7 @@ IF(BUILD_PYTHON_INTERFACE)
ENDIF()
SET_TARGET_PROPERTIES(${PYWRAP}
PROPERTIES
PROPERTIES
PREFIX ""
SUFFIX ${PYTHON_EXT_SUFFIX}
OUTPUT_NAME "${PYWRAP}"
......@@ -187,12 +187,12 @@ IF(BUILD_PYTHON_INTERFACE)
ENDIF()
INSTALL(
TARGETS ${PYWRAP}
TARGETS ${PYWRAP}
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION ${${PYWRAP}_INSTALL_DIR}
)
# --- INSTALL SCRIPTS
# --- INSTALL SCRIPTS
SET(PYTHON_FILES
__init__.py
deprecated.py
......@@ -265,13 +265,12 @@ IF(BUILD_PYTHON_INTERFACE)
SET(DOXYGEN_GENERATE_HTML YES)
SET(DOXYGEN_GENERATE_LATEX NO)
SET(DOXYGEN_PROJECT_NAME "Pinocchio PyBind11 helpers.")
message("DOXYGEN_GENERATE_HTML: ${DOXYGEN_GENERATE_HTML}")
cmake_policy(PUSH)
cmake_policy(SET CMP0054 NEW)
doxygen_add_docs(doc_pybind11
CMAKE_POLICY(PUSH)
CMAKE_POLICY(SET CMP0054 NEW)
DOXYGEN_ADD_DOCS(doc_pybind11
pybind11.hpp pybind11-all.hpp
USE_STAMP_FILE
COMMENT "Generating documentation of the PyBind11 helpers.")
cmake_policy(POP)
CMAKE_POLICY(POP)
ENDIF()
ENDIF(BUILD_PYTHON_INTERFACE)
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