diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-01-05 22:55:01 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-01-05 23:50:38 +0100 |
| commit | cff5dd526edebd8aefa4405e7a9ddf7914fd79fc (patch) | |
| tree | 75d10eb9111b7f2a72ff611a1d6ae8b5539a8176 /data/CMakeLists.txt | |
| parent | 5be02bf6d1d45ac0d835c138074611843982e9e8 (diff) | |
| download | PROJ-cff5dd526edebd8aefa4405e7a9ddf7914fd79fc.tar.gz PROJ-cff5dd526edebd8aefa4405e7a9ddf7914fd79fc.zip | |
Make sure tests pass if extra grids are present
Should fix the issue reported in https://lists.osgeo.org/pipermail/proj/2020-January/009188.html
Some extra north-american grids present in data/ can affect the results of
some tests, so create a data/for_tests/ subdirectory in which we copy only
select grids.
Diffstat (limited to 'data/CMakeLists.txt')
| -rw-r--r-- | data/CMakeLists.txt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 8f3965f2..f0e1dab6 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -44,6 +44,7 @@ add_custom_command( OUTPUT ${PROJ_DB} COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJ_DB} COMMAND ${EXE_SQLITE3} -init ${ALL_SQL_IN} ${PROJ_DB} .quit + COMMAND ${CMAKE_COMMAND} -E copy ${PROJ_DB} ${CMAKE_CURRENT_BINARY_DIR}/for_tests # note: we didn't port yet the foreign_key_check done in Makefile.am DEPENDS generate_all_sql_in ${ALL_SQL_IN} COMMENT "Generating proj.db" @@ -58,6 +59,33 @@ if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") endforeach() endif() +# Copy select resource files in a for_tests subdirectory so that we are not +# influenced by the presence of other grids +# Note: this is done at configure/cmake time, not build time. +# So if you install new grids in the source data/ subdirectory, run cmake again +set(DATA_FOR_TESTS + null + GL27 + nad27 + nad83 + ntv1_can.dat + MD + ntf_r93.gsb + egm96_15.gtx + ntv2_0.gsb + conus + alaska + nzgd2kgrid0005.gsb + ITRF2000 + BETA2007.gsb) + +execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/for_tests) +foreach(FILE ${DATA_FOR_TESTS}) + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${CMAKE_CURRENT_BINARY_DIR}/for_tests/${FILE} COPYONLY) + endif() +endforeach() + # #install # |
