Merge branch 'function-interface-wrong-package'

This commit is contained in:
Kenneth Moreland 2014-10-08 10:07:51 -06:00
commit 750dd66687
7 changed files with 37 additions and 24 deletions

@ -63,9 +63,22 @@ execute_process(
if(${diff_result})
# If diff returned non-zero, it failed and the two files are different.
file(REMOVE ${GENERATED_FILE})
get_filename_component(filename ${SOURCE_FILE} NAME)
# Move the generated file so that the build does not confuse it with the
# files in the source directory.
file(REMOVE ${GENERATED_FILE}.save)
file(RENAME ${GENERATED_FILE} ${GENERATED_FILE}.save)
message(SEND_ERROR
"The source file ${filename} does not match the generated file. If you have modified this file directly, then you have messed up. Modify the ${filename}.in file instead and then copy the pyexpander result to ${filename}. If you modified ${filename}.in, then you might just need to copy the pyresult back to the source directory. If you have not modifed either, then you have likely checked out an inappropriate change. Check the git logs to see what changes were made.
If the changes have resulted from modifying ${filename}.in, then you can finish by copying ${GENERATED_FILE} to ${SOURCE_FILE}.")
If the changes have resulted from modifying ${filename}.in, then you can finish by moving ${GENERATED_FILE}.save over ${SOURCE_FILE}")
else()
# Now that we have done the comparison, remove the generated file so there is
# no confusion between the generated files and the source files checked into
# the repository.
file(REMOVE ${GENERATED_FILE})
# Pyexpander successfully checked, so touch a file to tell make when the
# check was last successfully performed.
execute_process(
COMMAND ${CMAKE_COMMAND} -E touch ${GENERATED_FILE}.checked
)
endif()

@ -135,7 +135,7 @@ function(vtkm_pyexpander_generated_file generated_file_name)
# If pyexpander is available, add targets to build and check
if(PYEXPANDER_FOUND)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${generated_file_name}
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${generated_file_name}.checked
COMMAND ${CMAKE_COMMAND}
-DPYEXPANDER_COMMAND=${PYEXPANDER_COMMAND}
-DSOURCE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/${generated_file_name}
@ -143,10 +143,10 @@ function(vtkm_pyexpander_generated_file generated_file_name)
-P ${CMAKE_SOURCE_DIR}/CMake/VTKmCheckPyexpander.cmake
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${generated_file_name}.in
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${generated_file_name}
COMMENT "Checking validity of ${generated_file_name}"
)
add_custom_target(check_${generated_file_name} ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${generated_file_name}
COMMENT "Checking validity of ${generated_file_name}"
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${generated_file_name}.checked
)
endif()
endfunction(vtkm_pyexpander_generated_file)

@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtk_m_cont_internal_FunctionInterface_h
#define vtk_m_cont_internal_FunctionInterface_h
#ifndef vtk_m_internal_FunctionInterface_h
#define vtk_m_internal_FunctionInterface_h
#include <vtkm/Types.h>
#include <vtkm/cont/ErrorControlBadValue.h>
@ -753,4 +753,4 @@ private:
#include <vtkm/internal/FunctionInterfaceDetailPost.h>
#endif //vtk_m_cont_internal_FunctionInterface_h
#endif //vtk_m_internal_FunctionInterface_h

@ -20,10 +20,10 @@
// **** DO NOT EDIT THIS FILE!!! ****
// This file is automatically generated by FunctionInterfaceDetailPost.h.in
#ifndef vtk_m_cont_internal_FunctionInterfaceDetailPost_h
#define vtk_m_cont_internal_FunctionInterfaceDetailPost_h
#ifndef vtk_m_internal_FunctionInterfaceDetailPost_h
#define vtk_m_internal_FunctionInterfaceDetailPost_h
#if !defined(vtk_m_cont_internal_FunctionInterface_h) && !defined(VTKM_TEST_HEADER_BUILD)
#if !defined(vtk_m_internal_FunctionInterface_h) && !defined(VTKM_TEST_HEADER_BUILD)
#error FunctionInterfaceDetailPre.h must be included from FunctionInterface.h
#endif
@ -644,4 +644,4 @@ make_FunctionInterface(
}
} // namespace vtkm::internal
#endif //vtk_m_cont_internal_FunctionInterfaceDetailPost_h
#endif //vtk_m_internal_FunctionInterfaceDetailPost_h

