Fix builddir vs srdir problem for ncdump/ctest.c and ctest64.c

This commit is contained in:
Russ Rew 2015-08-18 16:10:18 -06:00
parent ced515b895
commit 495fea71b9
2 changed files with 9 additions and 10 deletions

View File

@ -4,14 +4,14 @@ IF(BUILD_SHARED_LIBS AND WIN32)
ENDIF()
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/ctest.c
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ctest.c
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/ref_ctest.c"
"${CMAKE_CURRENT_SOURCE_DIR}/ctest.c"
"${CMAKE_CURRENT_BINARY_DIR}/ctest.c"
)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/ctest64.c
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ctest64.c
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/ref_ctest64.c"
"${CMAKE_CURRENT_SOURCE_DIR}/ctest64.c"
"${CMAKE_CURRENT_BINARY_DIR}/ctest64.c"
)
SET(ncdump_FILES ncdump.c vardata.c dumplib.c indent.c nctime0.c utils.c nciter.c)

View File

@ -68,16 +68,16 @@ endif #!USE_NETCDF4
BUILT_SOURCES = ctest.c ctest64.c
if EXTRA_TESTS
ctest.c:
$(top_builddir)/ncgen/ncgen -lc -o ctest0.nc $(top_srcdir)/ncgen/c0.cdl >$(srcdir)/ctest.c
$(top_builddir)/ncgen/ncgen -lc -o ctest0.nc $(top_srcdir)/ncgen/c0.cdl > $(top_builddir)/ncdump/ctest.c
ctest64.c:
$(top_builddir)/ncgen/ncgen -v2 -lc -o ctest0_64.nc $(top_srcdir)/ncgen/c0.cdl > $(srcdir)/ctest64.c
$(top_builddir)/ncgen/ncgen -v2 -lc -o ctest0_64.nc $(top_srcdir)/ncgen/c0.cdl > $(top_builddir)/ncdump/ctest64.c
else
ctest.c:
cp $(top_srcdir)/ncdump/ref_ctest.c $(top_srcdir)/ncdump/ctest.c
cp $(top_srcdir)/ncdump/ref_ctest.c $(top_builddir)/ncdump/ctest.c
ctest64.c:
cp $(top_srcdir)/ncdump/ref_ctest64.c $(top_srcdir)/ncdump/ctest64.c
cp $(top_srcdir)/ncdump/ref_ctest64.c $(top_builddir)/ncdump/ctest64.c
endif
#if !BUILD_DLL
@ -137,8 +137,7 @@ CMakeLists.txt XGetopt.c tst_bom.sh tst_inmemory.sh
# CDL files and Expected results
SUBDIRS=cdl expected
EXTRA_DIST += tst_ncgen_shared.sh tst_ncgen4.sh tst_ncgen4_classic.sh \
tst_ncgen4_diff.sh tst_ncgen4_cycle.sh ref_ctest.c ref_ctest64.c \
ctest.c ctest64.c
tst_ncgen4_diff.sh tst_ncgen4_cycle.sh ref_ctest.c ref_ctest64.c
CLEANFILES += results/*.nc results/*.dmp results/*.dmp2 tmp*.cdl tst_bug324.nc
DISTCLEANFILES = results