diff --git a/Modules/Radiometry/OpticalCalibration/test/CMakeLists.txt b/Modules/Radiometry/OpticalCalibration/test/CMakeLists.txt
index 3221ced64e202aae2402e1a4ec311e699e00bd2d..dc0a87b1ec54d0fbce0e2e5e1b706cd73273f6dc 100644
--- a/Modules/Radiometry/OpticalCalibration/test/CMakeLists.txt
+++ b/Modules/Radiometry/OpticalCalibration/test/CMakeLists.txt
@@ -249,7 +249,7 @@ otb_add_test(NAME raTuLuminanceToImageImageFilterNew COMMAND otbOpticalCalibrati
 #FIXME Those tests have performing local copies of header, baselines...They were migrate "as it" for now in version 5.0 but
 # something cleaner could be done in the future.
 #TODO Rewrite those tests and ban local copy and cmake trickery
-if(OTB_DATA_USE_LARGEINPUT)
+if(OTB_DATA_USE_LARGEINPUT AND OTB_DATA_ROOT)
 
   set(TOULOUSEQBDIR ${TEMP}/OpticalCalibLumToImQBPAN)
   file(MAKE_DIRECTORY ${TOULOUSEQBDIR})