@ -32,10 +32,10 @@ $# Ignore the following comment. It is meant for the generated file.
// **** DO NOT EDIT THIS FILE!!! ****
// This file is automatically generated by FunctionInterfaceDetailPost.h.in
#ifndef vtk_m_cont_internal_FunctionInterfaceDetailPost_h
#define vtk_m_cont_internal_FunctionInterfaceDetailPost_h
#ifndef vtk_m_internal_FunctionInterfaceDetailPost_h
#define vtk_m_internal_FunctionInterfaceDetailPost_h
#if !defined(vtk_m_cont_internal_FunctionInterface_h) && !defined(VTKM_TEST_HEADER_BUILD)
#if !defined(vtk_m_internal_FunctionInterface_h) && !defined(VTKM_TEST_HEADER_BUILD)
#error FunctionInterfaceDetailPre.h must be included from FunctionInterface.h
#endif
@ -139,4 +139,4 @@ $endfor\
}
} // namespace vtkm::internal
#endif //vtk_m_cont_internal_FunctionInterfaceDetailPost_h
#endif //vtk_m_internal_FunctionInterfaceDetailPost_h

@ -20,10 +20,10 @@
// **** DO NOT EDIT THIS FILE!!! ****
// This file is automatically generated by FunctionInterfaceDetailPre.h.in
#ifndef vtk_m_cont_internal_FunctionInterfaceDetailPre_h
#define vtk_m_cont_internal_FunctionInterfaceDetailPre_h
#ifndef vtk_m_internal_FunctionInterfaceDetailPre_h
#define vtk_m_internal_FunctionInterfaceDetailPre_h
#if !defined(vtk_m_cont_internal_FunctionInterface_h) && !defined(VTKM_TEST_HEADER_BUILD)
#if !defined(vtk_m_internal_FunctionInterface_h) && !defined(VTKM_TEST_HEADER_BUILD)
#error FunctionInterfaceDetailPre.h must be included from FunctionInterface.h
#endif
@ -3672,4 +3672,4 @@ void DoForEachExec(
}
} // namespace vtkm::internal
#endif //vtk_m_cont_internal_FunctionInterfaceDetailPre_h
#endif //vtk_m_internal_FunctionInterfaceDetailPre_h

@ -32,10 +32,10 @@ $# Ignore the following comment. It is meant for the generated file.
// **** DO NOT EDIT THIS FILE!!! ****
// This file is automatically generated by FunctionInterfaceDetailPre.h.in
#ifndef vtk_m_cont_internal_FunctionInterfaceDetailPre_h
#define vtk_m_cont_internal_FunctionInterfaceDetailPre_h
#ifndef vtk_m_internal_FunctionInterfaceDetailPre_h
#define vtk_m_internal_FunctionInterfaceDetailPre_h
#if !defined(vtk_m_cont_internal_FunctionInterface_h) && !defined(VTKM_TEST_HEADER_BUILD)
#if !defined(vtk_m_internal_FunctionInterface_h) && !defined(VTKM_TEST_HEADER_BUILD)
#error FunctionInterfaceDetailPre.h must be included from FunctionInterface.h
#endif
@ -269,4 +269,4 @@ $endfor\
}
} // namespace vtkm::internal
#endif //vtk_m_cont_internal_FunctionInterfaceDetailPre_h
#endif //vtk_m_internal_FunctionInterfaceDetailPre_h