Skip to content

Commit

Permalink
[cmake] Fix add_custom_commands to be compliant with cmake 3.31
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentzell committed Nov 22, 2024
1 parent b246b6e commit dcbaab5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extract_flags(${PROJECT_NAME}_c BUILD_INTERFACE)
separate_arguments(${PROJECT_NAME}_c_CXXFLAGS)
macro(generate_docs header_file)
add_custom_command(
TARGET ${PROJECT_NAME}_docs_cpp2rst
TARGET ${PROJECT_NAME}_docs_cpp2rst POST_BUILD
COMMAND rm -rf ${CMAKE_CURRENT_SOURCE_DIR}/cpp2rst_generated
COMMAND
PYTHONPATH=${CPP2PY_BINARY_DIR}:$ENV{PYTHONPATH}
Expand Down Expand Up @@ -38,7 +38,7 @@ foreach(example ${ExampleList})
add_executable(${PROJECT_NAME}_doc_${f} EXCLUDE_FROM_ALL ${example})
set_property(TARGET ${PROJECT_NAME}_doc_${f} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${d})
target_link_libraries(${PROJECT_NAME}_doc_${f} triqs)
add_custom_command(TARGET ${PROJECT_NAME}_doc_${f}
add_custom_command(TARGET ${PROJECT_NAME}_doc_${f} POST_BUILD
COMMAND ${PROJECT_NAME}_doc_${f} > ${CMAKE_CURRENT_SOURCE_DIR}/${d}/${f}.output 2>/dev/null
WORKING_DIRECTORY ${d}
)
Expand All @@ -55,7 +55,7 @@ endif()
# Sphinx has internal caching, always run it
add_custom_target(${PROJECT_NAME}_docs_sphinx ALL)
add_custom_command(
TARGET ${PROJECT_NAME}_docs_sphinx
TARGET ${PROJECT_NAME}_docs_sphinx POST_BUILD
COMMAND PYTHONPATH=${PROJECT_BINARY_DIR}/python:$ENV{PYTHONPATH} ${SPHINXBUILD_EXECUTABLE} -j auto -c . -b html ${CMAKE_CURRENT_SOURCE_DIR} html
)

Expand Down

0 comments on commit dcbaab5

Please sign in to comment.