Add a script in Scripts/developers_scripts thatcheck if there are differencies in the dependencies of packages

This commit is contained in:
Maxime Gimeno 2018-01-29 11:42:36 +01:00
parent d577ee75a1
commit 1dc6a0d66c
3 changed files with 69 additions and 3 deletions

View File

@ -1049,6 +1049,12 @@ Note that this option will modify the source directory!"
${CGAL_ENABLE_CHECK_HEADERS})
if(CGAL_ENABLE_CHECK_HEADERS OR CGAL_COMPUTE_DEPENDENCIES)
option(CGAL_COPY_DEPENDENCIES
"Copy package dependencies in source directories.
Note that this option will modify the source directory!"
FALSE)
if(NOT CMAKE_MAJOR_VERSION GREATER 2)
message(FATAL_ERROR "Your version of CMake is too old.
You must disable CGAL_ENABLE_CHECK_HEADERS and CGAL_COMPUTE_DEPENDENCIES.")
@ -1302,6 +1308,8 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}"
COMMENT "Compute dependencies of ${package}"
COMMAND ${CMAKE_COMMAND}
-DCGAL_PACKAGES_PREFIX=${CGAL_SOURCE_DIR}
-DCGAL_COPY_DEPENDENCIES=${CGAL_COPY_DEPENDENCIES}
-DCGAL_COPY_PATH=${CGAL_SOURCE_DIR}/${package}/dependencies
-DOUTPUT_HEADERS_LIST=${CGAL_BINARY_DIR}/package_info/${package}/included_headers
-DOUTPUT_PACKAGES_LIST=${CGAL_BINARY_DIR}/package_info/${package}/dependencies
-P "${CGAL_MODULES_DIR}/process_dependencies.cmake"
@ -1327,7 +1335,6 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}"
- package_info/<package>/check_headers/ (error messages from \
the headers checks)\n")
message( "== Setting header checking (DONE) ==\n" )
endif()
endif( CGAL_BRANCH_BUILD )

View File

@ -1,4 +1,4 @@
foreach(n RANGE 5 ${CMAKE_ARGC})
foreach(n RANGE 7 ${CMAKE_ARGC})
list(APPEND INPUT_FILES ${CMAKE_ARGV${n}})
endforeach()
@ -43,7 +43,15 @@ if(OUTPUT_HEADERS_LIST)
endif()
if(OUTPUT_PACKAGES_LIST)
file(WRITE ${OUTPUT_PACKAGES_LIST} "")
if (CGAL_COPY_DEPENDENCIES)
file(WRITE ${CGAL_COPY_PATH} "")
endif()
foreach(pkg ${pkgs})
file(APPEND ${OUTPUT_PACKAGES_LIST} "${pkg}\n")
file(APPEND ${CGAL_COPY_PATH} "${pkg}\n")
if (CGAL_COPY_DEPENDENCIES)
file(APPEND package_path/dependencies "${pkg}\n")
endif()
endforeach()
endif()

View File

@ -0,0 +1,51 @@
#This script must be called from the CGAL root.
while test $# -gt 0
do
case "$1" in
--help) echo "Usage: $0 <doxygen_exe_path> "
echo " $0 must be called from the CGAL root directory. It will compile documentation for all packages using doxygen_exe_path, and deduce "
echo "their dependencies. It will then compare them with the previous ones and output 1if the dependencies has changed, "
echo "0 otherwise."
exit 0
;;
--*) echo "bad option $1"
;;
*) DOX_PATH="$1"
;;
esac
shift
done
CGAL_ROOT=$PWD
mkdir -p dep_check_build && cd dep_check_build
for pkg in ../*
do
if [ -f $pkg/dependencies ]; then
echo "$pkg"
mv $pkg/dependencies $pkg/dependencies.old
fi
done
cmake -DCGAL_ENABLE_CHECK_HEADERS=TRUE -DDOXYGEN_EXECUTABLE="$DOX_PATH" -DCGAL_COPY_DEPENDENCIES=TRUE ..
make -j$(nproc --all) packages_dependencies
for pkg in ../*
do
if [ -f $pkg/dependencies ]; then
PKG_DIFF=$(diff -N -w $pkg/dependencies $pkg/dependencies.old)
if [ -n "$PKG_DIFF" ]; then
HAS_DIFF=TRUE
echo "Differences in $pkg: $PKG_DIFF"
fi
rm $pkg/dependencies.old
fi
done
cd $CGAL_ROOT
rm -r dep_check_build
if [ -n "$HAS_DIFF" ]; then
echo " You should run cmake with option CGAL_CHECK_HEADERS ON, make the target packages_dependencies and commit the new dependencies files."
exit 1
else
echo "The dependencies are up to date."
exit 0
fi