Skip to content

Commit

Permalink
Address @hobu 's review comment of OSGeo#1839 (review)
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 20, 2020
1 parent 9bb87ea commit c4191f3
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 80 deletions.
2 changes: 1 addition & 1 deletion src/4D_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,7 @@ PJ_INFO proj_info (void) {
// Env var mostly for testing purposes and being independent from
// an existing installation
const char* ignoreUserWritableDirectory =
getenv("PROJ_IGNORE_USER_WRITABLE_DIRECTORY");
getenv("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY");
if( ignoreUserWritableDirectory == nullptr ||
ignoreUserWritableDirectory[0] == '\0' ) {
buf = path_append(buf,
Expand Down
10 changes: 4 additions & 6 deletions src/filemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1258,13 +1258,11 @@ static const char *proj_lib_name =
nullptr;
#endif

static bool ignoreUserWritableDirectory() {
static bool dontReadUserWritableDirectory() {
// Env var mostly for testing purposes and being independent from
// an existing installation
const char *envVarIgnoreUserWritableDirectory =
getenv("PROJ_IGNORE_USER_WRITABLE_DIRECTORY");
return envVarIgnoreUserWritableDirectory != nullptr &&
envVarIgnoreUserWritableDirectory[0] != '\0';
const char *envVar = getenv("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY");
return envVar != nullptr && envVar[0] != '\0';
}

static void *
Expand Down Expand Up @@ -1336,7 +1334,7 @@ pj_open_lib_internal(projCtx ctx, const char *name, const char *mode,
}
}

else if (!ignoreUserWritableDirectory() &&
else if (!dontReadUserWritableDirectory() &&
(fid = open_file(
ctx, (pj_context_get_user_writable_directory(ctx, false) +
DIR_CHAR + name)
Expand Down
44 changes: 28 additions & 16 deletions src/grids.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1837,17 +1837,20 @@ std::unique_ptr<NTv2GridSet> NTv2GridSet::open(PJ_CONTEXT *ctx,
pj_ctx_set_errno(ctx, PJD_ERR_FAILED_TO_LOAD_GRID);
return nullptr;
}
if (memcmp(header + 56, "SECONDS", 7) != 0) {

constexpr int OFFSET_GS_TYPE = 56;
if (memcmp(header + OFFSET_GS_TYPE, "SECONDS", 7) != 0) {
pj_log(ctx, PJ_LOG_ERROR, "Only GS_TYPE=SECONDS is supported");
pj_ctx_set_errno(ctx, PJD_ERR_FAILED_TO_LOAD_GRID);
return nullptr;
}

const bool must_swap = (header[8] == 11) ? !IS_LSB : IS_LSB;
constexpr int OFFSET_NUM_SUBFILES = 8 + 32;
if (must_swap) {
// swap_words( header+8, 4, 1 );
// swap_words( header+8+16, 4, 1 );
swap_words(header + 8 + 32, 4, 1);
swap_words(header + OFFSET_NUM_SUBFILES, 4, 1);
// swap_words( header+8+7*16, 8, 1 );
// swap_words( header+8+8*16, 8, 1 );
// swap_words( header+8+9*16, 8, 1 );
Expand All @@ -1858,7 +1861,7 @@ std::unique_ptr<NTv2GridSet> NTv2GridSet::open(PJ_CONTEXT *ctx,
/* Get the subfile count out ... all we really use for now. */
/* -------------------------------------------------------------------- */
unsigned int num_subfiles;
memcpy(&num_subfiles, header + 8 + 32, 4);
memcpy(&num_subfiles, header + OFFSET_NUM_SUBFILES, 4);

std::map<std::string, NTv2Grid *> mapGrids;

Expand All @@ -1878,25 +1881,31 @@ std::unique_ptr<NTv2GridSet> NTv2GridSet::open(PJ_CONTEXT *ctx,
}

// Byte swap interesting fields if needed.
constexpr int OFFSET_GS_COUNT = 8 + 16 * 10;
constexpr int OFFSET_SOUTH_LAT = 8 + 16 * 4;
if (must_swap) {
swap_words(header + 8 + 16 * 4, sizeof(double), 6);
swap_words(header + 8 + 16 * 10, sizeof(int), 1);
// 6 double values: southLat, northLat, eastLon, westLon, resLat,
// resLon
swap_words(header + OFFSET_SOUTH_LAT, sizeof(double), 6);
swap_words(header + OFFSET_GS_COUNT, sizeof(int), 1);
}

std::string gridName;
gridName.append(header + 8, 8);

ExtentAndRes extent;
extent.westLon =
-to_double(header + 7 * 16 + 8) * DEG_TO_RAD / 3600.0; /* W_LONG */
extent.southLat =
to_double(header + 4 * 16 + 8) * DEG_TO_RAD / 3600.0; /* S_LAT */
extent.eastLon =
-to_double(header + 6 * 16 + 8) * DEG_TO_RAD / 3600.0; /* E_LONG */
extent.northLat =
to_double(header + 5 * 16 + 8) * DEG_TO_RAD / 3600.0; /* N_LAT */
extent.resLon = to_double(header + 9 * 16 + 8) * DEG_TO_RAD / 3600.0;
extent.resLat = to_double(header + 8 * 16 + 8) * DEG_TO_RAD / 3600.0;
extent.southLat = to_double(header + OFFSET_SOUTH_LAT) * DEG_TO_RAD /
3600.0; /* S_LAT */
extent.northLat = to_double(header + OFFSET_SOUTH_LAT + 16) *
DEG_TO_RAD / 3600.0; /* N_LAT */
extent.eastLon = -to_double(header + OFFSET_SOUTH_LAT + 16 * 2) *
DEG_TO_RAD / 3600.0; /* E_LONG */
extent.westLon = -to_double(header + OFFSET_SOUTH_LAT + 16 * 3) *
DEG_TO_RAD / 3600.0; /* W_LONG */
extent.resLat =
to_double(header + OFFSET_SOUTH_LAT + 16 * 4) * DEG_TO_RAD / 3600.0;
extent.resLon =
to_double(header + OFFSET_SOUTH_LAT + 16 * 5) * DEG_TO_RAD / 3600.0;

if (!(fabs(extent.westLon) <= 4 * M_PI &&
fabs(extent.eastLon) <= 4 * M_PI &&
Expand All @@ -1923,7 +1932,7 @@ std::unique_ptr<NTv2GridSet> NTv2GridSet::open(PJ_CONTEXT *ctx,
extent.northLat * RAD_TO_DEG);

unsigned int gs_count;
memcpy(&gs_count, header + 8 + 16 * 10, 4);
memcpy(&gs_count, header + OFFSET_GS_COUNT, 4);
if (gs_count / columns != static_cast<unsigned>(rows)) {
pj_log(ctx, PJ_LOG_ERROR,
"GS_COUNT(%u) does not match expected cells (%dx%d)",
Expand Down Expand Up @@ -2845,6 +2854,7 @@ ListOfHGrids pj_hgrid_init(PJ *P, const char *gridkey) {

typedef struct { pj_int32 lam, phi; } ILP;

// Apply bilinear interpolation for horizontal shift grids
static PJ_LP pj_hgrid_interpolate(PJ_LP t, const HorizontalShiftGrid *grid,
bool compensateNTConvention) {
PJ_LP val, frct;
Expand Down Expand Up @@ -3283,6 +3293,8 @@ const GenericShiftGrid *pj_find_generic_grid(const ListOfGenericGrids &grids,

// ---------------------------------------------------------------------------

// Used by +proj=deformation and +proj=xyzgridshift to do bilinear interpolation
// on 3 sample values per node.
bool pj_bilinear_interpolation_three_samples(const GenericShiftGrid *grid,
const PJ_LP &lp, int idx1,
int idx2, int idx3, double &v1,
Expand Down
2 changes: 1 addition & 1 deletion src/proj_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ struct projGridChunkCache
{
bool enabled = true;
std::string filename{};
long long max_size = 100 * 1024 * 1024;
long long max_size = 300 * 1024 * 1024;
int ttl = 86400; // 1 day
};

Expand Down
12 changes: 6 additions & 6 deletions test/cli/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ EXTRA_DIST = pj_out27.dist pj_out83.dist td_out.dist \
CMakeLists.txt

testprojinfo-check:
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTPROJINFO) $(PROJINFOEXE)
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTPROJINFO) $(PROJINFOEXE)

test27-check:
$(TEST27) $(PROJEXE)
Expand All @@ -41,24 +41,24 @@ testproj-check:
$(TESTPROJ) $(PROJEXE)

testvarious-check:
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTVARIOUS) $(CS2CSEXE)
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTVARIOUS) $(CS2CSEXE)

testdatumfile-check:
@if [ -f $(PROJ_LIB)/conus -a -f $(PROJ_LIB)/ntv1_can.dat -a -f $(PROJ_LIB)/MD -a -f $(PROJ_LIB)/ntf_r93.gsb -a -f $(PROJ_LIB)/egm96_15.gtx ]; then \
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTDATUMFILE) $(CS2CSEXE) ; \
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTDATUMFILE) $(CS2CSEXE) ; \
fi

testign-check:
@if [ -f $(PROJ_LIB)/ntf_r93.gsb ] ; then \
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTIGN) $(CS2CSEXE) ; \
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTIGN) $(CS2CSEXE) ; \
fi

testntv2-check:
@if [ -f $(PROJ_LIB)/ntv2_0.gsb -a -f $(PROJ_LIB)/conus -a -f $(PROJ_LIB)/ntv1_can.dat ] ; then \
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTNTV2) $(CS2CSEXE) ; \
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTNTV2) $(CS2CSEXE) ; \
fi

testcct-check:
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTCCT) $(CCTEXE)
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTCCT) $(CCTEXE)

check-local: testprojinfo-check test27-check test83-check testproj-check testvarious-check testdatumfile-check testign-check testntv2-check testcct-check
20 changes: 10 additions & 10 deletions test/gie/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,33 @@ EXTRA_DIST = 4D-API_cs2cs-style.gie \
PROJ_LIB ?= ../../data/for_tests

4D-API-cs2cs-style: 4D-API_cs2cs-style.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

GDA: GDA.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

axisswap: axisswap.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

builtins: builtins.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

deformation: deformation.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

ellipsoid: ellipsoid.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

more_builtins: more_builtins.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

unitconvert: unitconvert.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

DHDN_ETRS89: DHDN_ETRS89.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

geotiff_grids: geotiff_grids.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

check-local: 4D-API-cs2cs-style GDA axisswap builtins deformation ellipsoid more_builtins unitconvert DHDN_ETRS89 geotiff_grids
34 changes: 17 additions & 17 deletions test/gigs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,54 +23,54 @@ EXTRA_DIST = \
PROJ_LIB ?= ../../data/for_tests

5101.1: 5101.1-jhs.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5101.2: 5101.2-jhs.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5101.3: 5101.3-jhs.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5101.4: 5101.4-jhs-etmerc.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5102.1: 5102.1.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5103.1: 5103.1.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5103.2: 5103.2.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5103.3: 5103.3.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5105.2: 5105.2.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5106: 5106.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5107: 5107.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5109: 5109.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5111.1: 5111.1.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5112: 5112.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5113: 5113.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5201: 5201.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

5208: 5208.gie
PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<

check-local: 5101.1 5101.2 5101.3 5101.4 5102.1 5103.1 5103.2 5103.3 5105.2 5106 5107 5109 5111.1 5112 5113 5201 5208
16 changes: 8 additions & 8 deletions test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ target_link_libraries(proj_pj_transform_test
${PROJ_LIBRARIES})
add_test(NAME proj_pj_transform_test COMMAND proj_pj_transform_test)
set_property(TEST proj_pj_transform_test
PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests")
PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests")


add_executable(proj_errno_string_test
Expand All @@ -82,7 +82,7 @@ target_link_libraries(proj_errno_string_test
${PROJ_LIBRARIES})
add_test(NAME proj_errno_string_test COMMAND proj_errno_string_test)
set_property(TEST proj_errno_string_test
PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests")
PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests")

add_executable(proj_angular_io_test
main.cpp
Expand All @@ -92,7 +92,7 @@ target_link_libraries(proj_angular_io_test
${PROJ_LIBRARIES})
add_test(NAME proj_angular_io_test COMMAND proj_angular_io_test)
set_property(TEST proj_angular_io_test
PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests")
PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests")

add_executable(proj_context_test
main.cpp
Expand All @@ -102,7 +102,7 @@ target_link_libraries(proj_context_test
${PROJ_LIBRARIES})
add_test(NAME proj_context_test COMMAND proj_context_test)
set_property(TEST proj_context_test
PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests")
PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests")

if(MSVC AND BUILD_LIBPROJ_SHARED)
# ph_phi2_test not compatible of a .dll build
Expand All @@ -115,7 +115,7 @@ else()
${PROJ_LIBRARIES})
add_test(NAME pj_phi2_test COMMAND pj_phi2_test)
set_property(TEST pj_phi2_test
PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests")
PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests")
endif()

add_executable(proj_test_cpp_api
Expand All @@ -136,7 +136,7 @@ target_link_libraries(proj_test_cpp_api
${SQLITE3_LIBRARY})
add_test(NAME proj_test_cpp_api COMMAND proj_test_cpp_api)
set_property(TEST proj_test_cpp_api
PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests")
PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests")


add_executable(gie_self_tests
Expand All @@ -147,7 +147,7 @@ target_link_libraries(gie_self_tests
${PROJ_LIBRARIES})
add_test(NAME gie_self_tests COMMAND gie_self_tests)
set_property(TEST gie_self_tests
PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests")
PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests")


add_executable(test_network
Expand All @@ -163,4 +163,4 @@ target_link_libraries(test_network
${SQLITE3_LIBRARY})
add_test(NAME test_network COMMAND test_network)
set_property(TEST test_network
PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests;PROJ_SOURCE_DATA=${PROJECT_SOURCE_DIR}/data")
PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests;PROJ_SOURCE_DATA=${PROJECT_SOURCE_DIR}/data")
Loading

0 comments on commit c4191f3

Please sign in to comment.