diff --git a/CMakeLists.txt b/CMakeLists.txt index 76667583c..b4c6fef84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1860,6 +1860,7 @@ SET(host_cpu "${cpu}") SET(host_vendor "${osname}") SET(host_os "${osrel}") SET(abs_top_builddir "${CMAKE_BINARY_DIR}") +SET(abs_top_srcdir "${CMAKE_SOURCE_DIR}") SET(CC_VERSION "${CMAKE_C_COMPILER}") diff --git a/configure.ac b/configure.ac index 6b3c86ba5..4ca9964a8 100644 --- a/configure.ac +++ b/configure.ac @@ -1442,9 +1442,10 @@ abs_top_builddir=`pwd` cd $srcdir abs_top_srcdir=`pwd` cd $abs_top_builddir -#AC_CONFIG_FILES(test_common.sh.in) -rm -f ${abs_top_builddir}/test_common.sh -sed -e "s|@TOPSRCDIR@|${abs_top_srcdir}|" -e "s|@TOPBUILDDIR@|${abs_top_builddir}|" <${abs_top_srcdir}/test_common.in >${abs_top_builddir}/test_common.sh + +AC_CONFIG_FILES(test_common.sh:test_common.in) +#rm -f ${abs_top_builddir}/test_common.sh +#sed -e "s|@TOPSRCDIR@|${abs_top_srcdir}|" -e "s|@TOPBUILDDIR@|${abs_top_builddir}|" <${abs_top_srcdir}/test_common.in >${abs_top_builddir}/test_common.sh ##### # End netcdf_meta.h definitions. diff --git a/test_common.in b/test_common.in index 553b242c2..89720b521 100644 --- a/test_common.in +++ b/test_common.in @@ -1,7 +1,7 @@ set -e -TOPSRCDIR=@TOPSRCDIR@ -TOPBUILDDIR=@TOPBUILDDIR@ +TOPSRCDIR=@abs_top_srcdir@ +TOPBUILDDIR=@abs_top_builddir@ # Figure out various locations in the src/build tree. # This is relatively fragile code and is essentially @@ -20,7 +20,7 @@ TOPBUILDDIR=@TOPBUILDDIR@ # the src and build trees are distinct. # 4. Cmake on windows using cygwin or msys. # The src and build trees are distinct. -# +# # For now, an explicit build using the Visual C(++) compiler # is not supported. The big issue is the handling of executables # and the notion of a VS configuration/build type like Debug or Release. @@ -29,11 +29,11 @@ TOPBUILDDIR=@TOPBUILDDIR@ # Thus one finds ncdump.exe in $top_builddir/ncdump/Debug instead of # $top_builddir/ncdump. An additional issue is the extension of an # executable: .exe vs nothing. This code attempts to figure out which is used. -# +# # For possible future fixes, a placeholder is left in place in the # following code named VS. If it were set to the build type, then, # in theory, this code would work with Visual C. It is disabled for now. -# +# # The goal, then, of this common code is to set up some useful #constants for use in test shell scripts. # 1. srcdir - absolute path to the source dir (e.g. ${top_srcdir}/ncgen)