From 49f3e1a0b3d8a869373d152039d17f5d1dc4da54 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 10 Mar 2015 18:19:51 +0000 Subject: [PATCH] Fix path to tools when in a bundle project --- examples/C/include.ctest.sh.in | 8 +++++--- examples/F90/include.ctest.sh.in | 8 +++++--- examples/python/include.ctest.sh.in | 8 +++++--- tests/include.ctest.sh.in | 14 +++++++++----- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/examples/C/include.ctest.sh.in b/examples/C/include.ctest.sh.in index 2b33c6a05..28b292331 100644 --- a/examples/C/include.ctest.sh.in +++ b/examples/C/include.ctest.sh.in @@ -10,13 +10,15 @@ fi proj_dir=@PROJECT_SOURCE_DIR@ data_dir=@PROJECT_BINARY_DIR@/data -def_dir="${proj_dir}/definitions" +# use definitions from binary dir to test if installation will be correct +def_dir="@CMAKE_BINARY_DIR@/share/@PROJECT_NAME@/definitions" ECCODES_DEFINITION_PATH="${def_dir}" export ECCODES_DEFINITION_PATH -tools_dir=@PROJECT_BINARY_DIR@/bin/ +tools_dir=@CMAKE_BINARY_DIR@/bin/ examples_dir=@CMAKE_CURRENT_BINARY_DIR@/ -samp_dir="${proj_dir}/samples" +# use samples from binary dir to test if installation will be correct +samp_dir="@CMAKE_BINARY_DIR@/share/@PROJECT_NAME@/samples" ECCODES_SAMPLES_PATH=${samp_dir} export ECCODES_SAMPLES_PATH diff --git a/examples/F90/include.ctest.sh.in b/examples/F90/include.ctest.sh.in index c78b9f345..4e86c5147 100644 --- a/examples/F90/include.ctest.sh.in +++ b/examples/F90/include.ctest.sh.in @@ -10,13 +10,15 @@ fi proj_dir=@PROJECT_SOURCE_DIR@ data_dir=@PROJECT_BINARY_DIR@/data -def_dir="${proj_dir}/definitions" +# use definitions from binary dir to test if installation will be correct +def_dir="@CMAKE_BINARY_DIR@/share/@PROJECT_NAME@/definitions" ECCODES_DEFINITION_PATH="${def_dir}" export ECCODES_DEFINITION_PATH -tools_dir=@PROJECT_BINARY_DIR@/bin/ +tools_dir=@CMAKE_BINARY_DIR@/bin/ examples_dir=@CMAKE_CURRENT_BINARY_DIR@/ -samp_dir="${proj_dir}/samples" +# use samples from binary dir to test if installation will be correct +samp_dir="@CMAKE_BINARY_DIR@/share/@PROJECT_NAME@/samples" ECCODES_SAMPLES_PATH=${samp_dir} export ECCODES_SAMPLES_PATH diff --git a/examples/python/include.ctest.sh.in b/examples/python/include.ctest.sh.in index d23731206..e3af05857 100644 --- a/examples/python/include.ctest.sh.in +++ b/examples/python/include.ctest.sh.in @@ -10,14 +10,16 @@ fi proj_dir=@PROJECT_SOURCE_DIR@ data_dir=@PROJECT_BINARY_DIR@/data -def_dir="${proj_dir}/definitions" +# use definitions from binary dir to test if installation will be correct +def_dir="@CMAKE_BINARY_DIR@/share/@PROJECT_NAME@/definitions" ECCODES_DEFINITION_PATH="${def_dir}" export ECCODES_DEFINITION_PATH -tools_dir=@PROJECT_BINARY_DIR@/bin/ +tools_dir=@CMAKE_BINARY_DIR@/bin/ examples_dir=@CMAKE_CURRENT_BINARY_DIR@/ -samp_dir="${proj_dir}/samples" +# use samples from binary dir to test if installation will be correct +samp_dir="@CMAKE_BINARY_DIR@/share/@PROJECT_NAME@/samples" ECCODES_SAMPLES_PATH=${samp_dir} export ECCODES_SAMPLES_PATH diff --git a/tests/include.ctest.sh.in b/tests/include.ctest.sh.in index e3af5ea93..cb1dd5a68 100644 --- a/tests/include.ctest.sh.in +++ b/tests/include.ctest.sh.in @@ -10,15 +10,19 @@ fi proj_dir=@PROJECT_SOURCE_DIR@ data_dir=@PROJECT_BINARY_DIR@/data -def_dir=@PROJECT_SOURCE_DIR@/definitions +# use definitions from binary dir to test if installation will be correct +def_dir="@CMAKE_BINARY_DIR@/share/@PROJECT_NAME@/definitions" ECCODES_DEFINITION_PATH="${def_dir}" export ECCODES_DEFINITION_PATH -tools_dir=@PROJECT_BINARY_DIR@/bin/ -tigge_dir=@PROJECT_BINARY_DIR@/bin/ +# binaries are in the TOP CMAKE_BINARY_DIR +tools_dir=@CMAKE_BINARY_DIR@/bin/ +tigge_dir=@CMAKE_BINARY_DIR@/bin/ + +# ecCodes tests are in the PROJECT_BINARY_DIR test_dir=@PROJECT_BINARY_DIR@/tests -samp_dir="${proj_dir}/samples" +# use samples from binary dir to test if installation will be correct +samp_dir="@CMAKE_BINARY_DIR@/share/@PROJECT_NAME@/samples" ECCODES_SAMPLES_PATH=${samp_dir} export ECCODES_SAMPLES_PATH -