From 50bd81b03197275f2ef3f0d29ad986d089a58575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 15 Feb 2018 11:10:23 +0100 Subject: [PATCH] correctly generate cgal_test_with_cmake --- .../cgal_create_release_with_cmake.cmake | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake b/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake index bbb8f6051c8..88430047f45 100644 --- a/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake +++ b/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake @@ -127,14 +127,22 @@ if (CGAL_VERSION_NR) endif() file(WRITE ${release_dir}/include/CGAL/version.h "${file_content}") - -#make an additional copy for demos and examples for the testsuite +# make an extra copy of examples and demos for the testsuite and generate +# create_cgal_test_with_cmake for tests, demos, and examples if (TESTSUITE) file(GLOB tests RELATIVE "${release_dir}/test" "${release_dir}/test/*") foreach(d ${tests}) if(IS_DIRECTORY "${release_dir}/test/${d}") if(NOT EXISTS "${release_dir}/test/${d}/cgal_test_with_cmake") - file(COPY "${release_dir}/developer_scripts/cgal_test_with_cmake" DESTINATION "${release_dir}/test/${d}") + execute_process( + COMMAND ${CMAKE_BINARY_DIR}/Scripts/developer_scripts/create_cgal_test_with_cmake + WORKING_DIRECTORY "${release_dir}/test/${d}" + RESULT_VARIABLE RESULT_VAR + OUTPUT_VARIABLE OUT_VAR + ) + if(NOT "${RESULT_VAR}" STREQUAL "0") + message(FATAL_ERROR "Error while running create_cgal_test_with_cmake in ${release_dir}/test/${d}") + endif() endif() endif() endforeach() @@ -152,7 +160,15 @@ if (TESTSUITE) file(COPY "${release_dir}/demo/${d}" DESTINATION "${release_dir}/tmp") file(RENAME "${release_dir}/tmp/${d}" "${release_dir}/test/${d}_Demo") if(NOT EXISTS "${release_dir}/test/${d}_Demo/cgal_test_with_cmake") - file(COPY "${release_dir}/developer_scripts/cgal_test_with_cmake" DESTINATION "${release_dir}/test/${d}_Demo") + execute_process( + COMMAND ${CMAKE_BINARY_DIR}/Scripts/developer_scripts/create_cgal_test_with_cmake --no-run + WORKING_DIRECTORY "${release_dir}/test/${d}_Demo" + RESULT_VARIABLE RESULT_VAR + OUTPUT_VARIABLE OUT_VAR + ) + if(NOT "${RESULT_VAR}" STREQUAL "0") + message(FATAL_ERROR "Error while running create_cgal_test_with_cmake in ${release_dir}/test/${d}_Demo") + endif() endif() endif() endif() @@ -165,7 +181,15 @@ if (TESTSUITE) file(COPY "${release_dir}/examples/${d}" DESTINATION "${release_dir}/tmp") file(RENAME "${release_dir}/tmp/${d}" "${release_dir}/test/${d}_Examples") if(NOT EXISTS "${release_dir}/test/${d}_Examples/cgal_test_with_cmake") - file(COPY "${release_dir}/developer_scripts/cgal_test_with_cmake" DESTINATION "${release_dir}/test/${d}_Examples") + execute_process( + COMMAND ${CMAKE_BINARY_DIR}/Scripts/developer_scripts/create_cgal_test_with_cmake + WORKING_DIRECTORY "${release_dir}/test/${d}_Examples" + RESULT_VARIABLE RESULT_VAR + OUTPUT_VARIABLE OUT_VAR + ) + if(NOT "${RESULT_VAR}" STREQUAL "0") + message(FATAL_ERROR "Error while running create_cgal_test_with_cmake in ${release_dir}/test/${d}_Examples") + endif() endif() endif() endforeach()